dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #22216
[Bug 732543] Re: No error when attempting to solve using wrong dimensions
> What about requiring that it is either of length zero or of correct
> size. Would that break anything?
I would be happy with this (speaking as a current heavy user of the
Matrix::mult interface, which behaves similarly).
Zero size: resize
Correct global size: Use as-is
Incorrect global size: Error
...and maybe add, for parallel-safety (the backends probably do this already?):
Correct global size, incorrect local size: Fail fatally
If I remember correctly, the local size used to be checked, but that
check was removed since trying to correct it (via resize) may lead to
deadlock. A fatal error is the only option in this case.
--
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:
New
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