ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #00325
Re: initialisastion of 'offset' in function 'dofmap'
ok, should be a quick fix.
/Anders
On Mon, Sep 26, 2005 at 11:31:30AM +0200, Garth N. Wells wrote:
> 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);
> }
>
> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> 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/
References