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,
326  hydrofracture,
331  };
332 
337  }
338  mgr;
339 
341  struct IFact
342  {
343  integer fill = 0;
345  }
347 
349  struct DD
350  {
352  }
353  dd;
354 
356  struct Block
357  {
359  enum class Shape
360  {
361  Diagonal,
365  };
366 
368  enum class SchurType
369  {
370  None,
374  };
375 
377  enum class Scaling
378  {
379  None,
380  FrobeniusNorm,
381  UserProvided
382  };
383 
387 
390 
395  void resize( integer const numBlocks )
396  {
397  subParams.resize( numBlocks );
398  order.resize( numBlocks );
399  for( integer i = 0; i < numBlocks; ++i )
400  {
401  order[i] = i;
402  }
403  }
404  }
406 
408  struct Multiscale
409  {
411  enum class BasisType
412  {
413  msrsb,
414  };
415 
416  // Core parameters
418  string fieldName;
421  real64 droptol = 0.0;
425 
426  // Debugging/user-display settings
427  string label;
429 
431  struct Smoother
432  {
436  }
438 
440  struct Coupled
441  {
443  }
445 
447  struct Coarsening
448  {
450  enum class PartitionType
451  {
452  graph,
453  cartesian,
455  };
456 
460 
462  struct Structured
463  {
465  }
467 
469  struct Graph
470  {
472  enum class Method
473  {
474  metis,
475  scotch,
476  };
477 
478  Method method = Method::metis;
483 
485  struct Metis
486  {
488  enum class Method
489  {
490  kway,
491  recursive
492  };
493 
494  Method method = Method::kway;
496  integer seed = 2020;
497  }
499 
501  struct Scotch
502  {
503  // TODO
504  } scotch;
505 
506  } graph;
507 
509 
511  struct MsRSB
512  {
514  enum class SupportType : integer
515  {
516  layers,
517  matching
518  };
519 
520  SupportType support = SupportType::matching;
521 
523  integer maxIter = 100;
524  real64 tolerance = 1e-3;
525  real64 relaxation = 2.0 / 3.0;
528  }
530  }
532 };
533 
536  "direct",
537  "cg",
538  "gmres",
539  "fgmres",
540  "bicgstab",
541  "richardson",
542  "preconditioner" );
543 
546  "none",
547  "jacobi",
548  "l1jacobi",
549  "fgs",
550  "sgs",
551  "l1sgs",
552  "chebyshev",
553  "iluk",
554  "ilut",
555  "ick",
556  "ict",
557  "amg",
558  "mgr",
559  "block",
560  "direct",
561  "bgs",
562  "multiscale" );
563 
566  "none",
567  "MMD_AtplusA",
568  "MMD_AtA",
569  "colAMD",
570  "metis",
571  "parmetis" );
572 
575  "none",
576  "mc64" );
577 
580  "invalid",
581  "singlePhaseReservoirFVM",
582  "thermalSinglePhaseReservoirFVM",
583  "singlePhaseHybridFVM",
584  "singlePhaseReservoirHybridFVM",
585  "singlePhasePoromechanics",
586  "thermalSinglePhasePoromechanics",
587  "hybridSinglePhasePoromechanics",
588  "singlePhasePoromechanicsEmbeddedFractures",
589  "singlePhasePoromechanicsConformingFractures",
590  "singlePhasePoromechanicsConformingFracturesALM",
591  "singlePhasePoromechanicsConformingFracturesALMReservoirFVM",
592  "singlePhasePoromechanicsReservoirFVM",
593  "thermalSinglePhasePoromechanicsReservoirFVM",
594  "compositionalMultiphaseFVM",
595  "compositionalMultiphaseHybridFVM",
596  "compositionalMultiphaseReservoirFVM",
597  "compositionalMultiphaseReservoirHybridFVM",
598  "immiscibleMultiphaseFVM",
599  "reactiveCompositionalMultiphaseOBL",
600  "thermalCompositionalMultiphaseFVM",
601  "thermalCompositionalMultiphaseReservoirFVM",
602  "multiphasePoromechanics",
603  "multiphasePoromechanicsReservoirFVM",
604  "thermalMultiphasePoromechanics",
605  "hydrofracture",
606  "lagrangianContactMechanics",
607  "augmentedLagrangianContactMechanics",
608  "lagrangianContactMechanicsBubbleStab",
609  "solidMechanicsEmbeddedFractures" );
610 
613  "V",
614  "W" );
615 
618  "pre",
619  "post",
620  "both" );
621 
624  "default",
625  "jacobi",
626  "l1jacobi",
627  "fgs",
628  "bgs",
629  "sgs",
630  "l1sgs",
631  "chebyshev",
632  "iluk",
633  "ilut",
634  "ick",
635  "ict" );
636 
639  "default",
640  "jacobi",
641  "l1jacobi",
642  "fgs",
643  "sgs",
644  "l1sgs",
645  "chebyshev",
646  "direct",
647  "bgs",
648  "gsElimWPivoting",
649  "gsElimWInverse" );
650 
653  "default",
654  "CLJP",
655  "RugeStueben",
656  "Falgout",
657  "PMIS",
658  "HMIS" );
659 
662  "default",
663  "modifiedClassical",
664  "direct",
665  "multipass",
666  "extendedI",
667  "standard",
668  "extended",
669  "directBAMG",
670  "modifiedExtended",
671  "modifiedExtendedI",
672  "modifiedExtendedE" );
673 
676  "default",
677  "extendedIStage2",
678  "standardStage2",
679  "extendedStage2",
680  "multipass",
681  "modifiedExtended",
682  "modifiedExtendedI",
683  "modifiedExtendedE",
684  "modifiedMultipass" );
685 
688  "constantModes",
689  "rigidBodyModes" );
690 
693  "D",
694  "DU",
695  "LD",
696  "LDU" );
697 
700  "none",
701  "diagonal",
702  "probing",
703  "user" );
704 
707  "none",
708  "frobenius",
709  "user" );
710 
713  "msrsb" );
714 
717  "graph",
718  "cartesian",
719  "semistructured" );
720 
723  "metis",
724  "scotch" );
725 
728  "kway",
729  "recursive" );
730 
733  "layers",
734  "matching" );
735 
736 } /* namespace geos */
737 
738 #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
@ 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.