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 TotalEnergies
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 GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_
20 #define GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_
21 
22 #include "codingUtilities/EnumStrings.hpp"
23 
24 namespace geos
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  l1jacobi,
56  fgs,
57  sgs,
58  l1sgs,
59  chebyshev,
60  iluk,
61  ilut,
62  ic,
63  ict,
64  amg,
65  mgr,
66  block,
67  direct,
68  bgs,
69  };
70 
73  bool isSymmetric = false;
75 
78 
80  struct Direct
81  {
85  enum class ColPerm : integer
86  {
87  none,
88  MMD_AtplusA,
89  MMD_AtA,
90  colAMD,
91  metis,
92  parmetis
93  };
94 
98  enum class RowPerm : integer
99  {
100  none,
101  mc64
102  };
103 
111  }
113 
115  struct Krylov
116  {
119 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
121 #else
122  integer maxRestart = 200;
123 #endif
126  }
128 
130  struct Scaling
131  {
134  }
136 
138  struct AMG
139  {
141  enum class CycleType : integer
142  {
143  V,
144  W
145  };
146 
148  enum class PreOrPost : integer
149  {
150  pre,
151  post,
152  both
153  };
154 
156  enum class SmootherType : integer
157  {
158  default_,
159  jacobi,
160  l1jacobi,
161  fgs,
162  bgs,
163  sgs,
164  l1sgs,
165  chebyshev,
166  ilu0,
167  ilut,
168  ic0,
169  ict
170  };
171 
173  enum class CoarseType : integer
174  {
175  default_,
176  jacobi,
177  l1jacobi,
178  fgs,
179  sgs,
180  l1sgs,
181  chebyshev,
182  direct,
183  bgs
184  };
185 
187  enum class CoarseningType : integer
188  {
189  default_,
190  CLJP,
191  RugeStueben,
192  Falgout,
193  PMIS,
194  HMIS
195  };
196 
198  enum class InterpType : integer
199  {
200  default_,
202  direct,
203  multipass,
204  extendedI,
205  standard,
206  extended,
207  directBAMG,
211  };
212 
214  enum class AggInterpType : integer
215  {
216  default_,
220  multipass,
225  };
226 
228  enum class NullSpaceType : integer
229  {
230  constantModes,
232  };
233 
234 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
237 #else
240 #endif
241 
259  }
260  amg;
261 
263  struct MGR
264  {
268  enum class StrategyType : integer
269  {
270  invalid,
289  hydrofracture,
292  };
293 
299  }
300  mgr;
301 
303  struct IFact
304  {
305  integer fill = 0;
307  }
309 
311  struct DD
312  {
314  }
315  dd;
316 };
317 
320  "direct",
321  "cg",
322  "gmres",
323  "fgmres",
324  "bicgstab",
325  "preconditioner" );
326 
329  "none",
330  "jacobi",
331  "l1jacobi",
332  "fgs",
333  "sgs",
334  "l1sgs",
335  "chebyshev",
336  "iluk",
337  "ilut",
338  "icc",
339  "ict",
340  "amg",
341  "mgr",
342  "block",
343  "direct",
344  "bgs" );
345 
348  "none",
349  "MMD_AtplusA",
350  "MMD_AtA",
351  "colAMD",
352  "metis",
353  "parmetis" );
354 
357  "none",
358  "mc64" );
359 
362  "invalid",
363  "singlePhaseReservoirFVM",
364  "singlePhaseHybridFVM",
365  "singlePhaseReservoirHybridFVM",
366  "singlePhasePoromechanics",
367  "thermalSinglePhasePoromechanics",
368  "hybridSinglePhasePoromechanics",
369  "singlePhasePoromechanicsEmbeddedFractures",
370  "singlePhasePoromechanicsConformingFractures",
371  "singlePhasePoromechanicsReservoirFVM",
372  "compositionalMultiphaseFVM",
373  "compositionalMultiphaseHybridFVM",
374  "compositionalMultiphaseReservoirFVM",
375  "compositionalMultiphaseReservoirHybridFVM",
376  "reactiveCompositionalMultiphaseOBL",
377  "thermalCompositionalMultiphaseFVM",
378  "multiphasePoromechanics",
379  "multiphasePoromechanicsReservoirFVM",
380  "thermalMultiphasePoromechanics",
381  "hydrofracture",
382  "lagrangianContactMechanics",
383  "solidMechanicsEmbeddedFractures" );
384 
387  "V",
388  "W" );
389 
392  "pre",
393  "post",
394  "both" );
395 
398  "default",
399  "jacobi",
400  "l1jacobi",
401  "fgs",
402  "bgs",
403  "sgs",
404  "l1sgs",
405  "chebyshev",
406  "ilu0",
407  "ilut",
408  "ic0",
409  "ict" );
410 
413  "default",
414  "jacobi",
415  "l1jacobi",
416  "fgs",
417  "sgs",
418  "l1sgs",
419  "chebyshev",
420  "direct",
421  "bgs" );
422 
425  "default",
426  "CLJP",
427  "RugeStueben",
428  "Falgout",
429  "PMIS",
430  "HMIS" );
431 
434  "default",
435  "modifiedClassical",
436  "direct",
437  "multipass",
438  "extendedI",
439  "standard",
440  "extended",
441  "directBAMG",
442  "modifiedExtended",
443  "modifiedExtendedI",
444  "modifiedExtendedE" );
445 
448  "default",
449  "extendedIStage2",
450  "standardStage2",
451  "extendedStage2",
452  "multipass",
453  "modifiedExtended",
454  "modifiedExtendedI",
455  "modifiedExtendedE",
456  "modifiedMultipass" );
457 
460  "constantModes",
461  "rigidBodyModes" );
462 
463 } /* namespace geos */
464 
465 #endif /*GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_ */
ENUM_STRINGS(LinearSolverParameters::SolverType, "direct", "cg", "gmres", "fgmres", "bicgstab", "preconditioner")
Declare strings associated with enumeration values.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:139
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
Algebraic multigrid parameters.
integer numSweeps
Number of smoother sweeps.
InterpType
AMG interpolation type (HYPRE only)
@ modifiedExtendedI
Modularized extended+i (GPU support)
@ modifiedExtendedE
Modularized extended+e (GPU support)
@ modifiedExtended
Modularized extended classical (GPU support)
@ directBAMG
Direct with separation of weights (GPU support)
@ extended
Extended classical (GPU support)
@ chebyshev
Chebyshev polynomial smoothing.
@ l1sgs
l1-Symmetric Gauss-Seidel smoothing
@ ilut
Incomplete LU with thresholding.
@ sgs
Symmetric Gauss-Seidel smoothing.
@ bgs
Gauss-Seidel smoothing (backward sweep)
@ ict
Incomplete Cholesky with thresholding.
@ fgs
Gauss-Seidel smoothing (forward sweep)
integer aggressiveInterpMaxNonZeros
Aggressive Interpolation - Max. nonzeros/row.
CoarseningType coarseningType
Coarsening algorithm (GPUs)
integer separateComponents
Apply a separate component filter before AMG construction.
integer maxLevels
Maximum number of coarsening levels.
integer interpolationMaxNonZeros
Interpolation - Max. nonzeros/row.
InterpType interpolationType
Interpolation algorithm.
CoarseType coarseType
Coarse-level solver/smoother.
CoarseningType
AMG coarsening types (HYPRE only)
@ CLJP
A parallel coarsening algorithm using independent sets.
@ Falgout
Ruge-Stueben followed by CLJP.
@ RugeStueben
Classical Ruge-Stueben on each processor, followed by a third pass.
@ PMIS
Parallel coarsening as CLJP but with lower complexities (GPU support)
integer numFunctions
Number of amg functions.
NullSpaceType nullSpaceType
Null space type [constantModes,rigidBodyModes].
SmootherType smootherType
Smoother type (GPUs)
PreOrPost preOrPostSmoothing
Pre and/or post smoothing.
AggInterpType
AMG interpolation type for aggressive coarsening levels (HYPRE only)
@ modifiedExtendedI
Modularized Extended+i (GPU support)
@ extendedIStage2
Extended+i 2-stage (GPU support)
@ modifiedExtendedE
Modularized Extended+e (GPU support)
@ modifiedExtended
Modularized Extended (GPU support)
@ modifiedMultipass
Modularized Multipass (GPU support)
@ extendedStage2
Extended 2-stage (GPU support)
PreOrPost
AMG pre/post smoothing option.
integer aggressiveNumPaths
Number of paths agg. coarsening.
integer aggressiveNumLevels
Number of levels for aggressive coarsening.
@ jacobi
Jacobi (GPU support in hypre)
@ chebyshev
Chebyshev polynomial (GPU support in hypre)
@ l1jacobi
l1-Jacobi (GPU support in hypre)
@ direct
Direct solver as preconditioner.
@ bgs
Gauss-Seidel smoothing (backward sweep)
AggInterpType aggressiveInterpType
Interp. type for agg. coarsening.
Domain decomposition parameters.
Direct solver parameters: used for SuperLU_Dist interface through hypre and PETSc.
integer equilibrate
Whether to scale the rows and columns of the matrix.
integer iterativeRefine
Whether to perform iterative refinement.
integer replaceTinyPivot
Whether to replace tiny pivots by sqrt(epsilon)*norm(A)
integer parallel
Whether to use a parallel solver (instead of a serial one)
@ MMD_AtplusA
multiple minimum degree on At+A
@ colAMD
approximate minimum degree on columns
@ MMD_AtA
multiple minimum degree on At*A (heavy)
integer checkResidual
Whether to check the linear system solution residual.
Incomplete factorization parameters.
integer maxRestart
Max number of vectors in Krylov basis before restarting (GPUs)
real64 weakestTol
Weakest allowed tolerance when using adaptive method.
real64 relTolerance
Relative convergence tolerance for iterative solvers.
integer maxIterations
Max iterations before declaring convergence failure.
integer useAdaptiveTol
Use Eisenstat-Walker adaptive tolerance.
Multigrid reduction parameters.
integer separateComponents
Apply a separate displacement component (SDC) filter before AMG construction.
string displacementFieldName
Displacement field name need for SDC filter.
StrategyType strategy
Predefined MGR solution strategy (solver specific)
@ hybridSinglePhasePoromechanics
single phase poromechanics with hybrid finite volume single phase flow
@ compositionalMultiphaseFVM
finite volume compositional multiphase flow
@ singlePhasePoromechanics
single phase poromechanics with finite volume single phase flow
@ compositionalMultiphaseHybridFVM
hybrid finite volume compositional multiphase flow
@ solidMechanicsEmbeddedFractures
Embedded fractures mechanics.
@ singlePhaseReservoirHybridFVM
hybrid finite volume single-phase flow with wells
@ multiphasePoromechanicsReservoirFVM
multiphase poromechanics with finite volume compositional multiphase flow with wells
@ thermalCompositionalMultiphaseFVM
finite volume thermal compositional multiphase flow
@ singlePhaseReservoirFVM
finite volume single-phase flow with wells
@ multiphasePoromechanics
multiphase poromechanics with finite volume compositional multiphase flow
@ singlePhasePoromechanicsReservoirFVM
single phase poromechanics with finite volume single phase flow with wells
@ singlePhaseHybridFVM
hybrid finite volume single-phase flow
@ thermalMultiphasePoromechanics
thermal multiphase poromechanics with finite volume compositional multiphase flow
@ singlePhasePoromechanicsConformingFractures
single phase poromechanics with FV conforming fractures
@ singlePhasePoromechanicsEmbeddedFractures
single phase poromechanics with FV embedded fractures
@ reactiveCompositionalMultiphaseOBL
finite volume reactive compositional flow with OBL
@ thermalSinglePhasePoromechanics
thermal single phase poromechanics with finite volume single phase flow
@ compositionalMultiphaseReservoirHybridFVM
hybrid finite volume compositional multiphase flow with wells
@ lagrangianContactMechanics
Lagrangian contact mechanics.
@ compositionalMultiphaseReservoirFVM
finite volume compositional multiphase flow with wells
@ invalid
default value, to ensure solver sets something
integer useRowColScaling
Apply row and column scaling (not yet implemented)
Set of parameters for a linear solver or preconditioner.
struct geos::LinearSolverParameters::Direct direct
direct solver parameter struct
integer dofsPerNode
Dofs per node (or support location) for non-scalar problems.
struct geos::LinearSolverParameters::IFact ifact
Incomplete factorization parameter struct.
bool isSymmetric
Whether input matrix is symmetric (may affect choice of scheme)
struct geos::LinearSolverParameters::Scaling scaling
Matrix-scaling parameter struct.
struct geos::LinearSolverParameters::DD dd
Domain decomposition parameter struct.
@ chebyshev
Chebyshev polynomial smoothing.
@ mgr
Multigrid reduction (Hypre only)
@ iluk
Incomplete LU with k-level of fill.
@ direct
Direct solver as preconditioner.
@ l1sgs
l1-Symmetric Gauss-Seidel smoothing
@ ilut
Incomplete LU with thresholding.
@ sgs
Symmetric Gauss-Seidel smoothing.
@ bgs
Gauss-Seidel smoothing (backward sweep)
@ ict
Incomplete Cholesky with thresholding.
@ fgs
Gauss-Seidel smoothing (forward sweep)
integer stopIfError
Whether to stop the simulation if the linear solver reports an error.
PreconditionerType preconditionerType
Preconditioner type.
struct geos::LinearSolverParameters::AMG amg
Algebraic Multigrid (AMG) parameters.
integer logLevel
Output level [0=none, 1=basic, 2=everything].
struct geos::LinearSolverParameters::MGR mgr
Multigrid reduction (MGR) parameters.
struct geos::LinearSolverParameters::Krylov krylov
Krylov-method parameter struct.