Symmetric TensorFunctionSpace

Bug #492208 reported by Gerd Wachsmuth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Won't Fix
Undecided
Unassigned

Bug Description

Dolfin ver. 0.9.2:

Creating of a function space with symmetric tensor fails.

Minimal example:
====
from dolfin import *
mesh = UnitSquare(3,3)
S = TensorFunctionSpace(mesh, "CG", 1, symmetry=True)
====

Workaround:
====
from dolfin import *
mesh = UnitSquare(3,3)
dim = 2
symmetry = dict( ((i,j), (j,i)) for i in range(dim) for j in range(dim) if i > j )
S = TensorFunctionSpace(mesh, "CG", 1, symmetry=symmetry)
====

The reason is that in dolfin/functionspace.py:297, TensorFunctionSpace.__init__ already sets the shape and then ufl/finiteelement.py, TensorElement.__init__ doesn't know how to handle the symmetry=Yes

Fix:
Deleting lines 296-299 in dolfin/functionspace.py:
====
        # Create subspaces
        if shape == None:
            dim = mesh.topology().dim()
            shape = (dim,dim)
====

Another (additional) possibilty is, if TensorElement.__init__ would also handle symmetry=Yes for arbitrary quadratic shapes.

Revision history for this message
Anders Logg (logg) wrote :

Please try the latest development version and verify that the bug persists. If so, file a new bug report.
We won't fix bugs in old DOLFIN versions, at least not for now.
Thanks.

Changed in dolfin:
status: New → Won't Fix
Revision history for this message
Gerd Wachsmuth (gerd-wachsmuth) wrote :

It doesn't work in the development version.

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

Tensor support is more or less untested and requires thorough examination of UFL, FFC and DOLFIN. See

    https://blueprints.launchpad.net/ffc/+spec/tensor-functions

It's unlikely that we'll accept a patch at this stage without unit tests and demos since a thorough code review is necessary.

It would be helpful if you could supply a simple test program. We can add it to the sandbox as a test case which can be targeted.

Revision history for this message
Gerd Wachsmuth (gerd-wachsmuth) wrote :

Here is a simple test. It works fine without symmetry.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

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