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 #include "common/DataTypes.hpp"
25 
26 namespace geos
27 {
28 
36 {
40  enum class SolverType : integer
41  {
42  direct,
43  cg,
44  gmres,
45  fgmres,
46  bicgstab,
47  richardson,
49  };
50 
55  {
56  none,
57  jacobi,
58  l1jacobi,
59  fgs,
60  sgs,
61  l1sgs,
62  chebyshev,
63  iluk,
64  ilut,
65  ick,
66  ict,
67  amg,
68  mgr,
69  block,
70  direct,
71  bgs
72  };
73 
76  bool isSymmetric = false;
78 
81 
83  struct Direct
84  {
88  enum class ColPerm : integer
89  {
90  none,
91  MMD_AtplusA,
92  MMD_AtA,
93  colAMD,
94  metis,
95  parmetis
96  };
97 
101  enum class RowPerm : integer
102  {
103  none,
104  mc64
105  };
106 
114  }
116 
118  struct Krylov
119  {
122 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
124 #else
125  integer maxRestart = 200;
126 #endif
132  }
134 
136  struct Relaxation
137  {
138  real64 weight = 2.0 / 3.0;
139  }
141 
143  struct Chebyshev
144  {
147  }
149 
151  struct Scaling
152  {
155  }
157 
159  struct AMG
160  {
162  enum class CycleType : integer
163  {
164  V,
165  W
166  };
167 
169  enum class PreOrPost : integer
170  {
171  pre,
172  post,
173  both
174  };
175 
177  enum class SmootherType : integer
178  {
179  default_,
180  jacobi,
181  l1jacobi,
182  fgs,
183  bgs,
184  sgs,
185  l1sgs,
186  chebyshev,
187  iluk,
188  ilut,
189  ick,
190  ict
191  };
192 
194  enum class CoarseType : integer
195  {
196  default_,
197  jacobi,
198  l1jacobi,
199  fgs,
200  sgs,
201  l1sgs,
202  chebyshev,
203  direct,
204  bgs,
207  };
208 
210  enum class CoarseningType : integer
211  {
212  default_,
213  CLJP,
214  RugeStueben,
215  Falgout,
216  PMIS,
217  HMIS
218  };
219 
221  enum class InterpType : integer
222  {
223  default_,
225  direct,
226  multipass,
227  extendedI,
228  standard,
229  extended,
230  directBAMG,
234  };
235 
237  enum class AggInterpType : integer
238  {
239  default_,
243  multipass,
248  };
249 
251  enum class NullSpaceType : integer
252  {
253  constantModes,
255  };
256 
257 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
260 #else
263 #endif
264 
284  }
285  amg;
286 
288  struct MGR
289  {
293  enum class StrategyType : integer
294  {
295  invalid,
316  hydrofracture,
321  };
322 
327  }
328  mgr;
329 
331  struct IFact
332  {
333  integer fill = 0;
335  }
337 
339  struct DD
340  {
342  }
343  dd;
344 
346  struct Block
347  {
349  enum class Shape
350  {
351  Diagonal,
355  };
356 
358  enum class SchurType
359  {
360  None,
364  };
365 
367  enum class Scaling
368  {
369  None,
370  FrobeniusNorm,
371  UserProvided
372  };
373 
377 
380 
385  void resize( integer const numBlocks )
386  {
387  subParams.resize( numBlocks );
388  order.resize( numBlocks );
389  for( integer i = 0; i < numBlocks; ++i )
390  {
391  order[i] = i;
392  }
393  }
394  }
396 };
397 
400  "direct",
401  "cg",
402  "gmres",
403  "fgmres",
404  "bicgstab",
405  "richardson",
406  "preconditioner" );
407 
410  "none",
411  "jacobi",
412  "l1jacobi",
413  "fgs",
414  "sgs",
415  "l1sgs",
416  "chebyshev",
417  "iluk",
418  "ilut",
419  "ick",
420  "ict",
421  "amg",
422  "mgr",
423  "block",
424  "direct",
425  "bgs" );
426 
429  "none",
430  "MMD_AtplusA",
431  "MMD_AtA",
432  "colAMD",
433  "metis",
434  "parmetis" );
435 
438  "none",
439  "mc64" );
440 
443  "invalid",
444  "singlePhaseReservoirFVM",
445  "singlePhaseHybridFVM",
446  "singlePhaseReservoirHybridFVM",
447  "singlePhasePoromechanics",
448  "thermalSinglePhasePoromechanics",
449  "hybridSinglePhasePoromechanics",
450  "singlePhasePoromechanicsEmbeddedFractures",
451  "singlePhasePoromechanicsConformingFractures",
452  "singlePhasePoromechanicsReservoirFVM",
453  "compositionalMultiphaseFVM",
454  "compositionalMultiphaseHybridFVM",
455  "compositionalMultiphaseReservoirFVM",
456  "compositionalMultiphaseReservoirHybridFVM",
457  "immiscibleMultiphaseFVM",
458  "reactiveCompositionalMultiphaseOBL",
459  "thermalCompositionalMultiphaseFVM",
460  "thermalCompositionalMultiphaseReservoirFVM",
461  "multiphasePoromechanics",
462  "multiphasePoromechanicsReservoirFVM",
463  "thermalMultiphasePoromechanics",
464  "hydrofracture",
465  "lagrangianContactMechanics",
466  "augmentedLagrangianContactMechanics",
467  "lagrangianContactMechanicsBubbleStab",
468  "solidMechanicsEmbeddedFractures" );
469 
472  "V",
473  "W" );
474 
477  "pre",
478  "post",
479  "both" );
480 
483  "default",
484  "jacobi",
485  "l1jacobi",
486  "fgs",
487  "bgs",
488  "sgs",
489  "l1sgs",
490  "chebyshev",
491  "iluk",
492  "ilut",
493  "ick",
494  "ict" );
495 
498  "default",
499  "jacobi",
500  "l1jacobi",
501  "fgs",
502  "sgs",
503  "l1sgs",
504  "chebyshev",
505  "direct",
506  "bgs",
507  "gsElimWPivoting",
508  "gsElimWInverse" );
509 
512  "default",
513  "CLJP",
514  "RugeStueben",
515  "Falgout",
516  "PMIS",
517  "HMIS" );
518 
521  "default",
522  "modifiedClassical",
523  "direct",
524  "multipass",
525  "extendedI",
526  "standard",
527  "extended",
528  "directBAMG",
529  "modifiedExtended",
530  "modifiedExtendedI",
531  "modifiedExtendedE" );
532 
535  "default",
536  "extendedIStage2",
537  "standardStage2",
538  "extendedStage2",
539  "multipass",
540  "modifiedExtended",
541  "modifiedExtendedI",
542  "modifiedExtendedE",
543  "modifiedMultipass" );
544 
547  "constantModes",
548  "rigidBodyModes" );
549 
552  "D",
553  "DU",
554  "LD",
555  "LDU" );
556 
559  "none",
560  "diagonal",
561  "probing",
562  "user" );
563 
566  "none",
567  "frobenius",
568  "user" );
569 
570 } /* namespace geos */
571 
572 #endif /*GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_ */
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
int integer
Signed integer type.
Definition: DataTypes.hpp:81
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:175
ENUM_STRINGS(LinearSolverParameters::SolverType, "direct", "cg", "gmres", "fgmres", "bicgstab", "richardson", "preconditioner")
Declare strings associated with enumeration values.
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.
@ iluk
Incomplete LU with k-level of fill.
@ ick
Incomplete Cholesky with k-level of fill.
@ 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)
integer maxCoarseSize
Threshold for coarse grid size.
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 numCycles
Number of multigrid cycles.
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.
Block preconditioner parameters.
array1d< integer > order
Order of application of sub-problem solvers.
array1d< LinearSolverParameters const * > subParams
Pointers to parameters for sub-problems.
Shape shape
Block preconditioner shape.
Scaling scaling
Type of system scaling to use.
SchurType
Type of Schur complement approximation used.
@ FirstBlockDiagonal
Approximate first block with its diagonal.
@ None
No Schur complement - just block-GS/block-Jacobi preconditioner.
@ FirstBlockUserDefined
User defined preconditioner for the first block.
@ RowsumDiagonalProbing
Rowsum-preserving diagonal approximation constructed with probing.
void resize(integer const numBlocks)
Set the number of blocks and resize arrays accordingly.
Scaling
Type of block row scaling to apply.
@ FrobeniusNorm
Equilibrate Frobenius norm of the diagonal blocks.
Shape
Shape of the block preconditioner.
SchurType schurType
Schur complement type.
Chebyshev iteration/smoothing parameters.
integer eigNumIter
Number of eigenvalue estimation CG iterations.
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
@ augmentedLagrangianContactMechanics
Augmented Lagrangian contact mechanics.
@ 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 conforming fractures
@ immiscibleMultiphaseFVM
finite volume immiscible multiphase flow
@ 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
@ lagrangianContactMechanicsBubbleStab
Lagrangian contact mechanics with bubble stabilization.
@ 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
Relaxation/stationary iteration parameters (Richardson, damped Jacobi, etc.)
real64 weight
Relaxation weight (omega) for stationary iterations.
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::Chebyshev chebyshev
Chebyshev smoother parameters.
struct geos::LinearSolverParameters::IFact ifact
Incomplete factorization parameter struct.
struct geos::LinearSolverParameters::Relaxation relaxation
Relaxation method parameters.
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.
@ ick
Incomplete Cholesky 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::Block block
Block preconditioner parameters.
struct geos::LinearSolverParameters::MGR mgr
Multigrid reduction (MGR) parameters.
struct geos::LinearSolverParameters::Krylov krylov
Krylov-method parameter struct.