← Back to team overview

dolfin team mailing list archive

Re: XML format for Higher Order meshes

 

On Wed, Sep 03, 2008 at 06:36:13PM -0400, Shawn Walker wrote:
> I have a question about accessing the right degrees of freedom of a 
> Function.
> 
> Let's assume I am inside the UFCCell.h file under the 'init' routine.  Say 
> there is a Function already defined and created there that has the 
> following FFC signature:
> 
> "Mixed finite element: [Lagrange finite element of degree 2 on a triangle, 
> Lagrange finite element of degree 2 on a triangle]"
> 
> "FFC dof map for Mixed finite element: [Lagrange finite element of degree 
> 2 on a triangle, Lagrange finite element of degree 2 on a triangle]"
> 
> I know how to get the functions vector values if I know what entry I need 
> in its vector format.  But how do I get the entry indices for a particular 
> triangle?  For this example, there should be 6 indices for accessing the 6 
> values for the 6 different finite element basis functions on a particular 
> triangle.  Is this obtained from cell.entities?

The local-to-global mapping is obtained from the tabulate_dofs()
function in a ufc::dof_map.

But if one has a Function (as you have for the coordinates), then it's
more convenient to call the interpolate() function in the Function
class:

  /// Interpolate function to finite element space on cell
  void interpolate(real* coefficients,
                   const ufc::cell& ufc_cell,
                   const ufc::finite_element& finite_element,
                   Cell& cell, int facet = -1);

The coefficients array will be filled out with the values for all the
dofs on the given cell.

These values should be ordered

  x for vertex 0
  x for vertex 1
  x for vertex 2
  x for edge 0
  x for edge 1
  x for edge 2
  y for vertex 0
  y for vertex 1
  etc

-- 
Anders

Attachment: signature.asc
Description: Digital signature


References