My Project
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
32namespace Opm {
33
34template <class TypeTag>
35class ISTLSolverBda;
36
37template <class TypeTag>
38class ISTLSolver;
39
40}
41
42namespace Opm::Properties {
43
44namespace TTag {
45
47
48}
49
50// Set the backend to be used.
51template<class TypeTag>
52struct LinearSolverBackend<TypeTag, TTag::FlowIstlSolverParams>
53{
54#if COMPILE_BDA_BRIDGE
56#else
58#endif
59};
60
61}
62
63namespace Opm::Parameters {
64
65struct LinearSolverReduction { static constexpr double value = 1e-2; };
66struct NlddLocalLinearSolverReduction { static constexpr double value = 1e-2; };
67struct RelaxedLinearSolverReduction { static constexpr double value = 1e-2; };
68struct IluRelaxation { static constexpr double value = 0.9; };
69struct LinearSolverMaxIter { static constexpr int value = 200; };
70struct NlddLocalLinearSolverMaxIter { static constexpr int value = 200; };
71struct LinearSolverRestart { static constexpr int value = 40; };
72struct IluFillinLevel { static constexpr int value = 0; };
73struct MiluVariant { static constexpr auto value = "ILU"; };
74struct IluRedblack { static constexpr bool value = false; };
75struct IluReorderSpheres { static constexpr bool value = false; };
76struct UseGmres { static constexpr bool value = false; };
77struct LinearSolverIgnoreConvergenceFailure { static constexpr bool value = false; };
78struct ScaleLinearSystem { static constexpr bool value = false; };
79struct LinearSolver { static constexpr auto value = "cprw"; };
80struct NlddLocalLinearSolver { static constexpr auto value = "ilu0"; };
81struct LinearSolverPrintJsonDefinition { static constexpr auto value = true; };
82struct CprReuseSetup { static constexpr int value = 4; };
83struct CprReuseInterval { static constexpr int value = 30; };
84struct AcceleratorMode { static constexpr auto value = "none"; };
85struct BdaDeviceId { static constexpr int value = 0; };
86struct OpenclPlatformId { static constexpr int value = 0; };
87struct OpenclIluParallel { static constexpr bool value = true; }; // note: false should only be used in debug
88
89} // namespace Opm::Parameters
90
91namespace Opm {
92
95{
96 double linear_solver_reduction_;
97 double relaxed_linear_solver_reduction_;
98 int linear_solver_maxiter_;
99 int linear_solver_restart_;
100 int linear_solver_verbosity_;
101 double ilu_relaxation_;
102 int ilu_fillin_level_;
103 MILU_VARIANT ilu_milu_;
104 bool ilu_redblack_;
105 bool ilu_reorder_sphere_;
106 bool newton_use_gmres_;
107 bool ignoreConvergenceFailure_;
108 bool scale_linear_system_;
109 bool is_nldd_local_solver_;
110 std::string linsolver_;
111 bool linear_solver_print_json_definition_;
112 int cpr_reuse_setup_;
113 int cpr_reuse_interval_;
114 std::string accelerator_mode_;
115 int bda_device_id_;
116 int opencl_platform_id_;
117 bool opencl_ilu_parallel_;
118
119 FlowLinearSolverParameters() { reset(); }
120
121 void init(bool cprRequestedInDataFile);
122
123 static void registerParameters();
124
125 // set default values
126 void reset();
127};
128
129} // namespace Opm
130
131#endif // OPM_FLOWLINEARSOLVERPARAMETERS_HEADER_INCLUDED
This class solves the fully implicit black-oil system by solving the reduced system (after eliminatin...
Definition ISTLSolverBda.hpp:104
This class solves the fully implicit black-oil system by solving the reduced system (after eliminatin...
Definition ISTLSolver.hpp:144
Declares the parameters for the black oil model.
Declares the properties required by the black oil model.
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
MILU_VARIANT
Definition MILU.hpp:34
This class carries all parameters for the NewtonIterationBlackoilInterleaved class.
Definition FlowLinearSolverParameters.hpp:95
Definition FlowLinearSolverParameters.hpp:84
Definition FlowLinearSolverParameters.hpp:85
Definition FlowLinearSolverParameters.hpp:83
Definition FlowLinearSolverParameters.hpp:82
Definition FlowLinearSolverParameters.hpp:72
Definition FlowLinearSolverParameters.hpp:74
Definition FlowLinearSolverParameters.hpp:68
Definition FlowLinearSolverParameters.hpp:75
Definition FlowLinearSolverParameters.hpp:77
Definition FlowLinearSolverParameters.hpp:69
Definition FlowLinearSolverParameters.hpp:81
Definition FlowLinearSolverParameters.hpp:65
Definition FlowLinearSolverParameters.hpp:71
Definition FlowLinearSolverParameters.hpp:79
Definition FlowLinearSolverParameters.hpp:73
Definition FlowLinearSolverParameters.hpp:70
Definition FlowLinearSolverParameters.hpp:66
Definition FlowLinearSolverParameters.hpp:80
Definition FlowLinearSolverParameters.hpp:87
Definition FlowLinearSolverParameters.hpp:86
Definition FlowLinearSolverParameters.hpp:67
Definition FlowLinearSolverParameters.hpp:78
Definition FlowLinearSolverParameters.hpp:76
The type of the linear solver to be used.
Definition linalgproperties.hh:38
Definition FlowLinearSolverParameters.hpp:46