GEOS
LinearSolverParameters.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_
21 #define GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_
22 
24 
25 namespace geos
26 {
27 
35 {
39  enum class SolverType : integer
40  {
41  direct,
42  cg,
43  gmres,
44  fgmres,
45  bicgstab,
47  };
48 
53  {
54  none,
55  jacobi,
56  l1jacobi,
57  fgs,
58  sgs,
59  l1sgs,
60  chebyshev,
61  iluk,
62  ilut,
63  ic,
64  ict,
65  amg,
66  mgr,
67  block,
68  direct,
69  bgs,
70  };
71 
74  bool isSymmetric = false;
76 
79 
81  struct Direct
82  {
86  enum class ColPerm : integer
87  {
88  none,
89  MMD_AtplusA,
90  MMD_AtA,
91  colAMD,
92  metis,
93  parmetis
94  };
95 
99  enum class RowPerm : integer
100  {
101  none,
102  mc64
103  };
104 
112  }
114 
116  struct Krylov
117  {
120 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
122 #else
123  integer maxRestart = 200;
124 #endif
130  }
132 
134  struct Scaling
135  {
138  }
140 
142  struct AMG
143  {
145  enum class CycleType : integer
146  {
147  V,
148  W
149  };
150 
152  enum class PreOrPost : integer
153  {
154  pre,
155  post,
156  both
157  };
158 
160  enum class SmootherType : integer
161  {
162  default_,
163  jacobi,
164  l1jacobi,
165  fgs,
166  bgs,
167  sgs,
168  l1sgs,
169  chebyshev,
170  ilu0,
171  ilut,
172  ic0,
173  ict
174  };
175 
177  enum class CoarseType : integer
178  {
179  default_,
180  jacobi,
181  l1jacobi,
182  fgs,
183  sgs,
184  l1sgs,
185  chebyshev,
186  direct,
187  bgs,
190  };
191 
193  enum class CoarseningType : integer
194  {
195  default_,
196  CLJP,
197  RugeStueben,
198  Falgout,
199  PMIS,
200  HMIS
201  };
202 
204  enum class InterpType : integer
205  {
206  default_,
208  direct,
209  multipass,
210  extendedI,
211  standard,
212  extended,
213  directBAMG,
217  };
218 
220  enum class AggInterpType : integer
221  {
222  default_,
226  multipass,
231  };
232 
234  enum class NullSpaceType : integer
235  {
236  constantModes,
238  };
239 
240 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
243 #else
246 #endif
247 
265  }
266  amg;
267 
269  struct MGR
270  {
274  enum class StrategyType : integer
275  {
276  invalid,
296  hydrofracture,
299  };
300 
305  }
306  mgr;
307 
309  struct IFact
310  {
311  integer fill = 0;
313  }
315 
317  struct DD
318  {
320  }
321  dd;
322 };
323 
326  "direct",
327  "cg",
328  "gmres",
329  "fgmres",
330  "bicgstab",
331  "preconditioner" );
332 
335  "none",
336  "jacobi",
337  "l1jacobi",
338  "fgs",
339  "sgs",
340  "l1sgs",
341  "chebyshev",
342  "iluk",
343  "ilut",
344  "icc",
345  "ict",
346  "amg",
347  "mgr",
348  "block",
349  "direct",
350  "bgs" );
351 
354  "none",
355  "MMD_AtplusA",
356  "MMD_AtA",
357  "colAMD",
358  "metis",
359  "parmetis" );
360 
363  "none",
364  "mc64" );
365 
368  "invalid",
369  "singlePhaseReservoirFVM",
370  "singlePhaseHybridFVM",
371  "singlePhaseReservoirHybridFVM",
372  "singlePhasePoromechanics",
373  "thermalSinglePhasePoromechanics",
374  "hybridSinglePhasePoromechanics",
375  "singlePhasePoromechanicsEmbeddedFractures",
376  "singlePhasePoromechanicsConformingFractures",
377  "singlePhasePoromechanicsReservoirFVM",
378  "compositionalMultiphaseFVM",
379  "compositionalMultiphaseHybridFVM",
380  "compositionalMultiphaseReservoirFVM",
381  "compositionalMultiphaseReservoirHybridFVM",
382  "reactiveCompositionalMultiphaseOBL",
383  "thermalCompositionalMultiphaseFVM",
384  "thermalCompositionalMultiphaseReservoirFVM",
385  "multiphasePoromechanics",
386  "multiphasePoromechanicsReservoirFVM",
387  "thermalMultiphasePoromechanics",
388  "hydrofracture",
389  "lagrangianContactMechanics",
390  "solidMechanicsEmbeddedFractures" );
391 
394  "V",
395  "W" );
396 
399  "pre",
400  "post",
401  "both" );
402 
405  "default",
406  "jacobi",
407  "l1jacobi",
408  "fgs",
409  "bgs",
410  "sgs",
411  "l1sgs",
412  "chebyshev",
413  "ilu0",
414  "ilut",
415  "ic0",
416  "ict" );
417 
420  "default",
421  "jacobi",
422  "l1jacobi",
423  "fgs",
424  "sgs",
425  "l1sgs",
426  "chebyshev",
427  "direct",
428  "bgs",
429  "gsElimWPivoting",
430  "gsElimWInverse" );
431 
434  "default",
435  "CLJP",
436  "RugeStueben",
437  "Falgout",
438  "PMIS",
439  "HMIS" );
440 
443  "default",
444  "modifiedClassical",
445  "direct",
446  "multipass",
447  "extendedI",
448  "standard",
449  "extended",
450  "directBAMG",
451  "modifiedExtended",
452  "modifiedExtendedI",
453  "modifiedExtendedE" );
454 
457  "default",
458  "extendedIStage2",
459  "standardStage2",
460  "extendedStage2",
461  "multipass",
462  "modifiedExtended",
463  "modifiedExtendedI",
464  "modifiedExtendedE",
465  "modifiedMultipass" );
466 
469  "constantModes",
470  "rigidBodyModes" );
471 
472 } /* namespace geos */
473 
474 #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:99
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
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)
@ gsElimWInverse
Direct inverse with Gaussian Elimination.
@ direct
Direct solver as preconditioner.
@ gsElimWPivoting
Gaussian Elimination with pivoting direct solver.
@ 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.
real64 adaptiveGamma
Gamma parameter for adaptive method.
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.
real64 adaptiveExponent
Exponent parameter for adaptive method.
real64 strongestTol
Strongest allowed tolerance when using adaptive method.
integer useAdaptiveTol
Use Eisenstat-Walker adaptive tolerance.
Multigrid reduction parameters.
integer separateComponents
Apply a separate displacement component (SDC) filter before AMG construction.
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
@ thermalCompositionalMultiphaseReservoirFVM
finite volume thermal compositional multiphase flow
@ 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 embedded 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.