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