3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Public Member Functions | List of all members
Dumux::TwoPGridAdaptIndicator< TypeTag > Class Template Reference

Class defining a standard, saturation dependent indicator for grid adaptation. More...

#include <dumux/porousmediumflow/2p/gridadaptindicator.hh>

Description

template<class TypeTag>
class Dumux::TwoPGridAdaptIndicator< TypeTag >

Class defining a standard, saturation dependent indicator for grid adaptation.

Public Member Functions

 TwoPGridAdaptIndicator (std::shared_ptr< const GridGeometry > gridGeometry, const std::string &paramGroup="")
 The Constructor. More...
 
void setMinLevel (std::size_t minLevel)
 Function to set the minimum allowed level. More...
 
void setMaxLevel (std::size_t maxLevel)
 Function to set the maximum allowed level. More...
 
void setLevels (std::size_t minLevel, std::size_t maxLevel)
 Function to set the minumum/maximum allowed levels. More...
 
void calculate (const SolutionVector &sol, Scalar refineTol=0.05, Scalar coarsenTol=0.001)
 Calculates the indicator used for refinement/coarsening for each grid cell. More...
 
int operator() (const Element &element) const
 function call operator to return mark More...
 

Constructor & Destructor Documentation

◆ TwoPGridAdaptIndicator()

template<class TypeTag >
Dumux::TwoPGridAdaptIndicator< TypeTag >::TwoPGridAdaptIndicator ( std::shared_ptr< const GridGeometry >  gridGeometry,
const std::string &  paramGroup = "" 
)
inline

The Constructor.

Parameters
gridGeometryThe finite volume grid geometry
paramGroupThe parameter group in which to look for runtime parameters first (default is "")

Note: refineBound_, coarsenBound_ & maxSaturationDelta_ are chosen in a way such that the indicator returns false for all elements before having been calculated.

Member Function Documentation

◆ calculate()

template<class TypeTag >
void Dumux::TwoPGridAdaptIndicator< TypeTag >::calculate ( const SolutionVector &  sol,
Scalar  refineTol = 0.05,
Scalar  coarsenTol = 0.001 
)
inline

Calculates the indicator used for refinement/coarsening for each grid cell.

Parameters
solThe solution vector
refineTolThe refinement tolerance
coarsenTolThe coarsening tolerance

This standard two-phase indicator is based on the saturation gradient.

Reset the indicator to a state that returns false for all elements

maxLevel_ must be higher than minLevel_ to allow for refinement

Check for inadmissible tolerance combination

Variables to hold the max/mon saturation values on the leaf

Calculate minimum and maximum saturation

Index of the current leaf-element

Obtain the saturation at the center of the element

Maybe update the global minimum/maximum

Calculate maximum delta in saturation for this cell

Only consider internal intersections

Access neighbor

Visit intersection only once

Obtain saturation in the neighbor

Compute the maximum delta in saturation

Compute the refinement/coarsening bounds

check if neighbors have to be refined too

◆ operator()()

template<class TypeTag >
int Dumux::TwoPGridAdaptIndicator< TypeTag >::operator() ( const Element &  element) const
inline

function call operator to return mark

Returns
1 if an element should be refined -1 if an element should be coarsened 0 otherwise
Parameters
elementA grid element

◆ setLevels()

template<class TypeTag >
void Dumux::TwoPGridAdaptIndicator< TypeTag >::setLevels ( std::size_t  minLevel,
std::size_t  maxLevel 
)
inline

Function to set the minumum/maximum allowed levels.

Parameters
minLevelThe minimum level
maxLevelThe maximum level

◆ setMaxLevel()

template<class TypeTag >
void Dumux::TwoPGridAdaptIndicator< TypeTag >::setMaxLevel ( std::size_t  maxLevel)
inline

Function to set the maximum allowed level.

Parameters
maxLevelThe maximum level

◆ setMinLevel()

template<class TypeTag >
void Dumux::TwoPGridAdaptIndicator< TypeTag >::setMinLevel ( std::size_t  minLevel)
inline

Function to set the minimum allowed level.

Parameters
minLevelThe minimum level

The documentation for this class was generated from the following file: