opm-simulators
FlowLinearSolverParameters.hpp
1 /*
2  Copyright 2015, 2020 SINTEF Digital, Mathematics and Cybernetics.
3  Copyright 2015 IRIS AS
4  Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services
5  Copyright 2015 NTNU
6  Copyright 2015 Statoil AS
7 
8  This file is part of the Open Porous Media project (OPM).
9 
10  OPM is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  OPM is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with OPM. If not, see <http://www.gnu.org/licenses/>.
22 */
23 
24 #ifndef OPM_FLOWLINEARSOLVERPARAMETERS_HEADER_INCLUDED
25 #define OPM_FLOWLINEARSOLVERPARAMETERS_HEADER_INCLUDED
26 
27 #include <opm/simulators/linalg/MILU.hpp>
28 
31 #include <opm/simulators/linalg/LinearSolverAcceleratorType.hpp>
32 #include <string>
33 
34 namespace Opm {
35 
36 template <class TypeTag>
38 
39 template <class TypeTag>
40 class ISTLSolver;
41 
42 template<class TypeTag>
44 
45 }
46 
47 namespace Opm::Properties {
48 
49 namespace TTag {
50 
52 
53 }
54 
55 // Set the backend to be used.
56 template<class TypeTag>
57 struct LinearSolverBackend<TypeTag, TTag::FlowIstlSolverParams>
58 {
60 };
61 
62 }
63 
64 namespace Opm::Parameters {
65 
66 struct LinearSolverReduction { static constexpr double value = 1e-2; };
67 struct NlddLocalLinearSolverReduction { static constexpr double value = 1e-2; };
68 struct RelaxedLinearSolverReduction { static constexpr double value = 1e-2; };
69 struct IluRelaxation { static constexpr double value = 0.9; };
70 struct LinearSolverMaxIter { static constexpr int value = 200; };
71 struct NlddLocalLinearSolverMaxIter { static constexpr int value = 200; };
72 struct LinearSolverRestart { static constexpr int value = 40; };
73 struct IluFillinLevel { static constexpr int value = 0; };
74 struct MiluVariant { static constexpr auto value = "ilu"; };
75 struct IluRedblack { static constexpr bool value = false; };
76 struct IluReorderSpheres { static constexpr bool value = false; };
77 struct UseGmres { static constexpr bool value = false; };
78 struct LinearSolverIgnoreConvergenceFailure { static constexpr bool value = false; };
79 struct ScaleLinearSystem { static constexpr bool value = false; };
80 struct LinearSolver { static constexpr auto value = "cprw"; };
81 struct NlddLocalLinearSolver { static constexpr auto value = "ilu0"; };
82 struct LinearSolverPrintJsonDefinition { static constexpr auto value = true; };
83 struct CprReuseSetup { static constexpr int value = 4; };
84 struct CprReuseInterval { static constexpr int value = 30; };
85 struct AcceleratorMode { static constexpr auto value = "none"; };
86 struct GpuDeviceId { static constexpr int value = 0; };
87 struct OpenclPlatformId { static constexpr int value = 0; };
88 struct OpenclIluParallel { static constexpr bool value = true; }; // note: false should only be used in debug
89 struct GpuAwareMpi { static constexpr bool value = false; };
90 struct VerifyGpuAwareMpi { static constexpr bool value = false; };
91 struct CprWeightsThreadParallel { static constexpr bool value = false; };
92 } // namespace Opm::Parameters
93 
94 namespace Opm {
95 
98 {
99  double linear_solver_reduction_;
100  double relaxed_linear_solver_reduction_;
101  int linear_solver_maxiter_;
102  int linear_solver_restart_;
103  int linear_solver_verbosity_;
104  double ilu_relaxation_;
105  int ilu_fillin_level_;
106  MILU_VARIANT ilu_milu_;
107  bool ilu_redblack_;
108  bool ilu_reorder_sphere_;
109  bool newton_use_gmres_;
110  bool ignoreConvergenceFailure_;
111  bool scale_linear_system_;
112  bool is_nldd_local_solver_;
113  std::string linsolver_;
114  bool linear_solver_print_json_definition_;
115  int cpr_reuse_setup_;
116  int cpr_reuse_interval_;
117  std::string accelerator_mode_;
118  int gpu_device_id_;
119  int opencl_platform_id_;
120  bool opencl_ilu_parallel_;
121  Parameters::LinearSolverAcceleratorType linear_solver_accelerator_;
122  bool gpu_aware_mpi_;
123  bool verify_gpu_aware_mpi_;
124  bool cpr_weights_thread_parallel_;
125 
126  FlowLinearSolverParameters() { reset(); }
127 
128  void init(bool cprRequestedInDataFile);
129 
130  static void registerParameters();
131 
132  // set default values
133  void reset();
134 };
135 
136 } // namespace Opm
137 
138 #endif // OPM_FLOWLINEARSOLVERPARAMETERS_HEADER_INCLUDED
Definition: FlowLinearSolverParameters.hpp:90
Definition: FlowLinearSolverParameters.hpp:76
MILU_VARIANT
Definition: MILU.hpp:34
Definition: FlowLinearSolverParameters.hpp:75
Definition: FlowLinearSolverParameters.hpp:72
Definition: FlowLinearSolverParameters.hpp:73
Definition: FlowLinearSolverParameters.hpp:83
Definition: FlowLinearSolverParameters.hpp:77
Definition: FlowLinearSolverParameters.hpp:74
Definition: FlowLinearSolverParameters.hpp:67
This class solves the fully implicit black-oil system by solving the reduced system (after eliminatin...
Definition: FlowLinearSolverParameters.hpp:40
Definition: FlowLinearSolverParameters.hpp:69
Definition: FlowLinearSolverParameters.hpp:84
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Definition: FlowLinearSolverParameters.hpp:80
Definition: FlowLinearSolverParameters.hpp:70
Definition: blackoilnewtonmethodparams.hpp:31
Definition: FlowLinearSolverParameters.hpp:91
Definition: FlowLinearSolverParameters.hpp:68
ISTLSolverRuntimeOptionProxy selects the appropriate ISTLSolver runtime based on CLI options...
Definition: FlowLinearSolverParameters.hpp:43
Definition: FlowLinearSolverParameters.hpp:85
Definition: FlowLinearSolverParameters.hpp:78
Definition: FlowLinearSolverParameters.hpp:79
Declares the parameters for the black oil model.
Definition: FlowLinearSolverParameters.hpp:71
Definition: FlowLinearSolverParameters.hpp:81
Definition: FlowLinearSolverParameters.hpp:86
This class carries all parameters for the NewtonIterationBlackoilInterleaved class.
Definition: FlowLinearSolverParameters.hpp:97
Definition: FlowLinearSolverParameters.hpp:66
This class solves the fully implicit black-oil system by solving the reduced system (after eliminatin...
Definition: FlowLinearSolverParameters.hpp:37
Definition: FlowLinearSolverParameters.hpp:88
Definition: FlowLinearSolverParameters.hpp:51
Definition: FlowLinearSolverParameters.hpp:82
Definition: blackoilmodel.hh:80
Definition: FlowLinearSolverParameters.hpp:89
Declares the properties required by the black oil model.
The type of the linear solver to be used.
Definition: linalgproperties.hh:38
Definition: FlowLinearSolverParameters.hpp:87