dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #22236
[Bug 732543] Re: No error when attempting to solve using wrong dimensions
Sounds good to me.
We should be consistent with this. Basically, functions should not
resize already sized vectors. This will simplify things in parallel
since such a policy says that whoever resizes a vector is responsible
for getting the parallel layout right.
** Changed in: dolfin
Status: New => Confirmed
--
You received this bug notification because you are a member of DOLFIN
Team, which is subscribed to DOLFIN.
https://bugs.launchpad.net/bugs/732543
Title:
No error when attempting to solve using wrong dimensions
Status in DOLFIN:
Confirmed
Bug description:
Calling solve with a vector of non-matching dimensions does not
produce an error. Something mysterious happens instead. Reproduce with
below code.
from dolfin import *
mesh = UnitSquare(2, 2)
V = FunctionSpace(mesh, "CG", 1)
Q = FunctionSpace(mesh, "CG", 1)
W = V * Q
y = TrialFunction(W)
w = TestFunction(W)
a = inner(y, w)*dx
L = w[0]*dx
A = assemble(a)
b = assemble(L)
y = Function(W)
info(A)
info(b)
u = Function(V)
info(u.vector())
solve(A, u.vector(), b)
info(u.vector())
References