Project with sub-dofmaps broken

Issue #147 invalid
Erich Foster created an issue

Using the following simple code I can use project and QV.sub(0) in the lates nightly for OS X 10.7. If instead I try using the original FunctionSpace things don't seem to be in the correct order.

from dolfin import *

mesh = UnitIntervalMesh(10)
Q = FunctionSpace(mesh, 'CG',1)
QV = MixedFunctionSpace([Q,Q])

project(Constant(1.0), Q) #works
project(Constant(1.0),QV.sub(0)) #breaks
Traceback (most recent call last):
  File "./test.py", line 9, in <module>
    project(Constant(1.0),QV.sub(0)) #breaks
  File "/Applications/FEniCS.app/Contents/Resources/lib/python2.7/site-packages/dolfin/fem/projection.py", line 104, in project
    form_compiler_parameters=form_compiler_parameters)
  File "/Applications/FEniCS.app/Contents/Resources/lib/python2.7/site-packages/dolfin/fem/assembling.py", line 317, in assemble_system
    assembler.assemble(A_tensor, b_tensor)
RuntimeError:

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
***     fenics@fenicsproject.org
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to access ownership range of degree of freedom mapping.
*** Reason:  Cannot determine ownership range for sub-dofmaps.
*** Where:   This error was encountered inside DofMap.cpp.
*** Process: 0
*** DOLFIN version: 1.2.0+
*** Git changeset:
*** -------------------------------------------------------------------------

Comments (5)

  1. Prof Garth Wells

    You cannot project onto subspaces as they are views into a space. You need to collapse the space first.

  2. Log in to comment