- marked as proposal
Do not allow re-intialisation of GenericTensor/Vector/Matrix
See mailing list thread http://fenicsproject.org/pipermail/fenics/2014-January/000990.html.
Comments (8)
-
reporter -
reporter - changed status to resolved
Fixed in 832c1b1.
It's not anticipated that this will break any user code, but some tweaking may be required. It will issue warnings for usage that will become an error in a future version.
-
@garth-wells This
from dolfin import * mesh = UnitSquareMesh(3, 3) V = VectorFunctionSpace(mesh, 'CG', 1) P = FunctionSpace(mesh, 'CG', 1) W = MixedFunctionSpace([V, P]) v = Function(V) w = Function(W) w0, w1 = w.split() v.assign(w0)
was working in 1.3.0 and now raises
*** Error: Unable to initialize vector of degrees of freedom for function. *** Reason: Cannot re-initialize a non-empty vector. Consider creating a new function. *** Where: This error was encountered inside Function.cpp.
It can be worked-around by
FunctionAssigner
but shouldn't it be resolved to keep old codes working? (I have a suspicion that this is trivial.) -
Oh, by reading again, I now probably see that this is intended behaviour.
-
Issue
#291was marked as a duplicate of this issue. -
reporter - removed milestone
Removing milestone: 1.4 (automated comment)
-
Hi, I'm currently migrating some 1.2 code to 1.4 and just ran into the same issue (cannot re-initialize...). How can I use the FunctionAssigner to fix this (any 2-line example code)? I'm not well aware of the inner guts of Dolfin, hence my ignorance. Cheers
-
@adufour, please ask on http://fenicsproject.org/qa to in order to get helped.
- Log in to comment