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 )
183 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
194 solver.
setup = HYPRE_BoomerAMGSetup;
195 solver.
solve = HYPRE_BoomerAMGSolve;
196 solver.
destroy = HYPRE_BoomerAMGDestroy;
212 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
222 solver.
setup = HYPRE_BoomerAMGSetup;
223 solver.
solve = HYPRE_BoomerAMGSolve;
224 solver.
destroy = HYPRE_BoomerAMGDestroy;
240 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
250 solver.
setup = HYPRE_BoomerAMGSetup;
251 solver.
solve = HYPRE_BoomerAMGSolve;
252 solver.
destroy = HYPRE_BoomerAMGDestroy;
266 integer const & separateComponents )
279 HYPRE_ILUCreate( &solver.
ptr );
282 int const ilu_type = 0;
283 int const max_iter = 1;
284 double const tol = 0.0;
285 int const reordering = 0;
286 int const print_level = 0;
287 HYPRE_ILUSetType( solver.
ptr, ilu_type );
288 HYPRE_ILUSetMaxIter( solver.
ptr, max_iter );
289 HYPRE_ILUSetTol( solver.
ptr, tol );
290 HYPRE_ILUSetLocalReordering( solver.
ptr, reordering );
291 HYPRE_ILUSetPrintLevel( solver.
ptr, print_level );
293 solver.
setup = HYPRE_ILUSetup;
294 solver.
solve = HYPRE_ILUSolve;
295 solver.
destroy = HYPRE_ILUDestroy;
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.
void setILUCoarseSolver(HyprePrecWrapper &solver)
MGRStrategyBase(HYPRE_Int const numBlocks)
Constructor.
void setPressureTemperatureAMG(HyprePrecWrapper &solver)
Set up BoomerAMG to perform the solve for the pressure/temperature system.
static constexpr HYPRE_Int numLevels
Number of levels.
stdVector< HYPRE_Int > m_labels[numLevels]
Dof labels kept at each level.
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)
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.
internal::StdVectorWrapper< T, Allocator, USE_STD_CONTAINER_BOUNDS_CHECKING > stdVector
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)
@ multipass
Multipass (GPU support)
@ modifiedExtendedE
Modularized Extended+e (GPU support)
Multigrid reduction parameters.
Set of parameters for a linear solver or preconditioner.