20 #ifndef GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRSTRATEGIES_HPP_
21 #define GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRSTRATEGIES_HPP_
29 #include <_hypre_utilities.h>
58 template<
typename STRATEGY >
64 STRATEGY strategy( numComponentsPerField );
65 strategy.setup( params, precond, mgrData );
72 template<
int NLEVEL >
108 for( HYPRE_Int i = 0; i <
numLevels; ++i )
123 for( HYPRE_Int i = 0; i <
numLevels; ++i )
141 for( HYPRE_Int i = 0; i <
numLevels; ++i )
175 integer const & separateComponents )
184 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
195 solver.
setup = HYPRE_BoomerAMGSetup;
196 solver.
solve = HYPRE_BoomerAMGSolve;
197 solver.
destroy = HYPRE_BoomerAMGDestroy;
213 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
223 solver.
setup = HYPRE_BoomerAMGSetup;
224 solver.
solve = HYPRE_BoomerAMGSolve;
225 solver.
destroy = HYPRE_BoomerAMGDestroy;
241 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
251 solver.
setup = HYPRE_BoomerAMGSetup;
252 solver.
solve = HYPRE_BoomerAMGSolve;
253 solver.
destroy = HYPRE_BoomerAMGDestroy;
267 integer const & separateComponents )
void createMGR(LinearSolverParameters const ¶ms, DofManager const *const dofManager, HyprePrecWrapper &precond, HypreMGRData &mgrData)
Create the MGR preconditioner object.
void setStrategy(LinearSolverParameters::MGR const ¶ms, arrayView1d< int const > const &numComponentsPerField, HyprePrecWrapper &precond, HypreMGRData &mgrData)
Helper to simplify MGR setup.
The DoFManager is responsible for allocating global dofs, constructing sparsity patterns,...
Helper struct for strategies that provides some basic parameter arrays needed by MGR.
MGRCoarseGridMethod m_levelCoarseGridMethod[numLevels]
Coarse grid method for each level.
HYPRE_Int m_numBlocks
Number of different matrix blocks treated separately.
void setDisplacementAMG(HyprePrecWrapper &solver, integer const &separateComponents)
Set up BoomerAMG to perform the solve for the displacement system.
MGRInterpolationType m_levelInterpType[numLevels]
Interpolation type for each level.
MGRStrategyBase(HYPRE_Int const numBlocks)
Constructor.
std::vector< HYPRE_Int > m_labels[numLevels]
Dof labels kept at each level.
void setPressureTemperatureAMG(HyprePrecWrapper &solver)
Set up BoomerAMG to perform the solve for the pressure/temperature system.
static constexpr HYPRE_Int numLevels
Number of levels.
void setMechanicsFSolver(HyprePrecWrapper &precond, HypreMGRData &mgrData, integer const &separateComponents)
Set up BoomerAMG to perform the mechanics F-solve for the first F-relaxation.
void setupLabels()
Call this after populating lv_cindexes.
HYPRE_Int m_levelFRelaxIters[numLevels]
Number of F-relaxation iterations for each level.
void setPressureAMG(HyprePrecWrapper &solver)
Set up BoomerAMG to perform the solve for the pressure system.
void setReduction(HyprePrecWrapper &precond, HypreMGRData &mgrData)
Helper function that sets the reduction features common to all mgr strategies.
MGRFRelaxationType m_levelFRelaxType[numLevels]
F-relaxation type for each level.
HYPRE_Int * m_ptrLabels[numLevels]
Pointers to each level's labels, as consumed by MGR.
HYPRE_Int m_levelGlobalSmootherIters[numLevels]
Number of global smoother iterations for each level.
HYPRE_Real m_coarseGridThreshold
Coarse grid truncation threshold.
MGRGlobalSmootherType m_levelGlobalSmootherType[numLevels]
Global smoother type for each level.
HYPRE_Int m_numLabels[numLevels]
Number of dof labels kept.
MGRRestrictionType m_levelRestrictType[numLevels]
Restriction type for each level.
#define GEOS_LAI_CHECK_ERROR(call)
HYPRE_Int getAMGInterpolationType(LinearSolverParameters::AMG::InterpType const &type)
Returns hypre's identifier of the AMG interpolation type.
MGRCoarseGridMethod
This enum class specifies the strategy for level coarse grid computation in MGR.
@ galerkin
Galerkin coarse grid computation using RAP.
MGRRestrictionType
This enum class specifies the strategy for computing the level restriction operator in MGR.
HYPRE_Int getAMGAggressiveInterpolationType(LinearSolverParameters::AMG::AggInterpType const &type)
Returns hypre's identifier of the AMG aggressive interpolation type.
MGRFRelaxationType
This enum class specifies the F-relaxation type.
@ none
no F-relaxation if performed
HYPRE_Int getAMGRelaxationType(LinearSolverParameters::AMG::SmootherType const &type)
Returns hypre's identifier of the AMG smoother type.
@ PMIS
Parallel coarsening algorithm using independent sets.
HYPRE_Int getAMGCoarseningType(LinearSolverParameters::AMG::CoarseningType const &type)
Returns hypre's identifier of the AMG coarsening type.
MGRInterpolationType
This enum class specifies the strategy for computing the level intepolation operator in MGR.
@ jacobi
Diagonal scaling.
MGRGlobalSmootherType
This enum class specifies the global smoother type.
@ none
no global smoothing is performed (default)
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
std::int32_t integer
Signed integer type.
Array< T, 1 > array1d
Alias for 1D array.
Container for hypre preconditioner auxiliary data for MGR.
HyprePrecWrapper mechSolver
MGR mechanics fine solver pointer and functions.
HyprePrecWrapper coarseSolver
MGR coarse solver pointer and functions.
array1d< HYPRE_Int > pointMarkers
array1d of unique tags for local degrees of freedom
Container for hypre preconditioner function pointers.
HYPRE_Solver ptr
pointer to preconditioner
SetupFunc setup
pointer to setup function
DestroyFunc destroy
pointer to destroy function
SolveFunc solve
pointer to apply function
@ modifiedExtendedE
Modularized extended+e (GPU support)
@ chebyshev
Chebyshev polynomial smoothing.
@ l1jacobi
l1-Jacobi smoothing
@ PMIS
Parallel coarsening as CLJP but with lower complexities (GPU support)
@ multipass
Multipass (GPU support)
@ modifiedExtendedE
Modularized Extended+e (GPU support)
Multigrid reduction parameters.
Set of parameters for a linear solver or preconditioner.