opm-simulators
Loading...
Searching...
No Matches
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
34namespace Opm {
35
36template <class TypeTag>
38
39template <class TypeTag>
40class ISTLSolver;
41
42template<class TypeTag>
44
45}
46
47namespace Opm::Properties {
48
49namespace TTag {
50
52
53}
54
55// Set the backend to be used.
56template<class TypeTag>
57struct LinearSolverBackend<TypeTag, TTag::FlowIstlSolverParams>
58{
60};
61
62}
63
64namespace Opm::Parameters {
65
66struct LinearSolverReduction { static constexpr double value = 1e-2; };
67struct NlddLocalLinearSolverReduction { static constexpr double value = 1e-2; };
68struct RelaxedLinearSolverReduction { static constexpr double value = 1e-2; };
69struct IluRelaxation { static constexpr double value = 0.9; };
70struct LinearSolverMaxIter { static constexpr int value = 200; };
71struct NlddLocalLinearSolverMaxIter { static constexpr int value = 200; };
72struct LinearSolverRestart { static constexpr int value = 40; };
73struct IluFillinLevel { static constexpr int value = 0; };
74struct MiluVariant { static constexpr auto value = "ilu"; };
75struct IluRedblack { static constexpr bool value = false; };
76struct IluReorderSpheres { static constexpr bool value = false; };
77struct UseGmres { static constexpr bool value = false; };
78struct LinearSolverIgnoreConvergenceFailure { static constexpr bool value = false; };
79struct ScaleLinearSystem { static constexpr bool value = false; };
80struct LinearSolver { static constexpr auto value = "cprw"; };
81struct NlddLocalLinearSolver { static constexpr auto value = "ilu0"; };
82struct LinearSolverPrintJsonDefinition { static constexpr auto value = true; };
83struct CprReuseSetup { static constexpr int value = 4; };
84struct CprReuseInterval { static constexpr int value = 30; };
85struct AcceleratorMode { static constexpr auto value = "none"; };
86struct GpuDeviceId { static constexpr int value = 0; };
87struct OpenclPlatformId { static constexpr int value = 0; };
88struct OpenclIluParallel { static constexpr bool value = true; }; // note: false should only be used in debug
89struct GpuAwareMpi { static constexpr bool value = false; };
90struct VerifyGpuAwareMpi { static constexpr bool value = false; };
91struct CprWeightsThreadParallel { static constexpr bool value = false; };
92} // namespace Opm::Parameters
93
94namespace Opm {
95
97struct FlowLinearSolverParameters
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
This class solves the fully implicit black-oil system by solving the reduced system (after eliminatin...
Definition ISTLSolverGpuBridge.hpp:104
ISTLSolverRuntimeOptionProxy selects the appropriate ISTLSolver runtime based on CLI options.
Definition ISTLSolverRuntimeOptionProxy.hpp:45
This class solves the fully implicit black-oil system by solving the reduced system (after eliminatin...
Definition ISTLSolver.hpp:150
Declares the parameters for the black oil model.
Declares the properties required by the black oil model.
The generic type tag for problems using the immiscible multi-phase model.
Definition blackoilmodel.hh:82
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:45
MILU_VARIANT
Definition MILU.hpp:34
Definition FlowLinearSolverParameters.hpp:85
Definition FlowLinearSolverParameters.hpp:84
Definition FlowLinearSolverParameters.hpp:83
Definition FlowLinearSolverParameters.hpp:91
Definition FlowLinearSolverParameters.hpp:89
Definition FlowLinearSolverParameters.hpp:86
Definition FlowLinearSolverParameters.hpp:73
Definition FlowLinearSolverParameters.hpp:75
Definition FlowLinearSolverParameters.hpp:69
Definition FlowLinearSolverParameters.hpp:76
Definition FlowLinearSolverParameters.hpp:78
Definition FlowLinearSolverParameters.hpp:70
Definition FlowLinearSolverParameters.hpp:82
Definition FlowLinearSolverParameters.hpp:66
Definition FlowLinearSolverParameters.hpp:72
Definition FlowLinearSolverParameters.hpp:80
Definition FlowLinearSolverParameters.hpp:74
Definition FlowLinearSolverParameters.hpp:71
Definition FlowLinearSolverParameters.hpp:67
Definition FlowLinearSolverParameters.hpp:81
Definition FlowLinearSolverParameters.hpp:88
Definition FlowLinearSolverParameters.hpp:87
Definition FlowLinearSolverParameters.hpp:68
Definition FlowLinearSolverParameters.hpp:79
Definition FlowLinearSolverParameters.hpp:77
Definition FlowLinearSolverParameters.hpp:90
The type of the linear solver to be used.
Definition linalgproperties.hh:38
Definition FlowLinearSolverParameters.hpp:51