SimVascular / SimVascular/svMultiPhysics
Improvement of PETSc interface to support additional options
@dcodoni is already working on this.
Since Feb 12, 2025.
- Dominant language
- C++
- Stars
- 45
- Forks
- 60
- Avg merge
- 5d 23h
- Merged PRs (30d)
- 11
Description
Problem
The current PETSc implementation involves two types of preconditioners RCS and the Jacobi (a simple diagonal scaling). PETSc offers a vast variety of solvers and preconditioners from different libraries, suitable for a very wide range of problems.
Simple preconditioners such as Jacobi or Block-Jacobi do not require any parameters to be set, but others such as multigrid preconditioners are more complex and default parameters are not optimal.
To use PETSc in an optimal way the users should be able to select preconditioners and set parameters. PETSc allows the user to control all aspects of the linear solvers through options that are given by command line or by a file. This feature is not used in svMultiphyiscs, where solvers and preconditioners (together with tolerances) are set inthe xml input file. As the preconditioning techniques become complicated the amount of parameters to include in the xml file would be not ideal and all the parameters will have to be coded in the solver.
Solution
I identified three possible solutions depending on the direction we want to take:
- Keep the structure of svMultiphysics as it is now and manage the preconditioners and parameters internally setting some optimal values for them which the user will not have access to through the xml file. This is similar to the current Trilinos implementation.
CONS: It will be difficult to explore alternatives, and customize preconditioners to the problem we are solving.
- Use a PETSc options file that can be used to control every aspect of the linear solver including tolerances, precodntioners type, parameters and so on. We could document all the prefixes and what they refer to.
CONS: An additional input file is needed. Not exactly user friendly since some parameters are not straightforward to understand unless the user has a quite a deep knowledge of the preconditioners.
- Hybrid solution where we support the most useful precodntioners with some parameters that are optimal for particular cases but also support using an options file
Additional context
An example is the SCR (Schur Complement Reduction) preconditoners technique. The whole procedure requires to solve 3 linear systems, preconditoned with Algebraic Multi Grid (AMG). Each linear solve requires its own tolerances and other parameters. With optimal selection of preconditioners and parameters using the SCR precondtioner speeds up an FSI simulation with respect to GMRES with a diagonal preconditioner from the FSILS implementation.
Code of Conduct
- I agree to follow this project's Code of Conduct and Contributing Guidelines
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.