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  multiscale
73  };
74 
77  bool isSymmetric = false;
79 
83 
85  struct Direct
86  {
90  enum class ColPerm : integer
91  {
92  none,
93  MMD_AtplusA,
94  MMD_AtA,
95  colAMD,
96  metis,
97  parmetis
98  };
99 
103  enum class RowPerm : integer
104  {
105  none,
106  mc64
107  };
108 
117  }
119 
121  struct Krylov
122  {
125 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
127 #else
128  integer maxRestart = 200;
129 #endif
135  }
137 
139  struct Relaxation
140  {
141  real64 weight = 2.0 / 3.0;
142  }
144 
146  struct Chebyshev
147  {
150  }
152 
154  struct Scaling
155  {
158  }
160 
162  struct AMG
163  {
165  enum class CycleType : integer
166  {
167  V,
168  W
169  };
170 
172  enum class PreOrPost : integer
173  {
174  pre,
175  post,
176  both
177  };
178 
180  enum class SmootherType : integer
181  {
182  default_,
183  jacobi,
184  l1jacobi,
185  fgs,
186  bgs,
187  sgs,
188  l1sgs,
189  chebyshev,
190  iluk,
191  ilut,
192  ick,
193  ict
194  };
195 
197  enum class CoarseType : integer
198  {
199  default_,
200  jacobi,
201  l1jacobi,
202  fgs,
203  sgs,
204  l1sgs,
205  chebyshev,
206  direct,
207  bgs,
210  };
211 
213  enum class CoarseningType : integer
214  {
215  default_,
216  CLJP,
217  RugeStueben,
218  Falgout,
219  PMIS,
220  HMIS
221  };
222 
224  enum class InterpType : integer
225  {
226  default_,
228  direct,
229  multipass,
230  extendedI,
231  standard,
232  extended,
233  directBAMG,
237  };
238 
240  enum class AggInterpType : integer
241  {
242  default_,
246  multipass,
251  };
252 
254  enum class NullSpaceType : integer
255  {
256  constantModes,
258  };
259 
260 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
263 #else
266 #endif
267 
287  }
288  amg;
289 
291  struct MGR
292  {
296  enum class StrategyType : integer
297  {
298  invalid,
321  hydrofracture,
326  };
327 
332  }
333  mgr;
334 
336  struct IFact
337  {
338  integer fill = 0;
340  }
342 
344  struct DD
345  {
347  }
348  dd;
349 
351  struct Block
352  {
354  enum class Shape
355  {
356  Diagonal,
360  };
361 
363  enum class SchurType
364  {
365  None,
369  };
370 
372  enum class Scaling
373  {
374  None,
375  FrobeniusNorm,
376  UserProvided
377  };
378 
382 
385 
390  void resize( integer const numBlocks )
391  {
392  subParams.resize( numBlocks );
393  order.resize( numBlocks );
394  for( integer i = 0; i < numBlocks; ++i )
395  {
396  order[i] = i;
397  }
398  }
399  }
401 
403  struct Multiscale
404  {
406  enum class BasisType
407  {
408  msrsb,
409  };
410 
411  // Core parameters
413  string fieldName;
416  real64 droptol = 0.0;
420 
421  // Debugging/user-display settings
422  string label;
424 
426  struct Smoother
427  {
431  }
433 
435  struct Coupled
436  {
438  }
440 
442  struct Coarsening
443  {
445  enum class PartitionType
446  {
447  graph,
448  cartesian,
450  };
451 
455 
457  struct Structured
458  {
460  }
462 
464  struct Graph
465  {
467  enum class Method
468  {
469  metis,
470  scotch,
471  };
472 
473  Method method = Method::metis;
478 
480  struct Metis
481  {
483  enum class Method
484  {
485  kway,
486  recursive
487  };
488 
489  Method method = Method::kway;
491  integer seed = 2020;
492  }
494 
496  struct Scotch
497  {
498  // TODO
499  } scotch;
500 
501  } graph;
502 
504 
506  struct MsRSB
507  {
509  enum class SupportType : integer
510  {
511  layers,
512  matching
513  };
514 
515  SupportType support = SupportType::matching;
516 
518  integer maxIter = 100;
519  real64 tolerance = 1e-3;
520  real64 relaxation = 2.0 / 3.0;
523  }
525  }
527 };
528 
531  "direct",
532  "cg",
533  "gmres",
534  "fgmres",
535  "bicgstab",
536  "richardson",
537  "preconditioner" );
538 
541  "none",
542  "jacobi",
543  "l1jacobi",
544  "fgs",
545  "sgs",
546  "l1sgs",
547  "chebyshev",
548  "iluk",
549  "ilut",
550  "ick",
551  "ict",
552  "amg",
553  "mgr",
554  "block",
555  "direct",
556  "bgs",
557  "multiscale" );
558 
561  "none",
562  "MMD_AtplusA",
563  "MMD_AtA",
564  "colAMD",
565  "metis",
566  "parmetis" );
567 
570  "none",
571  "mc64" );
572 
575  "invalid",
576  "singlePhaseReservoirFVM",
577  "thermalSinglePhaseReservoirFVM",
578  "singlePhaseHybridFVM",
579  "singlePhaseReservoirHybridFVM",
580  "singlePhasePoromechanics",
581  "thermalSinglePhasePoromechanics",
582  "hybridSinglePhasePoromechanics",
583  "singlePhasePoromechanicsEmbeddedFractures",
584  "singlePhasePoromechanicsConformingFractures",
585  "singlePhasePoromechanicsReservoirFVM",
586  "thermalSinglePhasePoromechanicsReservoirFVM",
587  "compositionalMultiphaseFVM",
588  "compositionalMultiphaseHybridFVM",
589  "compositionalMultiphaseReservoirFVM",
590  "compositionalMultiphaseReservoirHybridFVM",
591  "immiscibleMultiphaseFVM",
592  "reactiveCompositionalMultiphaseOBL",
593  "thermalCompositionalMultiphaseFVM",
594  "thermalCompositionalMultiphaseReservoirFVM",
595  "multiphasePoromechanics",
596  "multiphasePoromechanicsReservoirFVM",
597  "thermalMultiphasePoromechanics",
598  "hydrofracture",
599  "lagrangianContactMechanics",
600  "augmentedLagrangianContactMechanics",
601  "lagrangianContactMechanicsBubbleStab",
602  "solidMechanicsEmbeddedFractures" );
603 
606  "V",
607  "W" );
608 
611  "pre",
612  "post",
613  "both" );
614 
617  "default",
618  "jacobi",
619  "l1jacobi",
620  "fgs",
621  "bgs",
622  "sgs",
623  "l1sgs",
624  "chebyshev",
625  "iluk",
626  "ilut",
627  "ick",
628  "ict" );
629 
632  "default",
633  "jacobi",
634  "l1jacobi",
635  "fgs",
636  "sgs",
637  "l1sgs",
638  "chebyshev",
639  "direct",
640  "bgs",
641  "gsElimWPivoting",
642  "gsElimWInverse" );
643 
646  "default",
647  "CLJP",
648  "RugeStueben",
649  "Falgout",
650  "PMIS",
651  "HMIS" );
652 
655  "default",
656  "modifiedClassical",
657  "direct",
658  "multipass",
659  "extendedI",
660  "standard",
661  "extended",
662  "directBAMG",
663  "modifiedExtended",
664  "modifiedExtendedI",
665  "modifiedExtendedE" );
666 
669  "default",
670  "extendedIStage2",
671  "standardStage2",
672  "extendedStage2",
673  "multipass",
674  "modifiedExtended",
675  "modifiedExtendedI",
676  "modifiedExtendedE",
677  "modifiedMultipass" );
678 
681  "constantModes",
682  "rigidBodyModes" );
683 
686  "D",
687  "DU",
688  "LD",
689  "LDU" );
690 
693  "none",
694  "diagonal",
695  "probing",
696  "user" );
697 
700  "none",
701  "frobenius",
702  "user" );
703 
706  "msrsb" );
707 
710  "graph",
711  "cartesian",
712  "semistructured" );
713 
716  "metis",
717  "scotch" );
718 
721  "kway",
722  "recursive" );
723 
726  "layers",
727  "matching" );
728 
729 } /* namespace geos */
730 
731 #endif /*GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_ */
stdVector< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:361
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
Definition: DataTypes.hpp:87
LvArray::CRSMatrix< T, COL_INDEX, INDEX_TYPE, LvArray::ChaiBuffer > CRSMatrix
Alias for CRS Matrix class.
Definition: DataTypes.hpp:305
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)
integer reuseFactorization
Whether to reuse the LU factorization or not.
@ 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
@ thermalSinglePhaseReservoirFVM
finite volume thermal single-phase flow with wells
@ singlePhasePoromechanicsEmbeddedFractures
single phase poromechanics with FV embedded fractures
@ thermalSinglePhasePoromechanicsReservoirFVM
thermal single phase poromechanics with finite volume single phase flow with wells
@ 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
integer ufactor
METIS UFACTOR option (allowed partition imbalance)
integer preserveRegions
Attempt to keep cells from the same region in one aggregate.
CRSMatrix< real64, localIndex > const * localMatrix
Local matrix to use for weights.
struct geos::LinearSolverParameters::Multiscale::Coarsening::Graph::Metis metis
METIS parameters.
integer matrixWeights
If >0, specifies matrix weight multiplier.
integer minCommonNodes
Min number of common nodes when constructing a cell connectivity graph.
struct geos::LinearSolverParameters::Multiscale::Coarsening::Graph::Scotch scotch
Scotch parameters.
struct geos::LinearSolverParameters::Multiscale::Coarsening::Graph graph
Graph coarsening parameters.
struct geos::LinearSolverParameters::Multiscale::Coarsening::Structured structured
Structured coarsening parameters.
PartitionType partitionType
Partitioning/coarsening method.
array1d< real64 > ratio
Coarsening ratio (cell-based), total or per-dimension.
globalIndex maxCoarseDof
Limit of coarsening globally (trims the grid hierarchy)
integer useBlockSmoother
Whether to use block smoother.
integer updateFrequency
Coarse operator update frequency (num smoothing iterations)
real64 tolerance
Smoothing iteration convergence tolerance.
integer maxIter
Max number of smoothing iterations.
integer numLayers
Number of layers to grow (for support = layers)
real64 relaxation
Relaxation parameter for Jacobi smoothing.
integer checkFrequency
Convergence check frequency (num smoothing iterations)
SupportType support
algorithm used to construct support regions
AMG::PreOrPost preOrPost
Pre and/or post smoothing [pre,post,both].
Multiscale preconditioner parameters.
struct geos::LinearSolverParameters::Multiscale::Coupled coupled
Multiscale coupled parameters.
integer galerkin
Whether to use Galerkin definition R = P^T (otherwise R = P_0^T)
integer maxLevels
Limit on total number of grid levels.
struct geos::LinearSolverParameters::Multiscale::MsRSB msrsb
MsRSB parameters.
struct geos::LinearSolverParameters::Multiscale::Coarsening coarsening
Multiscale coarsening parameters.
integer debugLevel
Flag for enabling addition debugging output.
string fieldName
DofManager field name, populated by the physics solver.
string label
User-displayed label of the scheme.
PreconditionerType coarseType
Coarse solver type.
real64 droptol
Dropping tolerance for coarse matrix values (relative to row max)
@ msrsb
Restricted Smoothing Basis Multiscale.
integer separateComponents
Apply a separate component filter before multiscale.
struct geos::LinearSolverParameters::Multiscale::Smoother smoother
Multiscale smoother parameters.
string_array boundarySets
List of boundary node set names (needed for coarse node detection)
BasisType basisType
Type of basis functions.
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.
string hypredriveInputFile
Optional authoritative hypredrive YAML file.
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.
struct geos::LinearSolverParameters::Multiscale multiscale
Multiscale preconditioner parameters.
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.