← Back to team overview

ffc team mailing list archive

Re: dofmap() bug for discontinuous Lagrange

 

Yes, this seems to be a bug. I will take a look.

/Anders

On Sat, Jun 04, 2005 at 03:54:31PM +0200, Johan Jansson wrote:
> Hi!
> 
> There seems to be a bug in the dofmap generation for discontinuous
> Lagrange elements. What happens is that dofmap() seems to think there
> are more dofs than there really are. Consider this form:
> 
> # Test form for updated elasticity
> 
> name = "ElasticityUpdatedSigma0"
> element1 = FiniteElement("Vector Lagrange", "tetrahedron", 1)
> element2 = FiniteElement("Discontinuous vector Lagrange", "tetrahedron", 0)
> 
> c1 = Constant() # Lame coefficient
> c2 = Constant() # Lame coefficient
> 
> q = BasisFunction(element2)
> v = Function(element1)
> 
> L = ((2 * c1 * v[i].dx(i) * q[0]) +
>         (c2 * (v[i].dx(0) + v[0].dx(i))) * q[i]) * dx
> 
> The generated code looks like this:
> 
> ...
> 
>     inline unsigned int spacedim() const
>     {
>       return 3;
>     }
> 
> ...
> 
>     void dofmap(int dofs[], const Cell& cell, const Mesh& mesh) const
>     {
>       dofs[0] = 3*cell.id() + 0;
>       dofs[1] = 3*cell.id() + 1;
>       dofs[2] = 3*cell.id() + 2;
>       int offset = 3*mesh.noCells();
>       dofs[3] = offset + 3*cell.id() + 0;
>       dofs[4] = offset + 3*cell.id() + 1;
>       dofs[5] = offset + 3*cell.id() + 2;
>       offset = offset + 3*mesh.noCells();
>       dofs[6] = offset + 3*cell.id() + 0;
>       dofs[7] = offset + 3*cell.id() + 1;
>       dofs[8] = offset + 3*cell.id() + 2;
>     }
> 
> ...
> 
> For some reason dofmap() seems to think there are 9 dofs on the
> element. If I just remove the extra lines, then it works ok.
> 
>   Johan
> 
> _______________________________________________
> 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/



Follow ups

References