Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hypre improvements #3339

Merged
merged 49 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a5a9e9e
Update use of numeric_limits::max
victorapm Sep 6, 2024
6430518
Merge branch 'develop' into chore/paludettomag1/cuda-12-build
victorapm Sep 7, 2024
7a67fe2
Replace logic for performing SDC in GEOS with HYPRE_BoomerAMGSetFilte…
victorapm Sep 9, 2024
7c38493
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
victorapm Sep 20, 2024
60d1df7
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
victorapm Sep 21, 2024
2d438b1
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
victorapm Oct 1, 2024
9974de5
Add Unknowns and Nonzeros info to Linear Solver message
victorapm Oct 1, 2024
55dbfa6
Merge branch 'feature/paludettomag1/hypre-sdc' of github.com:GEOS-DEV…
victorapm Oct 1, 2024
1990070
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
victorapm Oct 4, 2024
b56dd05
Use GEOS_FMT
victorapm Oct 4, 2024
1af9315
Add missing coarse solver options
victorapm Oct 4, 2024
1529f6f
Remove unused code in GEOS regarding SDC approx.
victorapm Oct 4, 2024
0ecfdf3
Remove displacementFieldName since it became unused after SDC changes
victorapm Oct 4, 2024
08dd971
Update a few MGR parameters + add separateComponents as input paramet…
victorapm Oct 4, 2024
65db028
Merge branch 'feature/paludettomag1/hypre-sdc' of github.com:GEOS-DEV…
victorapm Oct 4, 2024
d64aae2
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
victorapm Oct 4, 2024
0cae3ff
Update TPL tag
victorapm Oct 4, 2024
ecfe53c
Turn on SDC approx. for fracture models
victorapm Oct 4, 2024
5c1b4d8
Uncrustify
victorapm Oct 4, 2024
eeeac10
Turn on SDC for contact mechanics models
victorapm Oct 4, 2024
4796996
Merge branch 'feature/paludettomag1/hypre-sdc' of github.com:GEOS-DEV…
victorapm Oct 4, 2024
237610e
Documentation fix
victorapm Oct 5, 2024
8837015
Add set_global_locale to allow for comma as thousands separator
victorapm Oct 5, 2024
fa9de90
Uncrustify
victorapm Oct 5, 2024
2aca888
Update style
victorapm Oct 5, 2024
ceb524c
Remove locale changes
victorapm Oct 5, 2024
032672a
Move addCommaSeparators to StringUtilities and use it in HYPRESolver.cpp
victorapm Oct 5, 2024
8c93309
Update schema files
victorapm Oct 5, 2024
a7be464
Uncrustify
victorapm Oct 5, 2024
dcb9ea2
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
victorapm Oct 21, 2024
df91543
Fix issues with SDC setup in BoomerAMG
victorapm Oct 22, 2024
bcc4639
Update TPL tag
victorapm Oct 22, 2024
e0bb7a8
Added missing SDC flag for poromechanics with wells
victorapm Oct 22, 2024
54c455c
Reset coarsest AMG level parameters
victorapm Oct 31, 2024
ac1fb3c
Update TPL tag
victorapm Oct 31, 2024
cde7e90
Uncrustify
victorapm Oct 31, 2024
d7f26f1
Merge branch 'feature/paludettomag1/hypre-sdc' of github.com:GEOS-DEV…
victorapm Oct 31, 2024
cc223c2
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
victorapm Nov 1, 2024
4a353e6
Use SDC for hydrofrac MGR strategy
victorapm Nov 1, 2024
44eb9b5
Better robustness and performance for MGR on GPUs
victorapm Nov 1, 2024
1237e99
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
victorapm Nov 7, 2024
6f853d7
Rebaseline
victorapm Nov 7, 2024
a850bd2
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
victorapm Nov 7, 2024
8a64a0a
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
CusiniM Nov 12, 2024
7c55c70
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
rrsettgast Nov 13, 2024
7f6b6ef
Update .integrated_tests.yaml
paveltomin Nov 14, 2024
baf55fc
Update BASELINE_NOTES.md
paveltomin Nov 14, 2024
362be85
LvArray update.
CusiniM Nov 14, 2024
bea64ed
Merge branch 'develop' into feature/paludettomag1/hypre-sdc
CusiniM Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,23 @@ void HypreInterface::initialize()
"OMP_NUM_THREADS > 1 may not be optimal for certain hypre preconditioning options. " );
#endif

HYPRE_Init();
HYPRE_Initialize();
#if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
HYPRE_SetExecutionPolicy( HYPRE_EXEC_DEVICE );
HYPRE_SetSpGemmUseVendor( 0 );
HYPRE_DeviceInitialize();
#endif
HYPRE_SetMemoryLocation( hypre::memoryLocation );
HYPRE_SetPrintErrorMode( 1 );

#if defined(HYPRE_USING_UMPIRE)
HYPRE_SetUmpireUMPoolName( "HYPRE_UM" );
HYPRE_SetUmpireHostPoolName( "HYPRE_HOST" );
HYPRE_SetUmpireDevicePoolName( "HYPRE_DEVICE" );
HYPRE_SetUmpirePinnedPoolName( "HYPRE_PINNED" );
#endif

HYPRE_SetLogLevel( getenv( "HYPRE_LOG_LEVEL" ) ? atoi( getenv( "HYPRE_LOG_LEVEL" ) ) : 0 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it be set by linear solver log level?

Copy link
Contributor Author

@victorapm victorapm Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I did this way because the information provided here is mainly for developers. Other libraries such as umpire and rocsparse work this way as well (using env variable). I am open to change the strategy here if needeed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds reasonable, thanks, no need to change

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not use environment variables please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove this. What is the issue with env vars again?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally don't like them. It's hard to keep track of who sets them. Also we don't really do it for anything else in GEOS.

Copy link
Contributor Author

@victorapm victorapm Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a place where it's being used:

int columns = getenv( "COLUMNS" ) ? atoi( getenv( "COLUMNS" )) : 120;

HYPRE_LOG_LEVEL is an option supposed to be used by developers only. It's very convenient to turn it on/off if it's a env var wrt a XML input. I don't see any harm with using env var specifically, but I'm happy to remove it if that's the best solution

}

void HypreInterface::finalize()
Expand Down
26 changes: 15 additions & 11 deletions src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ class MGRStrategyBase
MGRCoarseGridMethod m_levelCoarseGridMethod[numLevels]; ///< Coarse grid method for each level
MGRGlobalSmootherType m_levelGlobalSmootherType[numLevels]; ///< Global smoother type for each level
HYPRE_Int m_levelGlobalSmootherIters[numLevels]{ -1 }; ///< Number of global smoother iterations for each level
#if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CPU
HYPRE_Real m_coarseGridThreshold{ 1.0e-20 }; ///< Coarse grid truncation threshold
#else
HYPRE_Real m_coarseGridThreshold{ 0.0 }; ///< Coarse grid truncation threshold
#endif

// TODO: the following options are currently commented out in MGR's code.
// Let's consider their use when re-enable in hypre
Expand Down Expand Up @@ -167,21 +163,25 @@ class MGRStrategyBase
GEOS_LAI_CHECK_ERROR( HYPRE_MGRSetLevelSmoothIters( precond.ptr, m_levelGlobalSmootherIters ) );
GEOS_LAI_CHECK_ERROR( HYPRE_MGRSetTruncateCoarseGridThreshold( precond.ptr, m_coarseGridThreshold ) );
GEOS_LAI_CHECK_ERROR( HYPRE_MGRSetNonCpointsToFpoints( precond.ptr, 1 ));
GEOS_LAI_CHECK_ERROR( HYPRE_MGRSetNonGalerkinMaxElmts( precond.ptr, 1 ));
}

/**
* @brief Set up BoomerAMG to perform the solve for the displacement system
* @param solver the solver wrapper
*/
void setDisplacementAMG( HyprePrecWrapper & solver )
void setDisplacementAMG( HyprePrecWrapper & solver,
integer const & separateComponents )
{
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGCreate( &solver.ptr ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetTol( solver.ptr, 0.0 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxIter( solver.ptr, 1 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxRowSum( solver.ptr, 1.0 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetStrongThreshold( solver.ptr, 0.8 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetStrongThreshold( solver.ptr, 0.6 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetPrintLevel( solver.ptr, 0 ) );

GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMinCoarseSize( solver.ptr, 512 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetCycleRelaxType( solver.ptr, hypre::getAMGCoarseType( LinearSolverParameters::AMG::CoarseType::gsElimWPivoting ), 3 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetInterpType(solver.ptr, hypre::getAMGInterpolationType( LinearSolverParameters::AMG::InterpType::modifiedExtendedE )) );
#if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetCoarsenType( solver.ptr, hypre::getAMGCoarseningType( LinearSolverParameters::AMG::CoarseningType::PMIS ) ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetRelaxType( solver.ptr, hypre::getAMGRelaxationType( LinearSolverParameters::AMG::SmootherType::chebyshev ) ) );
Expand All @@ -191,6 +191,7 @@ class MGRStrategyBase
#endif

GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetNumFunctions( solver.ptr, 3 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetFilterFunctions( solver.ptr, separateComponents ) );

solver.setup = HYPRE_BoomerAMGSetup;
solver.solve = HYPRE_BoomerAMGSolve;
Expand All @@ -209,9 +210,11 @@ class MGRStrategyBase
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetAggNumLevels( solver.ptr, 1 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetAggPMaxElmts( solver.ptr, 16 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetTol( solver.ptr, 0.0 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMinCoarseSize( solver.ptr, 1024 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetCycleRelaxType( solver.ptr, 99, 3 ) );
#if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetAggNumLevels( solver.ptr, 0 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetCoarsenType( solver.ptr, toUnderlying( AMGCoarseningType::PMIS ) ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetAggInterpType( solver.ptr, hypre::getAMGAggressiveInterpolationType( LinearSolverParameters::AMG::AggInterpType::modifiedExtendedE ) ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetCoarsenType( solver.ptr, hypre::getAMGCoarseningType( LinearSolverParameters::AMG::CoarseningType::PMIS ) ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetRelaxType( solver.ptr, getAMGRelaxationType( LinearSolverParameters::AMG::SmootherType::l1jacobi ) ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetNumSweeps( solver.ptr, 2 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxRowSum( solver.ptr, 1.0 ) );
Expand Down Expand Up @@ -261,9 +264,10 @@ class MGRStrategyBase
* any other solver) for F-relaxation at any level
*/
void setMechanicsFSolver( HyprePrecWrapper & precond,
HypreMGRData & mgrData )
HypreMGRData & mgrData,
integer const & separateComponents )
{
setDisplacementAMG( mgrData.mechSolver );
setDisplacementAMG( mgrData.mechSolver, separateComponents );
HYPRE_MGRSetFSolver( precond.ptr, mgrData.mechSolver.solve, mgrData.mechSolver.setup, mgrData.mechSolver.ptr );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,32 +340,6 @@ void HyprePreconditioner::create( DofManager const * const dofManager )

HypreMatrix const & HyprePreconditioner::setupPreconditioningMatrix( HypreMatrix const & mat )
{
GEOS_MARK_FUNCTION;

if( m_params.preconditionerType == LinearSolverParameters::PreconditionerType::mgr && m_params.mgr.separateComponents )
{
GEOS_LAI_ASSERT_MSG( mat.dofManager() != nullptr, "MGR preconditioner requires a DofManager instance" );
HypreMatrix Pu;
HypreMatrix Auu;
{
Stopwatch timer( m_makeRestrictorTime );
mat.dofManager()->makeRestrictor( { { m_params.mgr.displacementFieldName, { 3, true } } }, mat.comm(), true, Pu );
}
{
Stopwatch timer( m_computeAuuTime );
mat.multiplyPtAP( Pu, Auu );
}
{
Stopwatch timer( m_componentFilterTime );
Auu.separateComponentFilter( m_precondMatrix, m_params.dofsPerNode );
}
}
else if( m_params.preconditionerType == LinearSolverParameters::PreconditionerType::amg && m_params.amg.separateComponents )
{
Stopwatch timer( m_componentFilterTime );
mat.separateComponentFilter( m_precondMatrix, m_params.dofsPerNode );
return m_precondMatrix;
}
return mat;
}

Expand All @@ -385,12 +359,6 @@ void HyprePreconditioner::setup( Matrix const & mat )
{
LvArray::system::FloatingPointExceptionGuard guard( FE_ALL_EXCEPT );

// Perform setup of the MGR mechanics F-solver with SDC matrix, if used
if( m_mgrData && m_mgrData->mechSolver.ptr && m_mgrData->mechSolver.setup )
{
// GEOS_LAI_CHECK_ERROR( m_mgrData->mechSolver.setup( m_mgrData->mechSolver.ptr, m_precondMatrix.unwrapped(), nullptr, nullptr ) );
}

// Perform setup of the main solver, if needed
if( m_precond->setup )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,26 +95,6 @@ class HyprePreconditioner final : public PreconditionerBase< HypreInterface >
*/
HyprePrecWrapper const & unwrapped() const;

/**
* @brief @return time spent setting up separate component matrix.
*/
real64 componentFilterTime() const
{
return m_componentFilterTime;
}

/// @return time to construct restrictor matrix.
real64 makeRestrictorTime() const
{
return m_makeRestrictorTime;
}

/// @return time to apply restrictor matrix.
real64 computeAuuTime() const
{
return m_computeAuuTime;
}

private:

/**
Expand Down Expand Up @@ -144,15 +124,6 @@ class HyprePreconditioner final : public PreconditionerBase< HypreInterface >

/// Null space vectors
std::unique_ptr< HypreNullSpace > m_nullSpace;

/// Timing of separate component matrix construction
real64 m_componentFilterTime = 0.0;

/// Timing of the restrictor matrix construction
real64 m_makeRestrictorTime = 0.0;

/// Timing of the cost of applying the restrictor matrix to the system
real64 m_computeAuuTime = 0.0;
};

}
Expand Down
23 changes: 11 additions & 12 deletions src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,7 @@ void HypreSolver::setup( HypreMatrix const & mat )
clear();
Base::setup( mat );
Stopwatch timer( m_result.setupTime );

m_precond.setup( mat );
m_componentFilterTime = m_precond.componentFilterTime();
m_makeRestrictorTime = m_precond.makeRestrictorTime();
m_computeAuuTime = m_precond.computeAuuTime();

m_solver = std::make_unique< HypreSolverWrapper >();
createHypreKrylovSolver( m_params, mat.comm(), *m_solver );
Expand Down Expand Up @@ -276,14 +272,17 @@ void HypreSolver::solve( HypreVector const & rhs,

if( m_params.logLevel >= 1 )
{
GEOS_LOG_RANK_0( " Linear Solver | " << m_result.status <<
" | Iterations: " << m_result.numIterations <<
" | Final Rel Res: " << m_result.residualReduction <<
" | Make Restrictor Time: " << m_makeRestrictorTime <<
" | Compute Auu Time: " << m_computeAuuTime <<
" | SC Filter Time: " << m_componentFilterTime <<
" | Setup Time: " << m_result.setupTime << " s" <<
" | Solve Time: " << m_result.solveTime << " s" );
HYPRE_BigInt global_num_rows, global_num_nonzeros;

// This involves an MPI collective call, and therefore we call it only when necessary
GEOS_LAI_CHECK_ERROR( HYPRE_IJMatrixGetGlobalInfo( matrix().unwrappedIJ(),
&global_num_rows,
&global_num_rows, // This is intentional and assuming the matrix is square
&global_num_nonzeros) );

GEOS_LOG_RANK_0( GEOS_FMT( " Linear Solver | {} | Unknowns: {} | Nonzeros: {} | Iterations: {} | Final Rel Res: {:.4e} | Setup Time: {:.3f} s | Solve Time: {:.3f} s",
m_result.status, global_num_rows, global_num_nonzeros, m_result.numIterations,
m_result.residualReduction, m_result.setupTime, m_result.solveTime ) );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ class HypreSolver final : public LinearSolverBase< HypreInterface >

/// Pointers to hypre functions for the krylov solver
std::unique_ptr< HypreSolverWrapper > m_solver;

/// Time of the most recent SC matrix construction
real64 m_componentFilterTime;
real64 m_makeRestrictorTime;
real64 m_computeAuuTime;
};

} // end geos namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ inline HYPRE_Int getAMGCoarseType( LinearSolverParameters::AMG::CoarseType const
{ LinearSolverParameters::AMG::CoarseType::direct, 9 },
{ LinearSolverParameters::AMG::CoarseType::chebyshev, 16 },
{ LinearSolverParameters::AMG::CoarseType::l1jacobi, 18 },
{ LinearSolverParameters::AMG::CoarseType::gsElimWPivoting, 99 },
{ LinearSolverParameters::AMG::CoarseType::gsElimWInverse, 199 },
};
return findOption( typeMap, type, "multigrid coarse solver", "HyprePreconditioner" );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ class HybridSinglePhasePoromechanics : public MGRStrategyBase< 2 >

/**
* @brief Setup the MGR strategy.
* @param mgrParams MGR configuration parameters
* @param precond preconditioner wrapper
* @param mgrData auxiliary MGR data
*/
void setup( LinearSolverParameters::MGR const &,
void setup( LinearSolverParameters::MGR const & mgrParams,
HyprePrecWrapper & precond,
HypreMGRData & mgrData )
{
Expand All @@ -96,7 +97,7 @@ class HybridSinglePhasePoromechanics : public MGRStrategyBase< 2 >
GEOS_LAI_CHECK_ERROR( HYPRE_MGRSetPMaxElmts( precond.ptr, 0 ));

// Configure the BoomerAMG solver used as F-relaxation for the first level
setMechanicsFSolver( precond, mgrData );
setMechanicsFSolver( precond, mgrData, mgrParams.separateComponents );

// Configure the BoomerAMG solver used as mgr coarse solver for the pressure reduced system
setPressureAMG( mgrData.coarseSolver );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,18 @@ class Hydrofracture : public MGRStrategyBase< 1 >

/**
* @brief Setup the MGR strategy.
* @param mgrParams MGR configuration parameters
* @param precond preconditioner wrapper
* @param mgrData auxiliary MGR data
*/
void setup( LinearSolverParameters::MGR const &,
void setup( LinearSolverParameters::MGR const & mgrParams,
HyprePrecWrapper & precond,
HypreMGRData & mgrData )
{
setReduction( precond, mgrData );

// Configure the BoomerAMG solver used as F-relaxation for the first level
setMechanicsFSolver( precond, mgrData );
setMechanicsFSolver( precond, mgrData, mgrParams.separateComponents );

// Configure the BoomerAMG solver used as mgr coarse solver for the pressure reduced system
setPressureAMG( mgrData.coarseSolver );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ class LagrangianContactMechanics : public MGRStrategyBase< 1 >
* @param precond preconditioner wrapper
* @param mgrData auxiliary MGR data
*/
void setup( LinearSolverParameters::MGR const &,
void setup( LinearSolverParameters::MGR const & mgrParams,
HyprePrecWrapper & precond,
HypreMGRData & mgrData )
{
setReduction( precond, mgrData );

// Configure the BoomerAMG solver used as mgr coarse solver for the displacement reduced system
// (note that no separate displacement component approach is used here)
setDisplacementAMG( mgrData.coarseSolver );
setDisplacementAMG( mgrData.coarseSolver, mgrParams.separateComponents );
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ class MultiphasePoromechanics : public MGRStrategyBase< 3 >
setupLabels();

// Level 0
m_levelFRelaxType[0] = MGRFRelaxationType::amgVCycle;
m_levelFRelaxIters[0] = 1;
m_levelInterpType[0] = MGRInterpolationType::jacobi;
m_levelRestrictType[0] = MGRRestrictionType::injection;
m_levelCoarseGridMethod[0] = MGRCoarseGridMethod::nonGalerkin;
m_levelGlobalSmootherType[0] = MGRGlobalSmootherType::none;
m_levelFRelaxType[0] = MGRFRelaxationType::amgVCycle;
m_levelFRelaxIters[0] = 1;
m_levelInterpType[0] = MGRInterpolationType::jacobi;
m_levelRestrictType[0] = MGRRestrictionType::injection;
m_levelCoarseGridMethod[0] = MGRCoarseGridMethod::nonGalerkin;
m_levelGlobalSmootherType[0] = MGRGlobalSmootherType::none;

// Level 1
m_levelFRelaxType[1] = MGRFRelaxationType::jacobi;
m_levelFRelaxIters[1] = 1;
m_levelInterpType[1] = MGRInterpolationType::jacobi;
m_levelRestrictType[1] = MGRRestrictionType::injection;
m_levelCoarseGridMethod[1] = MGRCoarseGridMethod::galerkin;
m_levelGlobalSmootherType[1] = MGRGlobalSmootherType::none;
m_levelFRelaxType[1] = MGRFRelaxationType::jacobi;
m_levelFRelaxIters[1] = 1;
m_levelInterpType[1] = MGRInterpolationType::jacobi;
m_levelRestrictType[1] = MGRRestrictionType::injection;
m_levelCoarseGridMethod[1] = MGRCoarseGridMethod::galerkin;
m_levelGlobalSmootherType[1] = MGRGlobalSmootherType::none;

// Level 2
m_levelFRelaxType[2] = MGRFRelaxationType::none;
Expand All @@ -98,17 +98,18 @@ class MultiphasePoromechanics : public MGRStrategyBase< 3 >

/**
* @brief Setup the MGR strategy.
* @param mgrParams MGR configuration parameters
* @param precond preconditioner wrapper
* @param mgrData auxiliary MGR data
*/
void setup( LinearSolverParameters::MGR const &,
void setup( LinearSolverParameters::MGR const & mgrParams,
HyprePrecWrapper & precond,
HypreMGRData & mgrData )
{
setReduction( precond, mgrData );

// Configure the BoomerAMG solver used as F-relaxation for the first level
setMechanicsFSolver( precond, mgrData );
setMechanicsFSolver( precond, mgrData, mgrParams.separateComponents );

// Configure the BoomerAMG solver used as mgr coarse solver for the pressure reduced system
setPressureAMG( mgrData.coarseSolver );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class MultiphasePoromechanicsReservoirFVM : public MGRStrategyBase< 4 >

/**
* @brief Setup the MGR strategy.
* @param mgrParams parameters for the configuration of the MGR recipe
* @param mgrParams MGR configuration parameters
* @param precond preconditioner wrapper
* @param mgrData auxiliary MGR data
*/
Expand All @@ -136,7 +136,7 @@ class MultiphasePoromechanicsReservoirFVM : public MGRStrategyBase< 4 >
setReduction( precond, mgrData );

// Configure the BoomerAMG solver used as F-relaxation for the first level
setMechanicsFSolver( precond, mgrData );
setMechanicsFSolver( precond, mgrData, mgrParams.separateComponents );

// Configure the BoomerAMG solver used as mgr coarse solver for the pressure reduced system
setPressureAMG( mgrData.coarseSolver );
Expand Down
Loading
Loading