OGS
LinearSolverLibrarySetup.h
Go to the documentation of this file.
1
11#pragma once
12
21
23
24#if defined(USE_PETSC)
25#include <petsc.h>
26#include <mpi.h>
28{
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
40 {
42 PetscFinalize();
43 MPI_Finalize();
44 }
45};
46} // ApplicationsLib
47#elif defined(USE_LIS)
48#include <lis.h>
49namespace ApplicationsLib
50{
51struct LinearSolverLibrarySetup final
52{
53 LinearSolverLibrarySetup(int argc, char* argv[])
54 {
55 lis_initialize(&argc, &argv);
56 }
57
59 {
61 lis_finalize();
62 }
63};
64} // ApplicationsLib
65#else
66namespace ApplicationsLib
67{
68struct LinearSolverLibrarySetup final
69{
70 LinearSolverLibrarySetup(int /*argc*/, char* /*argv*/[]) {}
72 {
74 }
75};
76} // namespace ApplicationsLib
77#endif
void cleanupGlobalMatrixProviders()