Why does KrylovSolver with amg diverge/converge depending on dof ordering?
I'm trying to set a null space for a PETSc KrylovSolver using "amg" preconditioning, but am running into some issues I don't understand. Sample code below. If dof reordering is turned off, the solver converges quickly in 7 iterations. If dof reordering is turned on, the solver diverges (and in particular fails to converge in 900 iterations)
(i) Is this expected, or am I using set_nullspace incorrectly, or ... ?
(ii) Is this related to https:/
Any ideas much appreciated.
--
parameters[
#parameters[
# Set-up variational problem
N = 3
mesh = UnitCubeMesh(N, N, N)
V = FunctionSpace(mesh, "CG", 1)
VU = V*V
(v, u) = TrialFunctions(VU)
(w, q) = TestFunctions(VU)
a = (v*w/0.1 + inner(grad(v), grad(w)) + inner(grad(u), grad(w))
+ inner(grad(v), grad(q)) + inner(3.0*grad(u), grad(q)))*dx
L = 0.1*q*dx
# Assemble matrix/vector
A = assemble(a)
b = assemble(L)
# Set-up nullspace vector
vu = Function(VU)
nullspace = Vector(vu.vector())
VU.sub(
# Set-up solver
solver = KrylovSolver(
#solver = KrylovSolver(
solver.
solver.
solver.
# Solve
solver.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Marie Rognes for more information if necessary.