- edited description
assembling over subspace fails - create a better error message
When assembling a form over a subspace, e.g., W.sub(0)
, the assembler will cowardly bail out.
MWE:
from dolfin import *
mesh = UnitSquareMesh(20, 20)
V = FunctionSpace(mesh, 'CG', 1)
W = V * V
print V
print W.sub(0)
u = TrialFunction(W.sub(0))
v = TestFunction(W.sub(0))
assemble(u * v * dx)
fails with
[0]PETSC ERROR: Arguments are incompatible!
[0]PETSC ERROR: Local column size 882 cannot be larger than global column size 441!
Comments (12)
-
reporter -
W.sub(0)
provides a view into the FunctionSpaceW
, which is the cause the problem. We'll need to dig into the code to find a resolution.We have had other issues with the distinction between FunctionSpaces and views into FunctionSpaces. Maybe we should make a FunctionSpace view a different type.
-
@nschloe What would you like to assemble? A matrix whose rows and columns are indexed by a subset of {0, 1, 2, ..., W.dim()-1}?
-
reporter @blechta I would have expected to get the same matrix as for assembling over
V
since it appears to be really the same asW.sub(0)
. -
It could be that this threw an error in the past, but that since Johan added the dof ownership range to sub-maps it allocates a vector of the wrong length. Needs some digging.
-
@nschloe I think that Garth pointed out many times that
V
is not the same asW.sub(0)
. -
- changed milestone to 1.5
-
The fix for this is a more informative error message.
-
- changed title to assembling over subspace fails - create a better error message
-
- changed milestone to 1.6
-
- changed milestone to 1.7
-
- removed milestone
Removing milestone: 1.7 (automated comment)
- Log in to comment