IFEM  90A354
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Attributes | List of all members
LinAlgInit Class Reference

Initializer for linear algebra packages. More...

#include <LinAlgInit.h>

Collaboration diagram for LinAlgInit:
Collaboration graph
[legend]

Public Member Functions

 ~LinAlgInit ()
 The destructor finalizes the linear algebra packages.
 

Static Public Member Functions

static void increfs ()
 Increments the reference counter.
 
static void decrefs ()
 Decrements the reference counter.
 
static LinAlgInitInit (int argc, char **argv)
 Instanciates the singleton LinAlgInit object.
 

Public Attributes

int myPid
 Processor ID in parallel simulations.
 

Private Member Functions

 LinAlgInit (int argc, char **argv)
 The constructor uses the command-line arguments to set up things.
 

Static Private Attributes

static int refs = 0
 Reference counter.
 
static LinAlgInitinstance = 0
 Pointer to the singleton object.
 

Detailed Description

Initializer for linear algebra packages.

This class is a reference-counted singleton. We need control over the destruction order since the destructor calls PetscFinalize() which shuts down MPI. Thus, the LinAlgInit object must be destroyed after all other objects that do MPI calls in their destructor. This cannot be guaranteed without the reference-counting since this class is instanciated as a local variable in the main() scope of the applications.


The documentation for this class was generated from the following files: