Hi all,
I’m looking for the default parameters of the NonLinearVariationalSolver.
I’m running
info(NonlinearVariationalSolver.default_parameters(), True)
And get a lot of “default” strings.
I’m mostly looking for the default linear solver and pre-conditioner.
Can anyone point me towards the relevant documentation?
Thanks in advance!
nate
February 13, 2024, 11:08pm
2
1 Like
Thanks @nate unfortunately, as you can see here it still shows “default” for the linear solver.
nate
February 13, 2024, 11:16pm
4
Whoops. Yep. I just realised this after writing. If you dig around in the source you’ll likely find what you’re looking for.
If I remember rightly, old dolfin defaults to umfpack in serial and mumps in parallel, for the linear solve.
1 Like
This is what I read here and there yes. No preconditioners by default I suppose then since they don’t use a preconditioner, right?
nate
February 14, 2024, 2:13am
6
If you want to do fancier things with preconditioning your system in conjunction with an iterative solver, I highly recommend migrating to DOLFINx. The Stokes demo is a great place to start.
Otherwise there are some old examples knocking around, e.g.,
https://bitbucket.org/fenics-project/dolfin/src/master/python/demo/undocumented/elasticity/demo_elasticity.py
Here is a silly example which should only be considered for its syntax. The preconditioner I’ve designed here is deliberately not a good approximation of the Jacobian.
import matplotlib.pyplot as plt
from dolfin import *
class Problem(NonlinearProblem):
def __init__(self, J, J_pc, F, bcs):
self.bilinear_form = J
self.preconditioner_form = J_pc
self.linear_form = F
self.bcs = bcs
NonlinearProblem.__init__(self)
def F(self, b, x):
pass
…