|
IFEM
90A354
|
Initializer for linear algebra packages. More...
#include <LinAlgInit.h>

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 LinAlgInit & | Init (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 LinAlgInit * | instance = 0 |
| Pointer to the singleton object. | |
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.