Add function space abstraction to ufl

Issue #35 resolved
Martin Sandve Alnæs created an issue

Adding the domain as a property of the finite element was a mistake which I'm currently reverting. To fix it I'm introducing a new abstraction that mirrors the dolfin.FunctionSpace.

I'd like to call it a ufl.FunctionSpace, but in my branch it's currently called ufl.FiniteElementSpace. Any opinions on this?

A ufl.FiniteElementSpace has a ufl.FiniteElement and a ufl.Domain.

Besides ufl.FiniteElementSpace there will be a ufl.MixedFiniteElementSpace to represent the concept of a 'globally mixed' function space where the components may have different domains (meshes, restrictions, interior/boundary, etc.).

In the end I'd like the dolfin python layer to inherit directly from ufl classes like this:

dolfin.Mesh -> (ufl.Domain, cpp.Mesh)
dolfin.FunctionSpace -> (ufl.FiniteElementSpace, cpp.FunctionSpace)
dolfin.MixedFunctionSpace -> (ufl.MixedFiniteElementSpace, cpp.FunctionSpace)
dolfin.Function -> (ufl.Coefficient, cpp.Function)
dolfin.CoordinateFunction -> (ufl.Coefficient, cpp.CoordinateFunction)

The above is of course just the core design without a lot of the details.

Comments (7)

  1. Martin Sandve Alnæs reporter
    • changed milestone to 1.5

    Waiting for release so we can remove some deprecated code which will simplify the implementation.

  2. Martin Sandve Alnæs reporter

    ufl.FunctionSpace is now in use from dolfin. A globally mixed ufl.MixedFunctionSpace will be a separate issue.

  3. Log in to comment