Subfunction assignment broken
Issue #170
wontfix
The code:
Function f (function_space);
Function u(function_space[0].collapse());
f[0] = u;
is broken. The assignment operator of Function does not handle the case where this is a subfunction.
Moreover, the current state of the assignment operator permits to assign to a subfunction a function which can potentially have a completely unrelated function space.
Function::operator=
needs to handle the case where this is a subfunction. For instance it can throw throw if the function spaces are incompatible and copy the right vector values otherwise.
Comments (4)
-
-
reporter - attached issue170-sscce.tar.gz
-
reporter I attached a short example. Maybe
Function::operator=
should be partially refactored in terms ofassign
(I just noticed theFunctionAssigner
class, very nice). -
- changed status to wontfix
Superseded by
FunctionAssigner
class. - Log in to comment
Could you please hand a minimum but runnable code reproducing the error?
With the
FunctionAssigner
in place I wonder ifFunction::operator=(const Function& v)
only should allow assignment of fullFunctions
(not subFunction
) within the sameFunctionSpace
.