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

Class defining an initialization indicator for grid adaption. Refines at sources and boundaries. Use before computing on the grid. More...

#include <dumux/adaptive/initializationindicator.hh>

Description

template<class TypeTag>
class Dumux::GridAdaptInitializationIndicator< TypeTag >

Class defining an initialization indicator for grid adaption. Refines at sources and boundaries. Use before computing on the grid.

Class defining a start indicator for grid adaption.

Template Parameters
TypeTagThe problem TypeTag

Uses the defined grid adaptation indicator and further accounts for sources and boundaries. Only for grid initialization!

Template Parameters
TypeTagThe problem TypeTag

Public Member Functions

 GridAdaptInitializationIndicator (std::shared_ptr< const Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< const GridVariables > gridVariables)
 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 setRefinementAtDirichletBC (bool refine)
 Function to set if refinement at Dirichlet boundaries is to be used. More...
 
void setRefinementAtSources (bool refine)
 Function to set if refinement at sources is to be used. More...
 
void setRefinementAtFluxBoundaries (bool refine)
 Function to set if refinement at sources is to be used. More...
 
template<class SolutionVector >
void calculate (const SolutionVector &sol)
 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...
 
void calculateIndicator ()
 Calculates the indicator used for refinement/coarsening for each grid cell. More...
 
bool refine (const Element &element)
 Indicator function for marking of grid cells for refinement. More...
 
bool coarsen (const Element &element)
 Indicator function for marking of grid cells for coarsening. More...
 
int maxLevel ()
 
void init ()
 Initializes the adaption indicator class. More...
 
bool initializeModel ()
 
 GridAdaptInitializationIndicator (Problem &problem, AdaptionIndicator &adaptionIndicator)
 Constructs a GridAdaptionIndicator instance. More...
 

Constructor & Destructor Documentation

◆ GridAdaptInitializationIndicator() [1/2]

template<class TypeTag >
Dumux::GridAdaptInitializationIndicator< TypeTag >::GridAdaptInitializationIndicator ( std::shared_ptr< const Problem >  problem,
std::shared_ptr< const GridGeometry >  gridGeometry,
std::shared_ptr< const GridVariables >  gridVariables 
)
inline

Constructor.

Note
Reads the folloing parameters from the parameter tree
  • Adaptive.MinLevel The minimum refinement level
  • Adaptive.MaxLevel The maximum refinement level
  • Adaptive.RefineAtDirichletBC If to refine at Dirichlet boundaries (default: true)
  • Adaptive.RefineAtFluxBC If to refine at Neumann/Robin boundaries (default: true)
  • Adaptive.RefineAtSource If to refine where source terms are specified (default: true)
  • Adaptive.BCRefinementThreshold The threshold above which fluxes are treated as non-zero (default: 1e-10)
Parameters
problemThe problem object
gridGeometryThe finite volume geometry of the grid
gridVariablesThe secondary variables on the grid

◆ GridAdaptInitializationIndicator() [2/2]

template<class TypeTag >
Dumux::GridAdaptInitializationIndicator< TypeTag >::GridAdaptInitializationIndicator ( Problem &  problem,
AdaptionIndicator &  adaptionIndicator 
)
inline

Constructs a GridAdaptionIndicator instance.

This standard indicator is based on the saturation gradient. It checks the local gradient compared to the maximum global gradient. The indicator is compared locally to a refinement/coarsening threshold to decide whether a cell should be marked for refinement or coarsening or should not be adapted.

Parameters
problemThe problem object
adaptionIndicatorIndicator whether a be adapted

Member Function Documentation

◆ calculate()

template<class TypeTag >
template<class SolutionVector >
void Dumux::GridAdaptInitializationIndicator< TypeTag >::calculate ( const SolutionVector &  sol)
inline

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

Parameters
solThe solution for which indicator is to be calculated

prepare an indicator for refinement

refine any element being below the minimum level

Check if we have to refine around a source term

Check if we have to refine at the boundary

check if scvf is on Neumann boundary

◆ calculateIndicator()

template<class TypeTag >
void Dumux::GridAdaptInitializationIndicator< TypeTag >::calculateIndicator ( )
inline

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

◆ coarsen()

template<class TypeTag >
bool Dumux::GridAdaptInitializationIndicator< TypeTag >::coarsen ( const Element &  element)
inline

Indicator function for marking of grid cells for coarsening.

Returns true if an element should be coarsened.

Parameters
elementA grid element

◆ init()

template<class TypeTag >
void Dumux::GridAdaptInitializationIndicator< TypeTag >::init ( )
inline

Initializes the adaption indicator class.

◆ initializeModel()

template<class TypeTag >
bool Dumux::GridAdaptInitializationIndicator< TypeTag >::initializeModel ( )
inline

◆ maxLevel()

template<class TypeTag >
int Dumux::GridAdaptInitializationIndicator< TypeTag >::maxLevel ( )
inline

◆ operator()()

template<class TypeTag >
int Dumux::GridAdaptInitializationIndicator< 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
Note
In this initialization indicator implementation element coarsening is not considered.
Parameters
elementA grid element

◆ refine()

template<class TypeTag >
bool Dumux::GridAdaptInitializationIndicator< TypeTag >::refine ( const Element &  element)
inline

Indicator function for marking of grid cells for refinement.

Returns true if an element should be refined.

Parameters
elementA grid element

◆ setLevels()

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

Function to set the minumum/maximum allowed levels.

◆ setMaxLevel()

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

Function to set the maximum allowed level.

◆ setMinLevel()

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

Function to set the minimum allowed level.

◆ setRefinementAtDirichletBC()

template<class TypeTag >
void Dumux::GridAdaptInitializationIndicator< TypeTag >::setRefinementAtDirichletBC ( bool  refine)
inline

Function to set if refinement at Dirichlet boundaries is to be used.

◆ setRefinementAtFluxBoundaries()

template<class TypeTag >
void Dumux::GridAdaptInitializationIndicator< TypeTag >::setRefinementAtFluxBoundaries ( bool  refine)
inline

Function to set if refinement at sources is to be used.

◆ setRefinementAtSources()

template<class TypeTag >
void Dumux::GridAdaptInitializationIndicator< TypeTag >::setRefinementAtSources ( bool  refine)
inline

Function to set if refinement at sources is to be used.


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