PTEMS  0.1.0-dev+git.81fd0e4
PolyTopic Element Method Solver
ptems::EquidistributionMarking Struct Reference

Functor object that can be passed to FEMesh::Adapt(Func, bool) to perform Equidistribution marking [3] for refinement of elements based on attempting to equidistribute the error between elements. More...

#include <ptems/refinements.hpp>

Inheritance diagram for ptems::EquidistributionMarking:
Collaboration diagram for ptems::EquidistributionMarking:

Public Member Functions

template<typename Estimators >
 EquidistributionMarking (const Estimators &estimators, double refineThreshold, double coarsenThreshold=0, double tolerance=-1)
 Create a functor for performing Equidistribution marking. More...
 
AdaptationType operator() (std::size_t element) const
 Functor operator to compute the adaptation type for the specifeid element. More...
 

Protected Member Functions

void SetThresholds (double refineThreshold, double coarsenThreshold)
 Sets the threshold for the refinement and coarsening. More...
 

Detailed Description

Functor object that can be passed to FEMesh::Adapt(Func, bool) to perform Equidistribution marking [3] for refinement of elements based on attempting to equidistribute the error between elements.

Given a mesh \(\mathcal{T}_h\) and per-element error indicators \(\eta_K\), \(K\in\mathcal{T}_h\), this marking strategy marks all elements for refinement where

\[ \eta_K> \theta_R \frac{\mathrm{tol}}{N^{\frac12}} \]

and marks all elements for coarsening where

\[ \eta_K< \theta_C \frac{\mathrm{tol}}{N^{\frac12}} \]

Here, \(\theta_R\in(0,1)\) and \(\theta_C\in[0,\theta_R)\) are threshold parameters and tol is a target tolerance. Alternatively, if not specified,

\[ \mathrm{tol} = \left(\sum_{K\in\mathcal{T}_h} \eta_K^2\right)^{\frac12}. \]

Constructor & Destructor Documentation

◆ EquidistributionMarking()

template<typename Estimators >
ptems::EquidistributionMarking::EquidistributionMarking ( const Estimators &  estimators,
double  refineThreshold,
double  coarsenThreshold = 0,
double  tolerance = -1 
)
inline

Create a functor for performing Equidistribution marking.

Exceptions
std::invalid_argumentIf estimators.empty() is true
std::invalid_argumentIf refineThreshold is not in \([0,1]\)
std::invalid_argumentIf coarsenThreshold is not in \((0,\textrm{refineThreshold}})\)
Template Parameters
EstimatorsType of the list of estimators. Must by an STL-like container supporting size() and operator[](std::size_t)
Parameters
estimatorsList of error indicators \(\eta_K\) (one per element) to use for Equidistribution marking.
refineThresholdThe constant \(\theta_R\) denoting the percentage of the equidistributed error indicator over which an element is marked for refinement. Must be in range \([0,1]\).
coarsenThresholdThe constant \(\theta_C\) denoting the percentage of the equidistributed error indicator under which an element is marked for coarsening. Must be in range \([0,\textrm{refineThreshold}})\).
toleranceThe target tolerance to equidistribute to deduce elements to refine. If less than or equal to zero uses

\[\left(\sum_{K\in\mathcal{T}_h} \eta_K^2\right)^{\frac12}.\]

Member Function Documentation

◆ operator()()

AdaptationType ptems::ThresholdMarking::operator() ( std::size_t  element) const
inlineinherited

Functor operator to compute the adaptation type for the specifeid element.

Parameters
elementIndex of the element to get the adaptation type for
Returns
Adaptation type (Refine, coarsen, or none)

◆ SetThresholds()

void ptems::ThresholdMarking::SetThresholds ( double  refineThreshold,
double  coarsenThreshold 
)
inlineprotectedinherited

Sets the threshold for the refinement and coarsening.

This allows a subclass to set the thresholds as two-stage construction.

Parameters
refineThresholdThe constant \(\theta_R\) denoting the threshold the indicators of elements marked for refinement should be greater than.
coarsenThresholdThe constant \(\theta_C\) denoting the percentage of the total error the sum of the indicators of the elements that should be marked for coarsening should be less than. Must be in range \([0,1]\) and refineThreshold+coarsenThreshold must be less than 1.

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