- changed status to resolved
multiplication of a Vector by a scalar modifies the vector in place.
Issue #689
invalid
Using the following code:
from fenics import *
mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(mesh, "CG", 1)
f = interpolate(Constant(1), V)
f_vec = f.vector()
print (f_vec*2).array()
one discovers that f_vec now has the value 2. This is at a minimum a really horrible abuse of notation (*
really should not modify its arguments, that's what *=
is for).
Comments (5)
-
reporter -
Should this have been marked as 'invalid' rather than 'resolved'?
-
I suspect so.
-
- changed status to invalid
-
- removed milestone
Removing milestone: 1.7 (automated comment)
- Log in to comment