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

Functor object that can be passed to FEMesh::Adapt(Func, bool) to perform marking for refinement of elements based on a threshold condition for the error indicator. More...

#include <ptems/refinements.hpp>

Inheritance diagram for ptems::ThresholdMarking:

Public Member Functions

template<typename Estimators >
 ThresholdMarking (const Estimators &estimators, double refineThreshold, double coarsenThreshold=0)
 Create a functor for performing threshold 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 marking for refinement of elements based on a threshold condition for the error indicator.

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\) and marks all elements for coarsening where \(\eta_K<\theta_C\). Here, \(\theta_R>0\) and \(\theta_C\geq 0\) are threshold parameters

Note
While this can be used directly, it is mainly used as a base type for other refinement strategies (e.g., MaximalMarking and EquidistributionMarking)

Constructor & Destructor Documentation

◆ ThresholdMarking()

template<typename Estimators >
ptems::ThresholdMarking::ThresholdMarking ( const Estimators &  estimators,
double  refineThreshold,
double  coarsenThreshold = 0 
)
inline

Create a functor for performing threshold marking.

Exceptions
std::invalid_argumentIf estimators.empty() is true
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 marking.
refineThresholdThe constant \(\theta_R\) denoting the threshold the indicators of elements marked for refinement should be greater than.
coarsenThresholdThe constant \(\theta_R\) denoting the threshold the indicators of elements marked for refinement should be less than.

Member Function Documentation

◆ operator()()

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

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 
)
inlineprotected

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: