-
Notifications
You must be signed in to change notification settings - Fork 19
Linearsolver context
The <linearsolver> context is used to define everything related to linear solvers.
Attributes:
- class - Set the class of linear solver (dense, spr, samg, superlu, petsc).
Most of the tags beneath are only used with a PETSc based solver.
Use this to define the linear solver to be used.
- Attributes: None
- Value: The type of linear solver. See the PETSc list.
Example:
<type>gmres</type>
Use this to define the preconditioner to be used.
- Attributes: None
- Value: The type of preconditioner. See the PETSc list. Additionally, you can specify "ASMLU" to use additive Schwarz with exact local solvers.
Example:
<pc>asm</pc>
Use this to set the number of arnoldi iterations before restart in the GMRES method.
Example:
<gmres_restart_iterations>50</gmres_restart_iterations>
The "asmlu" and "asm" preconditioners operate on subdomains. If nothing is specified, one subdomain per patch is used in serial, and one subdomain per MPI node in parallel. You can override this using these tags. For instance,
<asm nx="1" ny="1"/>
would yield one subdomain per patch, while
<asm nx="2" ny="2"/>
would yield 4 subdomains per process. There is currently no way to have a subdomain consisting of a given number of patches.
Use this to specify the absolute tolerance for iterative solvers.
- Attributes: None
- Value: The tolerance
Example:
<atol>1.0e-10</atol>
Use this to specify the relative tolerance for iterative solvers.
- Attributes: None
- Value: The tolerance
Example:
<rtol>1.0e-10</rtol>
Use this to specify the divergence tolerance for iterative solvers (how much the residual can grow before process is assumed diverged).
- Attributes: None
- Value: The tolerance
Example:
<dtol>1.0e3</dtol>
Use this to specify the maximum number of iterations for iterative solvers.
- Attributes: None
- Value: The maximum number of iterations
Example:
<maxits>1000</maxits>
Use this if your operator has a null space.
- Attributes: None
- Value: The type of null space (currently only constant is allowed).
Example:
<nullspace>constant</nullspace>
Use this if you want to use an external solver/preconditioner through PETSc, see the PETSc documentation.
- Attributes: None
- Value: The name of the package.
Example:
<package>petsc</package>
Use this to control parameters for the preconditioner if you are using one from the HYPRE package.
- Attributes: None
- Value: The name of the HYPRE preconditioner (pilut, parasails, boomeramg, euclid)
Example:
<hypre type="parasails"/>
Use this to control parameters for multigrid preconditioners.
- Attributes: smoother, levels, no_smooth, no_fine_smooth, finesmoother, ksp, coarse_solver, max_coarse_size
Example:
<multigrid smoother="sor" levels="4" finesmoother="asm" ksp="richardson"/>
Use this to define blocks for schur-type field-split preconditioner (currently only two fields). Attributes:
- basis - Bases block consists of. String with 1,2,3.
- components - Components from given basis block consists of.
A block either consists of a given number of bases, or a given number of components for a single given basis. All relevant tags can then be specified for the block using the xml hierarchy.
To have two blocks, one for each basis, using a SOR preconditioner for the first block and a multigrid for the second block (ie a mixed saddle-point problem like Stokes), you would use
<block basis="1">
<pc>sor</pc>
</block>
<block basis="2">
<pc>gamg</pc>
<multigrid smoother="sor" no_smooth="4"/>
</block>
Likewise, to have two blocks, one for velocity and one for pressure, using a SOR preconditioner for the first block and an asm preconditioner for the second block (ie a equal-order saddle-point problem like Stokes), you would use
<block basis="1" comp="123">
<pc>sor</pc>
</block>
<block basis="1" comp="4">
<pc>gamg</pc>
<multigrid smoother="sor" no_smooth="4"/>
</block>
Use this to set the type of the field split/schur complement preconditioner used with multiple blocks. Attributes: None Value: upper, lower, diagonal Example:
<schur>upper</schur>