19 #ifndef GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRSTRATEGIES_HPP_
20 #define GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRSTRATEGIES_HPP_
28 #include <_hypre_utilities.h>
57 template<
typename STRATEGY >
63 STRATEGY strategy( numComponentsPerField );
64 strategy.setup( params, precond, mgrData );
71 template<
int NLEVEL >
106 for( HYPRE_Int i = 0; i <
numLevels; ++i )
121 for( HYPRE_Int i = 0; i <
numLevels; ++i )
139 for( HYPRE_Int i = 0; i <
numLevels; ++i )
178 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
188 solver.
setup = HYPRE_BoomerAMGSetup;
189 solver.
solve = HYPRE_BoomerAMGSolve;
190 solver.
destroy = HYPRE_BoomerAMGDestroy;
205 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
215 solver.
setup = HYPRE_BoomerAMGSetup;
216 solver.
solve = HYPRE_BoomerAMGSolve;
217 solver.
destroy = HYPRE_BoomerAMGDestroy;
233 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
243 solver.
setup = HYPRE_BoomerAMGSetup;
244 solver.
solve = HYPRE_BoomerAMGSolve;
245 solver.
destroy = HYPRE_BoomerAMGDestroy;
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.
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 setupLabels()
Call this after populating lv_cindexes.
HYPRE_Int m_levelFRelaxIters[numLevels]
Number of F-relaxation iterations for each level.
void setDisplacementAMG(HyprePrecWrapper &solver)
Set up BoomerAMG to perform the solve for the displacement system.
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.
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.
void setMechanicsFSolver(HyprePrecWrapper &precond, HypreMGRData &mgrData)
Set up BoomerAMG to perform the mechanics F-solve for the first F-relaxation.
#define GEOS_LAI_CHECK_ERROR(call)
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.
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.
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
@ chebyshev
Chebyshev polynomial smoothing.
@ l1jacobi
l1-Jacobi smoothing
@ PMIS
Parallel coarsening as CLJP but with lower complexities (GPU support)
Multigrid reduction parameters.
Set of parameters for a linear solver or preconditioner.