diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5757d8230fa..216993fba02 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "build": { "dockerfile": "Dockerfile", "args": { - "GEOS_TPL_TAG": "284-535" + "GEOS_TPL_TAG": "286-547" } }, "runArgs": [ diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index 94c95c593c7..00502a919e4 100644 --- a/.integrated_tests.yaml +++ b/.integrated_tests.yaml @@ -1,6 +1,6 @@ baselines: bucket: geosx - baseline: integratedTests/baseline_integratedTests-pr3434-8663-1be8ad2 + baseline: integratedTests/baseline_integratedTests-pr3339-8707-7c55c70 allow_fail: all: '' streak: '' diff --git a/BASELINE_NOTES.md b/BASELINE_NOTES.md index 5c416ca2820..f4dcac6a76e 100644 --- a/BASELINE_NOTES.md +++ b/BASELINE_NOTES.md @@ -6,6 +6,11 @@ This file is designed to track changes to the integrated test baselines. Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining. These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD). + +PR #3339 (2024-11-14) +===================== +Hypre improvements, rebaseline is due to field value change (amgNumFunctions). + PR #3434 (2024-11-09) ===================== Bugfix: Fixed output of ArrayOfArray objects to restart files. diff --git a/src/coreComponents/LvArray b/src/coreComponents/LvArray index c9d97b4676d..9b1c0049497 160000 --- a/src/coreComponents/LvArray +++ b/src/coreComponents/LvArray @@ -1 +1 @@ -Subproject commit c9d97b4676d47d1da7d2a63a1a5cbf31f7b54965 +Subproject commit 9b1c00494974c73ff38f8590f010f624efe9964c diff --git a/src/coreComponents/common/format/StringUtilities.cpp b/src/coreComponents/common/format/StringUtilities.cpp index cd13ba3919e..83afce1cf87 100644 --- a/src/coreComponents/common/format/StringUtilities.cpp +++ b/src/coreComponents/common/format/StringUtilities.cpp @@ -73,6 +73,29 @@ string removeStringAndFollowingContent( string_view const str, return string( newStr ); } +// Add comma separators for thousands +template< typename T > +string addCommaSeparators( T const & num ) +{ + static_assert( std::is_integral< T >::value, "addCommaSeparators only supports integral types" ); + + string const numStr = std::to_string( num ); + string result; + + for( std::size_t i = 0; i < numStr.size(); ++i ) + { + result += numStr[i]; + if((numStr.size() - i - 1) % 3 == 0 && i != numStr.size() - 1 ) + { + result += ","; + } + } + return result; +} + +template string addCommaSeparators( localIndex const & num ); +template string addCommaSeparators( globalIndex const & num ); + // put definition here so we can control the allowable values of T and // modication of this function triggers a whole code recompile...which // should be avoided. diff --git a/src/coreComponents/common/format/StringUtilities.hpp b/src/coreComponents/common/format/StringUtilities.hpp index 8f083816c86..b98f03afef9 100644 --- a/src/coreComponents/common/format/StringUtilities.hpp +++ b/src/coreComponents/common/format/StringUtilities.hpp @@ -227,6 +227,15 @@ string_view trimSpaces( string_view str ); string removeStringAndFollowingContent( string_view str, string_view strToRemove ); +/** + * @brief Add comma separators to an integral number for readability. + * @tparam T the integral type of the number to format. + * @param[in] num the integral number to format. + * @return a string representation of the number with comma separators. + */ +template< typename T > +string addCommaSeparators( T const & num ); + /** * @brief Take a string, and return a array1d with the cast values * @tparam T the type to which the string will be cast diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreInterface.cpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreInterface.cpp index 5b056df8de7..70591e59973 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreInterface.cpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreInterface.cpp @@ -40,12 +40,19 @@ namespace geos void HypreInterface::initialize() { -#ifdef GEOS_USE_OPENMP - GEOS_LOG_RANK_0_IF( omp_get_max_threads()>1, - "OMP_NUM_THREADS > 1 may not be optimal for certain hypre preconditioning options. " ); +#if defined(GEOS_USE_OPENMP) && defined(HYPRE_USING_OPENMP) + GEOS_LOG_RANK_0_IF( omp_get_max_threads() > 1, + "\n" + "********************************************************************\n" + "* *\n" + "* WARNING: OMP_NUM_THREADS > 1 MAY NOT BE OPTIMAL FOR CERTAIN *\n" + "* HYPRE PRECONDITIONING OPTIONS! *\n" + "* *\n" + "********************************************************************\n" + ); #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 ); @@ -53,6 +60,15 @@ void HypreInterface::initialize() #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 ); } void HypreInterface::finalize() diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp index eef5b70b45b..feca89dd6d0 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp @@ -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 @@ -167,21 +163,24 @@ 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 + * @param separateComponents flag controlling the use of the separate displacement component (SDC) approximation */ - 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_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 ) ) ); @@ -191,6 +190,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; @@ -207,11 +207,12 @@ class MGRStrategyBase GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetPrintLevel( solver.ptr, 0 ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxIter( solver.ptr, 1 ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetAggNumLevels( solver.ptr, 1 ) ); - GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetAggPMaxElmts( solver.ptr, 16 ) ); + GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetAggPMaxElmts( solver.ptr, 20 ) ); + GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetAggInterpType( solver.ptr, hypre::getAMGAggressiveInterpolationType( LinearSolverParameters::AMG::AggInterpType::multipass ) ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetTol( solver.ptr, 0.0 ) ); #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 ) ); @@ -256,14 +257,16 @@ class MGRStrategyBase * @brief Set up BoomerAMG to perform the mechanics F-solve for the first F-relaxation * @param precond the preconditioner wrapper * @param mgrData auxiliary MGR data + * @param separateComponents flag controlling the use of the separate displacement component (SDC) approximation * * @note This function should be rethought once MGR allows for customizing boomerAMG (or * 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 ); } diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HyprePreconditioner.cpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HyprePreconditioner.cpp index cd4bc6321e9..0d76b175eab 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HyprePreconditioner.cpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HyprePreconditioner.cpp @@ -88,7 +88,6 @@ void createAMG( LinearSolverParameters const & params, GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetTol( precond.ptr, 0.0 ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxIter( precond.ptr, 1 ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetPrintLevel( precond.ptr, logLevel ) ); - GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetNumFunctions( precond.ptr, params.dofsPerNode ) ); // Set maximum number of multigrid levels (default 25) GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxLevels( precond.ptr, LvArray::integerConversion< HYPRE_Int >( params.amg.maxLevels ) ) ); @@ -174,7 +173,9 @@ void createAMG( LinearSolverParameters const & params, GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetPMaxElmts( precond.ptr, params.amg.interpolationMaxNonZeros ) ); } + // Unknown-based AMG parameters GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetNumFunctions( precond.ptr, params.amg.numFunctions ) ); + GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetFilterFunctions( precond.ptr, params.amg.separateComponents ) ); if( params.amg.aggressiveNumLevels ) { @@ -340,32 +341,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; } @@ -385,12 +360,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 ) { diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HyprePreconditioner.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HyprePreconditioner.hpp index 1f13028f4e1..ee7382f8ae3 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HyprePreconditioner.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HyprePreconditioner.hpp @@ -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: /** @@ -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; }; } diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.cpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.cpp index e882d55faba..a3f87354ed6 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.cpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.cpp @@ -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 ); @@ -276,14 +272,18 @@ 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, stringutilities::addCommaSeparators( global_num_rows ), + stringutilities::addCommaSeparators( global_num_nonzeros ), m_result.numIterations, + m_result.residualReduction, m_result.setupTime, m_result.solveTime ) ); } } diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.hpp index 40364992a06..7cc8c5b5738 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.hpp @@ -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 diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreUtils.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreUtils.hpp index a205fe074c7..a309557dd81 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreUtils.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreUtils.hpp @@ -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" ); } diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/HybridSinglePhasePoromechanics.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/HybridSinglePhasePoromechanics.hpp index f79ad85fb27..687be08785a 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/HybridSinglePhasePoromechanics.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/HybridSinglePhasePoromechanics.hpp @@ -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 ) { @@ -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 ); diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/Hydrofracture.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/Hydrofracture.hpp index faf44e8adaf..6983d364a89 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/Hydrofracture.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/Hydrofracture.hpp @@ -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 ); diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/LagrangianContactMechanics.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/LagrangianContactMechanics.hpp index 2ad38a87132..68dd3e5c837 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/LagrangianContactMechanics.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/LagrangianContactMechanics.hpp @@ -76,10 +76,11 @@ class LagrangianContactMechanics : 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 ) { @@ -87,7 +88,7 @@ class LagrangianContactMechanics : public MGRStrategyBase< 1 > // 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 ); } }; diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanics.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanics.hpp index dcbe732e90e..cfeca18d3f1 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanics.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanics.hpp @@ -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; @@ -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 ); diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp index 69038faa599..18293db1f12 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp @@ -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 */ @@ -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 ); diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanics.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanics.hpp index 6a4994b90a7..da9b9b8e2d8 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanics.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanics.hpp @@ -70,17 +70,18 @@ class SinglePhasePoromechanics : 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 ); diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsReservoirFVM.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsReservoirFVM.hpp index 26b054f9a2d..88be6a13d9b 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsReservoirFVM.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsReservoirFVM.hpp @@ -85,17 +85,18 @@ class SinglePhasePoromechanicsReservoirFVM : 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 ) { 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 ); diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SolidMechanicsEmbeddedFractures.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SolidMechanicsEmbeddedFractures.hpp index 7da6fb6229f..52324cc6ba1 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SolidMechanicsEmbeddedFractures.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SolidMechanicsEmbeddedFractures.hpp @@ -75,17 +75,18 @@ class SolidMechanicsEmbeddedFractures : 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 mgr coarse solver for the displacement reduced system - setDisplacementAMG( mgrData.coarseSolver ); + setDisplacementAMG( mgrData.coarseSolver, mgrParams.separateComponents ); } }; diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalMultiphasePoromechanics.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalMultiphasePoromechanics.hpp index 129e2b4abd0..1abf2f77d94 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalMultiphasePoromechanics.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalMultiphasePoromechanics.hpp @@ -75,20 +75,20 @@ class ThermalMultiphasePoromechanics : 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; @@ -101,18 +101,18 @@ class ThermalMultiphasePoromechanics : 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 ); - // CHECK: the mechanics solver setup was missing: was there a reason? // 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/temperature reduced system setPressureTemperatureAMG( mgrData.coarseSolver ); diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalSinglePhasePoromechanics.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalSinglePhasePoromechanics.hpp index af5889fc7cd..d14919e57ee 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalSinglePhasePoromechanics.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalSinglePhasePoromechanics.hpp @@ -72,18 +72,18 @@ class ThermalSinglePhasePoromechanics : 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 ); - // CHECK: the mechanics solver setup was missing: was there a reason? // 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/temperature reduced system setPressureTemperatureAMG( mgrData.coarseSolver ); diff --git a/src/coreComponents/linearAlgebra/utilities/LinearSolverParameters.hpp b/src/coreComponents/linearAlgebra/utilities/LinearSolverParameters.hpp index 3c47e40e370..cd0aecfc572 100644 --- a/src/coreComponents/linearAlgebra/utilities/LinearSolverParameters.hpp +++ b/src/coreComponents/linearAlgebra/utilities/LinearSolverParameters.hpp @@ -118,7 +118,7 @@ struct LinearSolverParameters real64 relTolerance = 1e-6; ///< Relative convergence tolerance for iterative solvers integer maxIterations = 200; ///< Max iterations before declaring convergence failure #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP - integer maxRestart = 50; ///< Max number of vectors in Krylov basis before restarting (GPUs) + integer maxRestart = 100; ///< Max number of vectors in Krylov basis before restarting (GPUs) #else integer maxRestart = 200; ///< Max number of vectors in Krylov basis before restarting (CPUs) #endif @@ -184,7 +184,9 @@ struct LinearSolverParameters l1sgs, ///< l1-Symmetric Gauss-Seidel chebyshev, ///< Chebyshev polynomial (GPU support in hypre) direct, ///< Direct solver as preconditioner - bgs ///< Gauss-Seidel smoothing (backward sweep) + bgs, ///< Gauss-Seidel smoothing (backward sweep) + gsElimWPivoting, ///< Gaussian Elimination with pivoting direct solver + gsElimWInverse ///< Direct inverse with Gaussian Elimination }; /// AMG coarsening types (HYPRE only) @@ -298,9 +300,8 @@ struct LinearSolverParameters StrategyType strategy = StrategyType::invalid; ///< Predefined MGR solution strategy (solver specific) integer separateComponents = false; ///< Apply a separate displacement component (SDC) filter before AMG construction - string displacementFieldName; ///< Displacement field name need for SDC filter - integer areWellsShut = false; ///< Flag to let MGR know that wells are shut, and that jacobi can be applied to the - ///< well block + integer areWellsShut = false; ///< Flag to let MGR know that wells are shut, and that jacobi can be applied to the + ///< well block } mgr; ///< Multigrid reduction (MGR) parameters @@ -424,7 +425,9 @@ ENUM_STRINGS( LinearSolverParameters::AMG::CoarseType, "l1sgs", "chebyshev", "direct", - "bgs" ); + "bgs", + "gsElimWPivoting", + "gsElimWInverse" ); /// Declare strings associated with enumeration values. ENUM_STRINGS( LinearSolverParameters::AMG::CoarseningType, diff --git a/src/coreComponents/mesh/DomainPartition.cpp b/src/coreComponents/mesh/DomainPartition.cpp index 0dd8a8a3623..9604c30932c 100644 --- a/src/coreComponents/mesh/DomainPartition.cpp +++ b/src/coreComponents/mesh/DomainPartition.cpp @@ -328,24 +328,8 @@ void DomainPartition::outputPartitionInformation() const return std::make_pair( objectManager.getNumberOfLocalIndices(), objectManager.getNumberOfGhosts() ); }; - auto addCommaSeparators = []( localIndex const num ) - { - std::string const numStr = std::to_string( num ); - std::string result; - for( std::size_t i = 0; i < numStr.size(); ++i ) - { - result += numStr[i]; - if( ( numStr.size() - i - 1 ) % 3 == 0 && i != numStr.size() - 1 ) - { - result += ","; - } - } - return result; - }; - GEOS_LOG_RANK_0( "MPI Partition information:" ); - forMeshBodies( [&]( MeshBody const & meshBody ) { meshBody.getMeshLevels().forSubGroupsIndex< MeshLevel >( [&]( int const level, MeshLevel const & meshLevel ) @@ -427,24 +411,24 @@ void DomainPartition::outputPartitionInformation() const GEOS_LOG_RANK_0( GEOS_FMT( " | min | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} |", - addCommaSeparators( minNumLocalNodes ), - addCommaSeparators( minNumGhostNodes ), - addCommaSeparators( minNumLocalEdges ), - addCommaSeparators( minNumGhostEdges ), - addCommaSeparators( minNumLocalFaces ), - addCommaSeparators( minNumGhostFaces ), - addCommaSeparators( minNumLocalElems ), - addCommaSeparators( minNumGhostElems ) ) ); + stringutilities::addCommaSeparators( minNumLocalNodes ), + stringutilities::addCommaSeparators( minNumGhostNodes ), + stringutilities::addCommaSeparators( minNumLocalEdges ), + stringutilities::addCommaSeparators( minNumGhostEdges ), + stringutilities::addCommaSeparators( minNumLocalFaces ), + stringutilities::addCommaSeparators( minNumGhostFaces ), + stringutilities::addCommaSeparators( minNumLocalElems ), + stringutilities::addCommaSeparators( minNumGhostElems ) ) ); GEOS_LOG_RANK_0( GEOS_FMT( " | max | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} |", - addCommaSeparators( maxNumLocalNodes ), - addCommaSeparators( maxNumGhostNodes ), - addCommaSeparators( maxNumLocalEdges ), - addCommaSeparators( maxNumGhostEdges ), - addCommaSeparators( maxNumLocalFaces ), - addCommaSeparators( maxNumGhostFaces ), - addCommaSeparators( maxNumLocalElems ), - addCommaSeparators( maxNumGhostElems ) ) ); + stringutilities::addCommaSeparators( maxNumLocalNodes ), + stringutilities::addCommaSeparators( maxNumGhostNodes ), + stringutilities::addCommaSeparators( maxNumLocalEdges ), + stringutilities::addCommaSeparators( maxNumGhostEdges ), + stringutilities::addCommaSeparators( maxNumLocalFaces ), + stringutilities::addCommaSeparators( maxNumGhostFaces ), + stringutilities::addCommaSeparators( maxNumLocalElems ), + stringutilities::addCommaSeparators( maxNumGhostElems ) ) ); GEOS_LOG_RANK_0( " |------------------------------------------------------------------------------------------------------------------------------------------------|" ); @@ -456,14 +440,14 @@ void DomainPartition::outputPartitionInformation() const { GEOS_LOG( GEOS_FMT( " | {:14} | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} | {:>13} | ", rank, - addCommaSeparators( numLocalNodes ), - addCommaSeparators( numGhostNodes ), - addCommaSeparators( numLocalEdges ), - addCommaSeparators( numGhostEdges ), - addCommaSeparators( numLocalFaces ), - addCommaSeparators( numGhostFaces ), - addCommaSeparators( numLocalElems ), - addCommaSeparators( numGhostElems ) ) ); + stringutilities::addCommaSeparators( numLocalNodes ), + stringutilities::addCommaSeparators( numGhostNodes ), + stringutilities::addCommaSeparators( numLocalEdges ), + stringutilities::addCommaSeparators( numGhostEdges ), + stringutilities::addCommaSeparators( numLocalFaces ), + stringutilities::addCommaSeparators( numGhostFaces ), + stringutilities::addCommaSeparators( numLocalElems ), + stringutilities::addCommaSeparators( numGhostElems ) ) ); } MpiWrapper::barrier(); } diff --git a/src/coreComponents/physicsSolvers/contact/SolidMechanicsAugmentedLagrangianContact.cpp b/src/coreComponents/physicsSolvers/contact/SolidMechanicsAugmentedLagrangianContact.cpp index 6ace1301164..fee37cee7b9 100644 --- a/src/coreComponents/physicsSolvers/contact/SolidMechanicsAugmentedLagrangianContact.cpp +++ b/src/coreComponents/physicsSolvers/contact/SolidMechanicsAugmentedLagrangianContact.cpp @@ -44,15 +44,14 @@ SolidMechanicsAugmentedLagrangianContact::SolidMechanicsAugmentedLagrangianConta m_faceTypeToFiniteElements["Quadrilateral"] = std::make_unique< finiteElement::H1_QuadrilateralFace_Lagrange1_GaussLegendre2 >(); m_faceTypeToFiniteElements["Triangle"] = std::make_unique< finiteElement::H1_TriangleFace_Lagrange1_Gauss1 >(); + LinearSolverParameters & linParams = m_linearSolverParameters.get(); addLogLevel< logInfo::Configuration >(); + linParams.isSymmetric = true; + linParams.dofsPerNode = 3; + linParams.mgr.separateComponents = true; // TODO Implement the MGR strategy - - // Set the default linear solver parameters - //LinearSolverParameters & linParams = m_linearSolverParameters.get(); - //linParams.dofsPerNode = 3; - //linParams.isSymmetric = true; - //linParams.amg.separateComponents = true; + //linParams.mgr.strategy = LinearSolverParameters::MGR::StrategyType::solidMechanicsAugumentedLagrangianContact; } SolidMechanicsAugmentedLagrangianContact::~SolidMechanicsAugmentedLagrangianContact() diff --git a/src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp b/src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp index 0beb4428f2b..65584046e5c 100644 --- a/src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp +++ b/src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbeddedFractures.cpp @@ -68,15 +68,16 @@ void SolidMechanicsEmbeddedFractures::postInputInitialization() LinearSolverParameters & linParams = m_linearSolverParameters.get(); + linParams.dofsPerNode = 3; if( m_useStaticCondensation ) { - linParams.dofsPerNode = 3; linParams.isSymmetric = true; linParams.amg.separateComponents = true; } else { linParams.mgr.strategy = LinearSolverParameters::MGR::StrategyType::solidMechanicsEmbeddedFractures; + linParams.mgr.separateComponents = true; } } diff --git a/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp b/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp index 08d5fec172e..003ed8cb7f7 100644 --- a/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp +++ b/src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp @@ -77,7 +77,6 @@ SolidMechanicsLagrangeContact::SolidMechanicsLagrangeContact( const string & nam LinearSolverParameters & linSolParams = m_linearSolverParameters.get(); linSolParams.mgr.strategy = LinearSolverParameters::MGR::StrategyType::lagrangianContactMechanics; linSolParams.mgr.separateComponents = true; - linSolParams.mgr.displacementFieldName = solidMechanics::totalDisplacement::key(); linSolParams.dofsPerNode = 3; } diff --git a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp index 9cb0333497d..560569a8b63 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp @@ -77,10 +77,15 @@ void CompositionalMultiphaseReservoirAndWells<>:: setMGRStrategy() { + LinearSolverParameters & linearSolverParameters = this->m_linearSolverParameters.get(); + + linearSolverParameters.mgr.separateComponents = true; + linearSolverParameters.dofsPerNode = 3; + if( flowSolver()->getLinearSolverParameters().mgr.strategy == LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseHybridFVM ) { // add Reservoir - m_linearSolverParameters.get().mgr.strategy = LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseReservoirHybridFVM; + linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseReservoirHybridFVM; } else if( isThermal() ) { @@ -90,7 +95,7 @@ setMGRStrategy() else { // add Reservoir - m_linearSolverParameters.get().mgr.strategy = LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseReservoirFVM; + linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseReservoirFVM; } } @@ -99,6 +104,11 @@ void CompositionalMultiphaseReservoirAndWells< MultiphasePoromechanics<> >:: setMGRStrategy() { + LinearSolverParameters & linearSolverParameters = this->m_linearSolverParameters.get(); + + linearSolverParameters.mgr.separateComponents = true; + linearSolverParameters.dofsPerNode = 3; + // flow solver here is indeed flow solver, not poromechanics solver if( flowSolver()->getLinearSolverParameters().mgr.strategy == LinearSolverParameters::MGR::StrategyType::compositionalMultiphaseHybridFVM ) { @@ -107,7 +117,7 @@ setMGRStrategy() else { // add Reservoir - m_linearSolverParameters.get().mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanicsReservoirFVM; + linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanicsReservoirFVM; } } diff --git a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp index d3322e839ff..61529778ea6 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp @@ -84,8 +84,7 @@ HydrofractureSolver< POROMECHANICS_SOLVER >::HydrofractureSolver( const string & // This may need to be different depending on whether poroelasticity is on or not. m_linearSolverParameters.get().mgr.strategy = LinearSolverParameters::MGR::StrategyType::hydrofracture; - m_linearSolverParameters.get().mgr.separateComponents = false; - m_linearSolverParameters.get().mgr.displacementFieldName = solidMechanics::totalDisplacement::key(); + m_linearSolverParameters.get().mgr.separateComponents = true; m_linearSolverParameters.get().dofsPerNode = 3; } diff --git a/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp b/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp index 4d1e0114728..c477f2b83d3 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp @@ -49,7 +49,6 @@ MultiphasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::MultiphasePoromechanic LinearSolverParameters & linearSolverParameters = this->m_linearSolverParameters.get(); linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanics; linearSolverParameters.mgr.separateComponents = true; - linearSolverParameters.mgr.displacementFieldName = solidMechanics::totalDisplacement::key(); linearSolverParameters.dofsPerNode = 3; } diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp index 46233badae0..8026c45a80a 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp @@ -49,7 +49,6 @@ SinglePhasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::SinglePhasePoromechan LinearSolverParameters & linearSolverParameters = this->m_linearSolverParameters.get(); linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanics; linearSolverParameters.mgr.separateComponents = true; - linearSolverParameters.mgr.displacementFieldName = solidMechanics::totalDisplacement::key(); linearSolverParameters.dofsPerNode = 3; } diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp index 77bbc8fdeab..a2a258ac5bc 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp @@ -47,8 +47,7 @@ SinglePhasePoromechanicsConformingFractures< FLOW_SOLVER >::SinglePhasePoromecha { LinearSolverParameters & params = this->m_linearSolverParameters.get(); params.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanicsConformingFractures; - params.mgr.separateComponents = false; - params.mgr.displacementFieldName = solidMechanics::totalDisplacement::key(); + params.mgr.separateComponents = true; params.dofsPerNode = 3; } diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp index 67aa66cb051..394b95d08d3 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp @@ -44,8 +44,7 @@ SinglePhasePoromechanicsEmbeddedFractures::SinglePhasePoromechanicsEmbeddedFract { LinearSolverParameters & params = m_linearSolverParameters.get(); params.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanicsEmbeddedFractures; - params.mgr.separateComponents = false; - params.mgr.displacementFieldName = solidMechanics::totalDisplacement::key(); + params.mgr.separateComponents = true; params.dofsPerNode = 3; } diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp index c2f1cff9940..17f7f3517f6 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp @@ -133,6 +133,7 @@ void SolidMechanicsLagrangianFEM::postInputInitialization() LinearSolverParameters & linParams = m_linearSolverParameters.get(); linParams.isSymmetric = true; linParams.dofsPerNode = 3; + linParams.amg.numFunctions = linParams.dofsPerNode; linParams.amg.separateComponents = true; m_surfaceGenerator = this->getParent().getGroupPointer< PhysicsSolverBase >( m_surfaceGeneratorName ); diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index fa48a1f1975..6617fd74792 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -1796,7 +1796,7 @@ stress - traction is applied to the faces as specified by the inner product of i - + @@ -1867,7 +1867,7 @@ the relative residual norm satisfies: - +