Sparse Solver Choices

Hi

We have a quasi-linear elastodynamics problem in which we have been running into memory errors within UMFPack. Does fenics default to a sparse linear algebra solver for its problems? Is there a way to change the solver to a petsc or similar backend within fenics? Additionally what are all the available backends that are enabled by default in fenics?

Thank you

See, e.g., dolfinx/demo_poisson.py at main · FEniCS/dolfinx · GitHub and the PETSc LU option pc_factor_mat_solver_type, a list of types can be found,e.g: MatSolverType — PETSc 3.18.1 documentation

So a reasonably robust setup would be:

petsc_options={"ksp_type": "preonly", "pc_type": "lu", "pc_factor_mat_solver_type": "mumps"}

If you don’t want to use the LinearProblem syntactic sugar, you can just create your own PETSc KSP and set the options directly there, for example dolfinx/demo_elasticity.py at main · FEniCS/dolfinx · GitHub

1 Like