tabulate_dofs gives incorrect results for mixed-mixed function spaces

Bug #586533 reported by Marie Rognes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
High
Unassigned

Bug Description

There seems to be a bug in tabulate_dofs for mixed-mixed function spaces. (It might
have to do with the applied offset.)

This only shows up for mixed spaces where the non-first element is also a mixed element.

* Example:

** Output:

dofs for W.sub(0) = [0 1 3]
dofs for W.sub(1).sub(0) = [0 1 3]
dofs for W.sub(1).sub(1) = [4 5 7]
dofs for W.sub(1) = [ 4 5 7 8 9 11]

** Input:

from dolfin import *
import numpy

mesh = UnitSquare(1, 1)

V = FunctionSpace(mesh, "CG", 1)
Q = VectorFunctionSpace(mesh, "CG", 1)
W = V * Q

dofs = numpy.array((0,)*3, dtype="I")
for cell in cells(mesh):
    W.sub(0).dofmap().tabulate_dofs(dofs, cell)
    print "dofs for W.sub(0) = ", dofs

    L = W.sub(1)
    L.sub(0).dofmap().tabulate_dofs(dofs, cell)
    print "dofs for W.sub(1).sub(0) = ", dofs

    L.sub(1).dofmap().tabulate_dofs(dofs, cell)
    print "dofs for W.sub(1).sub(1) = ", dofs

    dofs = numpy.array((0,)*6, dtype="I")
    L.dofmap().tabulate_dofs(dofs, cell)
    print "dofs for W.sub(1) = ", dofs
    exit()

Anders Logg (logg)
Changed in dolfin:
status: New → Confirmed
Revision history for this message
Garth Wells (garth-wells) wrote :

I've made some changes to the DofMap class today, including a change to the offset. Can you test again (in serial and in parallel)?

Revision history for this message
Garth Wells (garth-wells) wrote :

I've added something like this as a DOLFIN unit test,

    http://bazaar.launchpad.net/~dolfin-core/dolfin/main/revision/4777

Changed in dolfin:
status: Confirmed → Fix Committed
Revision history for this message
Marie Rognes (meg-simula) wrote : Re: [Bug 586533] Re: tabulate_dofs gives incorrect results for mixed-mixed function spaces

On 31. mai 2010 16:43, Garth Wells wrote:
> I've made some changes to the DofMap class today, including a change to
> the offset. Can you test again (in serial and in parallel)?
>
>

Looks much better in serial. Thanks :)

--
Marie

Changed in dolfin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.