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,
327  hydrofracture,
332  };
333 
341  }
342  mgr;
343 
345  struct IFact
346  {
347  integer fill = 0;
349  }
351 
353  struct DD
354  {
356  }
357  dd;
358 
360  struct Block
361  {
363  enum class Shape
364  {
365  Diagonal,
369  };
370 
372  enum class SchurType
373  {
374  None,
378  };
379 
381  enum class Scaling
382  {
383  None,
384  FrobeniusNorm,
385  UserProvided
386  };
387 
391 
394 
399  void resize( integer const numBlocks )
400  {
401  subParams.resize( numBlocks );
402  order.resize( numBlocks );
403  for( integer i = 0; i < numBlocks; ++i )
404  {
405  order[i] = i;
406  }
407  }
408  }
410 
412  struct Multiscale
413  {
415  enum class BasisType
416  {
417  msrsb,
418  };
419 
420  // Core parameters
422  string fieldName;
425  real64 droptol = 0.0;
429 
430  // Debugging/user-display settings
431  string label;
433 
435  struct Smoother
436  {
440  }
442 
444  struct Coupled
445  {
447  }
449 
451  struct Coarsening
452  {
454  enum class PartitionType
455  {
456  graph,
457  cartesian,
459  };
460 
464 
466  struct Structured
467  {
469  }
471 
473  struct Graph
474  {
476  enum class Method
477  {
478  metis,
479  scotch,
480  };
481 
482  Method method = Method::metis;
487 
489  struct Metis
490  {
492  enum class Method
493  {
494  kway,
495  recursive
496  };
497 
498  Method method = Method::kway;
500  integer seed = 2020;
501  }
503 
505  struct Scotch
506  {
507  // TODO
508  } scotch;
509 
510  } graph;
511 
513 
515  struct MsRSB
516  {
518  enum class SupportType : integer
519  {
520  layers,
521  matching
522  };
523 
524  SupportType support = SupportType::matching;
525 
527  integer maxIter = 100;
528  real64 tolerance = 1e-3;
529  real64 relaxation = 2.0 / 3.0;
532  }
534  }
536 };
537 
540  "direct",
541  "cg",
542  "gmres",
543  "fgmres",
544  "bicgstab",
545  "richardson",
546  "preconditioner" );
547 
550  "none",
551  "jacobi",
552  "l1jacobi",
553  "fgs",
554  "sgs",
555  "l1sgs",
556  "chebyshev",
557  "iluk",
558  "ilut",
559  "ick",
560  "ict",
561  "amg",
562  "mgr",
563  "block",
564  "direct",
565  "bgs",
566  "multiscale" );
567 
570  "none",
571  "MMD_AtplusA",
572  "MMD_AtA",
573  "colAMD",
574  "metis",
575  "parmetis" );
576 
579  "none",
580  "mc64" );
581 
584  "invalid",
585  "singlePhaseReservoirFVM",
586  "thermalSinglePhaseReservoirFVM",
587  "singlePhaseHybridFVM",
588  "singlePhaseMixedMFD",
589  "singlePhaseReservoirHybridFVM",
590  "singlePhasePoromechanics",
591  "thermalSinglePhasePoromechanics",
592  "hybridSinglePhasePoromechanics",
593  "singlePhasePoromechanicsEmbeddedFractures",
594  "singlePhasePoromechanicsConformingFractures",
595  "singlePhasePoromechanicsConformingFracturesALM",
596  "singlePhasePoromechanicsConformingFracturesALMReservoirFVM",
597  "singlePhasePoromechanicsReservoirFVM",
598  "thermalSinglePhasePoromechanicsReservoirFVM",
599  "compositionalMultiphaseFVM",
600  "compositionalMultiphaseHybridFVM",
601  "compositionalMultiphaseReservoirFVM",
602  "compositionalMultiphaseReservoirHybridFVM",
603  "immiscibleMultiphaseFVM",
604  "reactiveCompositionalMultiphaseOBL",
605  "thermalCompositionalMultiphaseFVM",
606  "thermalCompositionalMultiphaseReservoirFVM",
607  "multiphasePoromechanics",
608  "multiphasePoromechanicsReservoirFVM",
609  "thermalMultiphasePoromechanics",
610  "hydrofracture",
611  "lagrangianContactMechanics",
612  "augmentedLagrangianContactMechanics",
613  "lagrangianContactMechanicsBubbleStab",
614  "solidMechanicsEmbeddedFractures" );
615 
618  "V",
619  "W" );
620 
623  "pre",
624  "post",
625  "both" );
626 
629  "default",
630  "jacobi",
631  "l1jacobi",
632  "fgs",
633  "bgs",
634  "sgs",
635  "l1sgs",
636  "chebyshev",
637  "iluk",
638  "ilut",
639  "ick",
640  "ict" );
641 
644  "default",
645  "jacobi",
646  "l1jacobi",
647  "fgs",
648  "sgs",
649  "l1sgs",
650  "chebyshev",
651  "direct",
652  "bgs",
653  "gsElimWPivoting",
654  "gsElimWInverse" );
655 
658  "default",
659  "CLJP",
660  "RugeStueben",
661  "Falgout",
662  "PMIS",
663  "HMIS" );
664 
667  "default",
668  "modifiedClassical",
669  "direct",
670  "multipass",
671  "extendedI",
672  "standard",
673  "extended",
674  "directBAMG",
675  "modifiedExtended",
676  "modifiedExtendedI",
677  "modifiedExtendedE" );
678 
681  "default",
682  "extendedIStage2",
683  "standardStage2",
684  "extendedStage2",
685  "multipass",
686  "modifiedExtended",
687  "modifiedExtendedI",
688  "modifiedExtendedE",
689  "modifiedMultipass" );
690 
693  "constantModes",
694  "rigidBodyModes" );
695 
698  "D",
699  "DU",
700  "LD",
701  "LDU" );
702 
705  "none",
706  "diagonal",
707  "probing",
708  "user" );
709 
712  "none",
713  "frobenius",
714  "user" );
715 
718  "msrsb" );
719 
722  "graph",
723  "cartesian",
724  "semistructured" );
725 
728  "metis",
729  "scotch" );
730 
733  "kway",
734  "recursive" );
735 
738  "layers",
739  "matching" );
740 
741 } /* namespace geos */
742 
743 #endif /*GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERPARAMETERS_HPP_ */
Class describing a file Path.
Definition: Path.hpp:35
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
@ singlePhaseMixedMFD
mixed mimetic finite difference single-phase flow
@ compositionalMultiphaseHybridFVM
hybrid finite volume compositional multiphase flow
@ solidMechanicsEmbeddedFractures
Embedded fractures mechanics.
@ singlePhaseReservoirHybridFVM
hybrid finite volume single-phase 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
@ singlePhasePoromechanicsConformingFracturesALM
single phase poromechanics with conforming fractures for ALM
@ 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
@ 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.
Path 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.