- changed milestone to 1.5
Function(space, vector) constructor is ill-defined in parallel
Creating function from an already initialized vector (which may have no knowledge of DOF map, hence not having ghosts) ensures none of the following:
- ghosts are additionally prepared
- error is raised when ghosts are missing
Following code demonstrates the problem:
from dolfin import *
mesh = UnitCubeMesh(6, 6, 6)
V = FunctionSpace(mesh, "CG", 1)
v = TestFunction(V)
while True:
x = assemble(v*dx)
u = Function(V, x)
print assemble(u*dx)
With debugging-enabled PETSc it raises PETSC_ERR_ARG_OUTOFRANGE 63
but computes random rubish with production builds.
Note: C++ documentation says *Warning: This constructor is intended for internal library use only*
. This is apparently not reflected in python version.
Note: The example above also demonstrates that there is left some debugging print statement somewhere in the code resulting in the output like Local size, dim: 165, 343
.
Comments (4)
-
-
- changed milestone to 1.6
-
- changed status to resolved
Fix Issue
#339by improving Python doc string for Function construction with a vector.→ <<cset 875d2d908e1a>>
-
- removed milestone
Removing milestone: 1.6 (automated comment)
- Log in to comment