GEOSX
ThermalMultiphasePoromechanics.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_HYPREMGRTHERMALMULTIPHASEPOROMECHANICS_HPP_
20 #define GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRTHERMALMULTIPHASEPOROMECHANICS_HPP_
21 
23 
24 namespace geos
25 {
26 
27 namespace hypre
28 {
29 
30 namespace mgr
31 {
32 
54 {
55 public:
60  explicit ThermalMultiphasePoromechanics( arrayView1d< int const > const & numComponentsPerField )
61  : MGRStrategyBase( LvArray::integerConversion< HYPRE_Int >( numComponentsPerField[0] + numComponentsPerField[1] ) )
62  {
63  // Level 0: eliminate displacement degrees of freedom
64  m_labels[0].resize( m_numBlocks - 3 );
65  std::iota( m_labels[0].begin(), m_labels[0].end(), 3 );
66  // Level 1: eliminate last density which corresponds to the volume constraint equation
67  m_labels[1].resize( m_numBlocks - 5 );
68  std::iota( m_labels[1].begin(), m_labels[1].end(), 3 );
69  m_labels[1].push_back( m_numBlocks-1 ); // temperature
70  // Level 2: eliminate the remaining reservoir densities
71  m_labels[2].push_back( 3 ); // pressure
72  m_labels[2].push_back( m_numBlocks-1 ); // temperature
73 
74  setupLabels();
75 
76  // Level 0
78  m_levelFRelaxIters[0] = 1;
83 
84  // Level 1
86  m_levelFRelaxIters[1] = 1;
91 
92  // Level 2
99  }
100 
107  HyprePrecWrapper & precond,
108  HypreMGRData & mgrData )
109  {
110  setReduction( precond, mgrData );
111 
112  GEOS_LAI_CHECK_ERROR( HYPRE_MGRSetPMaxElmts( precond.ptr, 0 ));
113 
114  // CHECK: the mechanics solver setup was missing: was there a reason?
115  // Configure the BoomerAMG solver used as F-relaxation for the first level
116  setMechanicsFSolver( precond, mgrData );
117 
118  // Configure the BoomerAMG solver used as mgr coarse solver for the pressure/temperature reduced system
120  }
121 };
122 
123 } // namespace mgr
124 
125 } // namespace hypre
126 
127 } // namespace geos
128 
129 #endif /*GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRTHERMALMULTIPHASEPOROMECHANICS_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
HYPRE_Int m_numBlocks
Number of different matrix blocks treated separately.
Definition: HypreMGR.hpp:80
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 setPressureTemperatureAMG(HyprePrecWrapper &solver)
Set up BoomerAMG to perform the solve for the pressure/temperature system.
Definition: HypreMGR.hpp:224
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 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
HYPRE_Int m_levelGlobalSmootherIters[numLevels]
Number of global smoother iterations for each level.
Definition: HypreMGR.hpp:92
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 setMechanicsFSolver(HyprePrecWrapper &precond, HypreMGRData &mgrData)
Set up BoomerAMG to perform the mechanics F-solve for the first F-relaxation.
Definition: HypreMGR.hpp:256
ThermalMultiphasePoromechanics(arrayView1d< int const > const &numComponentsPerField)
Constructor.
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.
@ none
no F-relaxation if performed
@ none
no global smoothing is performed (default)
@ ilu0
incomplete LU factorization
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 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
Multigrid reduction parameters.