GEOSX
SinglePhasePoromechanicsEmbeddedFractures.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRSINGLEPHASEPOROMECHANICSEMBEDDEDFRACTURES_HPP_
20 #define GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRSINGLEPHASEPOROMECHANICSEMBEDDEDFRACTURES_HPP_
21 
23 
24 namespace geos
25 {
26 
27 namespace hypre
28 {
29 
30 namespace mgr
31 {
32 
52 {
53 public:
54 
59  : MGRStrategyBase( 7 )
60  {
61  // we keep u and p
62  m_labels[0].push_back( 0 );
63  m_labels[0].push_back( 1 );
64  m_labels[0].push_back( 2 );
65  m_labels[0].push_back( 6 );
66  // we keep p
67  m_labels[1].push_back( 6 );
68 
69  setupLabels();
70 
71  // Level 0
72  m_levelFRelaxType[0] = MGRFRelaxationType::gsElimWPivoting; // gaussian elimination for the dispJump block
73  m_levelFRelaxIters[0] = 1;
78 
79  // Level 1
85 
86  }
87 
94  HyprePrecWrapper & precond,
95  HypreMGRData & mgrData )
96  {
97  setReduction( precond, mgrData );
98 
99  GEOS_LAI_CHECK_ERROR( HYPRE_MGRSetPMaxElmts( precond.ptr, 0 ));
100 
101  // Configure the BoomerAMG solver used as F-relaxation for the second level
102  GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGCreate( &mgrData.mechSolver.ptr ) );
103  GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetTol( mgrData.mechSolver.ptr, 0.0 ) );
104  GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxIter( mgrData.mechSolver.ptr, 1 ) );
105  GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxRowSum( mgrData.mechSolver.ptr, 1.0 ) );
106  GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetStrongThreshold( mgrData.mechSolver.ptr, 0.6 ) );
107  GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetPrintLevel( mgrData.mechSolver.ptr, 0 ) );
108  GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetNumFunctions( mgrData.mechSolver.ptr, 3 ) );
109 
110 #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP
113  GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetNumSweeps( mgrData.mechSolver.ptr, 1 ) );
114 #else
115  GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetRelaxOrder( mgrData.mechSolver.ptr, 1 ) );
116 #endif
117  GEOS_LAI_CHECK_ERROR( HYPRE_MGRSetFSolverAtLevel( 1, precond.ptr, mgrData.mechSolver.ptr ) );
118 
119  // Configure the BoomerAMG solver used as mgr coarse solver for the pressure reduced system
120  setPressureAMG( mgrData.coarseSolver );
121  }
122 };
123 
124 } // namespace mgr
125 
126 } // namespace hypre
127 
128 } // namespace geos
129 
130 #endif /*GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRSINGLEPHASEPOROMECHANICSEMBEDDEDFRACTURES_HPP_*/
Helper struct for strategies that provides some basic parameter arrays needed by MGR.
Definition: HypreMGR.hpp:73
MGRCoarseGridMethod m_levelCoarseGridMethod[numLevels]
Coarse grid method for each level.
Definition: HypreMGR.hpp:90
MGRInterpolationType m_levelInterpType[numLevels]
Interpolation type for each level.
Definition: HypreMGR.hpp:88
std::vector< HYPRE_Int > m_labels[numLevels]
Dof labels kept at each level.
Definition: HypreMGR.hpp:82
void setupLabels()
Call this after populating lv_cindexes.
Definition: HypreMGR.hpp:119
HYPRE_Int m_levelFRelaxIters[numLevels]
Number of F-relaxation iterations for each level.
Definition: HypreMGR.hpp:87
void setPressureAMG(HyprePrecWrapper &solver)
Set up BoomerAMG to perform the solve for the pressure system.
Definition: HypreMGR.hpp:197
void setReduction(HyprePrecWrapper &precond, HypreMGRData &mgrData)
Helper function that sets the reduction features common to all mgr strategies.
Definition: HypreMGR.hpp:133
MGRFRelaxationType m_levelFRelaxType[numLevels]
F-relaxation type for each level.
Definition: HypreMGR.hpp:86
MGRGlobalSmootherType m_levelGlobalSmootherType[numLevels]
Global smoother type for each level.
Definition: HypreMGR.hpp:91
MGRRestrictionType m_levelRestrictType[numLevels]
Restriction type for each level.
Definition: HypreMGR.hpp:89
void setup(LinearSolverParameters::MGR const &, HyprePrecWrapper &precond, HypreMGRData &mgrData)
Setup the MGR strategy.
#define GEOS_LAI_CHECK_ERROR(call)
Definition: common.hpp:117
@ galerkin
Galerkin coarse grid computation using RAP.
@ amgVCycle
Full AMG VCycle solver.
@ gsElimWPivoting
Gaussian Elimination with pivoting direct solver (for small systems)
HYPRE_Int getAMGRelaxationType(LinearSolverParameters::AMG::SmootherType const &type)
Returns hypre's identifier of the AMG smoother type.
Definition: HypreUtils.hpp:306
HYPRE_Int getAMGCoarseningType(LinearSolverParameters::AMG::CoarseningType const &type)
Returns hypre's identifier of the AMG coarsening type.
Definition: HypreUtils.hpp:410
@ none
no global smoothing is performed (default)
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:220
Container for hypre preconditioner auxiliary data for MGR.
Definition: HypreMGR.hpp:37
HyprePrecWrapper mechSolver
MGR mechanics fine solver pointer and functions.
Definition: HypreMGR.hpp:40
HyprePrecWrapper coarseSolver
MGR coarse solver pointer and functions.
Definition: HypreMGR.hpp:39
Container for hypre preconditioner function pointers.
Definition: HypreUtils.hpp:53
HYPRE_Solver ptr
pointer to preconditioner
Definition: HypreUtils.hpp:63
@ chebyshev
Chebyshev polynomial smoothing.
@ PMIS
Parallel coarsening as CLJP but with lower complexities (GPU support)
Multigrid reduction parameters.