GEOSX
LinearSolverParameters.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 Total, S.A
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOSX_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_
20 #define GEOSX_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_
21 
22 #include "common/EnumStrings.hpp"
23 
24 namespace geosx
25 {
26 
34 {
38  enum class SolverType : integer
39  {
40  direct,
41  cg,
42  gmres,
43  fgmres,
44  bicgstab,
46  };
47 
52  {
53  none,
54  jacobi,
55  gs,
56  sgs,
57  iluk,
58  ilut,
59  icc,
60  ict,
61  amg,
62  mgr,
63  block
64  };
65 
68  bool isSymmetric = false;
70 
73 
75  struct Direct
76  {
80  enum class ColPerm : integer
81  {
82  none,
83  MMD_AtplusA,
84  MMD_AtA,
85  colAMD,
86  metis,
87  parmetis
88  };
89 
93  enum class RowPerm : integer
94  {
95  none,
96  mc64
97  };
98 
99  integer checkResidual = 0;
100  integer equilibrate = 1;
101  ColPerm colPerm = ColPerm::metis;
102  RowPerm rowPerm = RowPerm::mc64;
103  integer replaceTinyPivot = 1;
104  integer iterativeRefine = 1;
105  integer parallel = 1;
106  }
107  direct;
108 
110  struct Krylov
111  {
112  real64 relTolerance = 1e-6;
113  integer maxIterations = 200;
114  integer maxRestart = 200;
115  integer useAdaptiveTol = false;
116  real64 weakestTol = 1e-3;
117  }
118  krylov;
119 
121  struct Scaling
122  {
123  integer useRowScaling = false;
124  integer useRowColScaling = false;
125  }
126  scaling;
127 
129  struct AMG
130  {
131  integer maxLevels = 20;
132  string cycleType = "V";
133  string smootherType = "gaussSeidel";
134  string coarseType = "direct";
135  integer numSweeps = 2;
136  string preOrPostSmoothing = "both";
137  real64 threshold = 0.0;
138  integer separateComponents = false;
140  string nullSpaceType = "constantModes";
141  }
142  amg;
143 
145  struct MGR
146  {
147  string strategy;
148  integer separateComponents = false;
150  }
151  mgr;
152 
154  struct ILU
155  {
156  integer fill = 0;
157  real64 threshold = 0.0;
158  }
159  ilu;
160 
162  struct DD
163  {
164  integer overlap = 0;
165  }
166  dd;
167 };
168 
170  "direct",
171  "cg",
172  "gmres",
173  "fgmres",
174  "bicgstab",
175  "preconditioner" )
176 
178  "none",
179  "jacobi",
180  "gs",
181  "sgs",
182  "iluk",
183  "ilut",
184  "icc",
185  "ict",
186  "amg",
187  "mgr",
188  "block" )
189 
191  "none",
192  "MMD_AtplusA",
193  "MMD_AtA",
194  "colAMD",
195  "metis",
196  "parmetis" )
197 
199  "none",
200  "mc64" )
201 
202 } /* namespace geosx */
203 
204 #endif /*GEOSX_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_ */
struct geosx::LinearSolverParameters::ILU ilu
Incomplete factorization parameter struct.
constexpr void fill(VECTOR &&vector, std::remove_reference_t< decltype(vector[0]) > const value)
Set the entries of vector to value.
Multigrid reduction parameters.
integer stopIfError
Whether to stop the simulation if the linear solver reports an error.
Algebraic multigrid parameters.
struct geosx::LinearSolverParameters::DD dd
Domain decomposition parameter struct.
Domain decomposition parameters.
struct geosx::LinearSolverParameters::AMG amg
Algebraic Multigrid (AMG) parameters.
Set of parameters for a linear solver or preconditioner.
#define ENUM_STRINGS(ENUM,...)
Associate a list of string names with enumeration values.
Definition: EnumStrings.hpp:69
PreconditionerType preconditionerType
Preconditioner type.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:136
struct geosx::LinearSolverParameters::MGR mgr
Multigrid reduction (MGR) parameters.
integer dofsPerNode
Dofs per node (or support location) for non-scalar problems.
string displacementFieldName
Displacement field name need for SDC filter.
struct geosx::LinearSolverParameters::Scaling scaling
Matrix-scaling parameter struct.
integer logLevel
Output level [0=none, 1=basic, 2=everything].
Incomplete factorization parameters.
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
string strategy
Predefined MGR solution strategy (solver specific)
Direct solver parameters: used for SuperLU_Dist interface through hypre and PETSc.
struct geosx::LinearSolverParameters::Krylov krylov
Krylov-method parameter struct.
bool isSymmetric
Whether input matrix is symmetric (may affect choice of scheme)