OGS
LinearSolverLibrarySetup.h
Go to the documentation of this file.
1
11
#pragma once
12
21
22
#include "
NumLib/DOF/GlobalMatrixProviders.h
"
23
24
#if defined(USE_PETSC)
25
#include <petsc.h>
26
#include <mpi.h>
27
namespace
ApplicationsLib
28
{
29
struct
LinearSolverLibrarySetup
final
30
{
31
LinearSolverLibrarySetup
(
int
argc,
char
* argv[])
32
{
33
MPI_Init(&argc, &argv);
34
char
help[] =
"ogs6 with PETSc \n"
;
35
PetscInitialize(&argc, &argv,
nullptr
, help);
36
MPI_Comm_set_errhandler(PETSC_COMM_WORLD, MPI_ERRORS_RETURN);
37
}
38
39
~LinearSolverLibrarySetup
()
40
{
41
NumLib::cleanupGlobalMatrixProviders
();
42
PetscFinalize();
43
MPI_Finalize();
44
}
45
};
46
}
// ApplicationsLib
47
#elif defined(USE_LIS)
48
#include <lis.h>
49
namespace
ApplicationsLib
50
{
51
struct
LinearSolverLibrarySetup final
52
{
53
LinearSolverLibrarySetup
(
int
argc,
char
* argv[])
54
{
55
lis_initialize(&argc, &argv);
56
}
57
58
~LinearSolverLibrarySetup
()
59
{
60
NumLib::cleanupGlobalMatrixProviders
();
61
lis_finalize();
62
}
63
};
64
}
// ApplicationsLib
65
#else
66
namespace
ApplicationsLib
67
{
68
struct
LinearSolverLibrarySetup final
69
{
70
LinearSolverLibrarySetup
(
int
/*argc*/
,
char
*
/*argv*/
[]) {}
71
~LinearSolverLibrarySetup
()
72
{
73
NumLib::cleanupGlobalMatrixProviders
();
74
}
75
};
76
}
// namespace ApplicationsLib
77
#endif
GlobalMatrixProviders.h
ApplicationsLib
Definition
LinearSolverLibrarySetup.h:28
NumLib::cleanupGlobalMatrixProviders
void cleanupGlobalMatrixProviders()
Definition
GlobalMatrixProviders.cpp:29
ApplicationsLib::LinearSolverLibrarySetup
Definition
LinearSolverLibrarySetup.h:30
ApplicationsLib::LinearSolverLibrarySetup::LinearSolverLibrarySetup
LinearSolverLibrarySetup(int argc, char *argv[])
Definition
LinearSolverLibrarySetup.h:31
ApplicationsLib::LinearSolverLibrarySetup::~LinearSolverLibrarySetup
~LinearSolverLibrarySetup()
Definition
LinearSolverLibrarySetup.h:39
Applications
ApplicationsLib
LinearSolverLibrarySetup.h
Generated by
1.12.0