OGS
LinearSolverLibrarySetup.h
Go to the documentation of this file.
1
11
#pragma once
12
21
22
#include "
BaseLib/MPI.h
"
23
#include "
NumLib/DOF/GlobalMatrixProviders.h
"
24
25
#if defined(USE_PETSC)
26
#include <petsc.h>
27
#include <mpi.h>
28
namespace
ApplicationsLib
29
{
30
struct
LinearSolverLibrarySetup
final
31
{
32
LinearSolverLibrarySetup
(
int
argc,
char
* argv[]) :
mpi_setup
(argc, argv)
33
{
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
}
44
45
BaseLib::MPI::Setup
mpi_setup
;
46
};
47
}
// ApplicationsLib
48
#elif defined(USE_LIS)
49
#include <lis.h>
50
namespace
ApplicationsLib
51
{
52
struct
LinearSolverLibrarySetup final
53
{
54
LinearSolverLibrarySetup
(
int
argc,
char
* argv[])
55
{
56
lis_initialize(&argc, &argv);
57
}
58
59
~LinearSolverLibrarySetup
()
60
{
61
NumLib::cleanupGlobalMatrixProviders
();
62
lis_finalize();
63
}
64
};
65
}
// ApplicationsLib
66
#else
67
namespace
ApplicationsLib
68
{
69
struct
LinearSolverLibrarySetup final
70
{
71
LinearSolverLibrarySetup
(
int
/*argc*/
,
char
*
/*argv*/
[]) {}
72
~LinearSolverLibrarySetup
()
73
{
74
NumLib::cleanupGlobalMatrixProviders
();
75
}
76
};
77
}
// namespace ApplicationsLib
78
#endif
GlobalMatrixProviders.h
MPI.h
ApplicationsLib
Definition
LinearSolverLibrarySetup.h:29
NumLib::cleanupGlobalMatrixProviders
void cleanupGlobalMatrixProviders()
Definition
GlobalMatrixProviders.cpp:29
ApplicationsLib::LinearSolverLibrarySetup
Definition
LinearSolverLibrarySetup.h:31
ApplicationsLib::LinearSolverLibrarySetup::mpi_setup
BaseLib::MPI::Setup mpi_setup
Definition
LinearSolverLibrarySetup.h:45
ApplicationsLib::LinearSolverLibrarySetup::LinearSolverLibrarySetup
LinearSolverLibrarySetup(int argc, char *argv[])
Definition
LinearSolverLibrarySetup.h:32
ApplicationsLib::LinearSolverLibrarySetup::~LinearSolverLibrarySetup
~LinearSolverLibrarySetup()
Definition
LinearSolverLibrarySetup.h:39
BaseLib::MPI::Setup
Definition
MPI.h:25
Applications
ApplicationsLib
LinearSolverLibrarySetup.h
Generated by
1.11.0