PETSc solvers#

Options for PETSc solvers can be passed in the input file (or on the command line). Global options are set in the [petsc] section. To set options specific to a particular PETSc-based solver, the options can be set in a petsc subsection of the solver’s options, e.g. for a LaplaceXY solver (using the default options section) use the [laplacexy:petsc] section. Note that the global options, including any passed on the command line [*], will be ignored for that solver if the subsection is created. To set options from the command line, it is recommended to use the BOUT++ options system rather than PETSc’s, e.g. ./mymodel laplacexy:petsc:type=gmres.

Any options that can be passed on the command line to PETSc can be set, with no preceding hyphen. Flags passed with no value can be passed as options with no value. So for example, if the command line options would be:

-ksp_monitor -ksp_type gmres

to set for the LaplaceXY solver, in the input file you would put:

ksp_type = gmres