File petsclib.hxx#

Defines

PETSC_HAVE_BROKEN_RECURSIVE_MACRO#
PETSC_VERSION_GE(MAJOR, MINOR, SUBMINOR)#
class PetscLib#
#include <petsclib.hxx>

Handles initialisation and finalisation of PETSc library. The first instance which is created initialises PETSc Keeps a count of the number of how many instances exist When the last instance is destroyed it finalises PETSc.

Public Functions

explicit PetscLib(Options *opt = nullptr)#

Ensure that PETSc has been initialised

~PetscLib()#

Calls PetscFinalize when all PetscLib instances are destroyed

void setOptionsFromInputFile(KSP &ksp)#

Set options for a KSP linear solver that uses the options specific to this PetscLib, by setting an options prefix for the KSP, and adding that prefix to all the options set in the [petsc] section, or [petsc] subsection of the options, if non-null ‘opt’ was passed to the constructor.

void setOptionsFromInputFile(SNES &snes)#

Set options for a SNES linear solver that uses the options specific to this PetscLib, by setting an options prefix for the SNES, and adding that prefix to all the options set in the [petsc] section, or [petsc] subsection of the options, if non-null ‘opt’ was passed to the constructor.

Public Static Functions

static inline void setArgs(int &c, char **&v)#

This is called once to set the command-line options. Should be done early in the program, before any instances of PetscLib are created. The arguments will be passed to PetscInitialize()

static void cleanup()#

Force cleanup. This will call PetscFinalize, printing a warning if any instances of PetscLib still exist

Private Functions

void setPetscOptions(Options &options, const std::string &pass_options_prefix)#

Private Members

std::string options_prefix#

Private Static Attributes

static int count = 0#

How many instances?

static char help [] = "BOUT++: Uses finite difference methods to solve plasma fluid ""problems in curvilinear coordinates"

Help string.

static int *pargc = nullptr#
static char ***pargv = nullptr#
static PetscLogEvent USER_EVENT = 0#