← Back to team overview

ffc team mailing list archive

initialisastion of 'offset' in function 'dofmap'

 

Hi Anders,

When implementing a mixed method using equal-order basis functions, ffc is not
correctly initialising 'offset' in the function dofmap in the DOLFIN header
file. Below are two pieces of code.

Garth

This is what I'm getting using equal-order linear basis functions,

    void dofmap(int dofs[], const Cell& cell, const Mesh& mesh) const    {
      dofs[0] = cell.nodeID(0);
      dofs[1] = cell.nodeID(1);
      dofs[2] = cell.nodeID(2);
      offset = offset + mesh.noNodes();
      dofs[3] = offset + cell.nodeID(0);
      dofs[4] = offset + cell.nodeID(1);
      dofs[5] = offset + cell.nodeID(2);
    }

When making one of the fields quadratic, things look better,

    void dofmap(int dofs[], const Cell& cell, const Mesh& mesh) const
    {
      dofs[0] = cell.nodeID(0);
      dofs[1] = cell.nodeID(1);
      dofs[2] = cell.nodeID(2);
      int offset = mesh.noNodes();
      dofs[3] = offset + cell.edgeID(0);
      dofs[4] = offset + cell.edgeID(1);
      dofs[5] = offset + cell.edgeID(2);
      offset = offset + mesh.noEdges();
      dofs[6] = offset + cell.nodeID(0);
      dofs[7] = offset + cell.nodeID(1);
      dofs[8] = offset + cell.nodeID(2);
    }



Follow ups