Skip to content
1 change: 1 addition & 0 deletions src/coreComponents/linearAlgebra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ if( ENABLE_HYPRE )
interfaces/hypre/mgrStrategies/MultiphasePoromechanics.hpp
interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsEmbeddedFractures.hpp
interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsConformingFractures.hpp
interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsConformingFracturesALM.hpp
interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsReservoirFVM.hpp
interfaces/hypre/mgrStrategies/SinglePhaseReservoirFVM.hpp
interfaces/hypre/mgrStrategies/SinglePhaseReservoirHybridFVM.hpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanics.hpp"
#include "linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsEmbeddedFractures.hpp"
#include "linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsConformingFractures.hpp"
#include "linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsConformingFracturesALM.hpp"
#include "linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsReservoirFVM.hpp"
#include "linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhaseReservoirFVM.hpp"
#include "linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhaseReservoirHybridFVM.hpp"
Expand Down Expand Up @@ -186,6 +187,11 @@ void hypre::mgr::createMGR( LinearSolverParameters const & params,
setStrategy< SinglePhasePoromechanicsConformingFractures >( params.mgr, numComponentsPerField, precond, mgrData );
break;
}
case LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanicsConformingFracturesALM:
{
setStrategy< SinglePhasePoromechanicsConformingFracturesALM >( params.mgr, numComponentsPerField, precond, mgrData );
break;
}
case LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanicsReservoirFVM:
{
setStrategy< SinglePhasePoromechanicsReservoirFVM >( params.mgr, numComponentsPerField, precond, mgrData );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2024 TotalEnergies
* Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2023-2024 Chevron
* Copyright (c) 2019- GEOS/GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/**
* @file SinglePhasePoromechanicsConformingFracturesALM.hpp
*/

#ifndef GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRSINGLEPHASEPOROMECHANICSCONFORMINGFRACTURESALM_HPP_
#define GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRSINGLEPHASEPOROMECHANICSCONFORMINGFRACTURESALM_HPP_

#include "linearAlgebra/interfaces/hypre/HypreMGR.hpp"

namespace geos
{

namespace hypre
{

namespace mgr
{

/**
* @brief SinglePhasePoromechanicsConformingFracturesALM strategy.
*
* Labels assigned by DofManager (PoromechanicsSolver::setupDofs calls
* solidMechanicsSolver first, then flowSolver):
*
* dofLabel: 0 = displacement, x-component
* dofLabel: 1 = displacement, y-component
* dofLabel: 2 = displacement, z-component
* dofLabel: 3 = bubble displacement, x-component
* dofLabel: 4 = bubble displacement, y-component
* dofLabel: 5 = bubble displacement, z-component
* dofLabel: 6 = pressure (cell elem + fracture elems)
*
* Ingredients:
* 1. Level 0: F-points bubble (3,4,5), C-points displacement+pressure (0,1,2,6)
* 2. Level 1: F-points displacement (0,1,2), C-points pressure (6)
* 3. F-points smoother at Level 1: BoomerAMG, single V-cycle
* 4. C-points coarse-grid/Schur complement solver: BoomerAMG
* 5. Global smoother: none
*/
class SinglePhasePoromechanicsConformingFracturesALM : public MGRStrategyBase< 2 >
{
public:

/**
* @brief Constructor.
*/
explicit SinglePhasePoromechanicsConformingFracturesALM( arrayView1d< int const > const & )
: MGRStrategyBase( 7 )
{

// Level 0: keep displacement (0,1,2) + pressure (6), eliminate bubble (3,4,5)
m_labels[0].push_back( 0 );
m_labels[0].push_back( 1 );
m_labels[0].push_back( 2 );
m_labels[0].push_back( 6 );
// Level 1: keep pressure (6), eliminate displacement (0,1,2)
m_labels[1].push_back( 6 );

setupLabels();

// Level 0: eliminate bubble DOFs (3,4,5), keep displacement (0,1,2) + pressure (6)
m_levelFRelaxType[0] = MGRFRelaxationType::l1jacobi;
m_levelFRelaxIters[0] = 1;
m_levelGlobalSmootherType[0] = MGRGlobalSmootherType::none;
m_levelGlobalSmootherIters[0] = 0;
m_levelInterpType[0] = MGRInterpolationType::injection;
m_levelRestrictType[0] = MGRRestrictionType::injection;
m_levelCoarseGridMethod[0] = MGRCoarseGridMethod::galerkin;

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

}

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

// Configure the BoomerAMG solver used as F-relaxation for the second level
// Note: we do NOT use setDisplacementAMG() here because HYPRE_MGRSetFSolverAtLevel
// transfers ownership of the solver to MGR. MGR will destroy it during HYPRE_MGRDestroy.
// Setting mechSolver.destroy would cause a double-free in HyprePreconditioner::clear().
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGCreate( &mgrData.mechSolver.ptr ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetTol( mgrData.mechSolver.ptr, 0.0 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxIter( mgrData.mechSolver.ptr, 1 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxRowSum( mgrData.mechSolver.ptr, 1.0 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetStrongThreshold( mgrData.mechSolver.ptr, 0.6 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetPrintLevel( mgrData.mechSolver.ptr, 0 ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetNumFunctions( mgrData.mechSolver.ptr, 3 ) );

#if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetCoarsenType( mgrData.mechSolver.ptr, hypre::getAMGCoarseningType( LinearSolverParameters::AMG::CoarseningType::PMIS ) ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetRelaxType( mgrData.mechSolver.ptr, hypre::getAMGRelaxationType( LinearSolverParameters::AMG::SmootherType::chebyshev ) ) );
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetNumSweeps( mgrData.mechSolver.ptr, 1 ) );
#else
GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetRelaxOrder( mgrData.mechSolver.ptr, 1 ) );
#endif
GEOS_LAI_CHECK_ERROR( HYPRE_MGRSetFSolverAtLevel( precond.ptr, mgrData.mechSolver.ptr, 1 ) );

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

} // namespace mgr

} // namespace hypre

} // namespace geos

#endif /*GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRSINGLEPHASEPOROMECHANICSCONFORMINGFRACTURESALM_HPP_*/
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ struct LinearSolverParameters
hybridSinglePhasePoromechanics, ///< single phase poromechanics with hybrid finite volume single phase flow
singlePhasePoromechanicsEmbeddedFractures, ///< single phase poromechanics with FV embedded fractures
singlePhasePoromechanicsConformingFractures, ///< single phase poromechanics with conforming fractures
singlePhasePoromechanicsConformingFracturesALM, ///< single phase poromechanics with conforming fractures for ALM
singlePhasePoromechanicsReservoirFVM, ///< single phase poromechanics with finite volume single phase flow with wells
compositionalMultiphaseFVM, ///< finite volume compositional multiphase flow
compositionalMultiphaseHybridFVM, ///< hybrid finite volume compositional multiphase flow
Expand Down
Loading
Loading