Subject: [FFC-dev] initialisastion of 'offset' in function 'dofmap'

From: "Garth N. Wells" <[email-masked]>
Date: Mon, 26 Sep 2005 11:31:30 +0200

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);
    }

---

From: Anders Logg <[email-masked]>
Date: Mon, 26 Sep 2005 09:12:17 -0500

ok, should be a quick fix.

/Anders

On Mon, Sep 26, 2005 at 11:31:30AM +0200, Garth N. Wells wrote:
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/cgi-bin/mailman/listinfo/ffc-dev
> 

-- 
Anders Logg
Research Assistant Professor
Toyota Technological Institute at Chicago
http://www.tti-c.org/logg/