Functions | |
template<int dim, int spacedim, typename VectorType> | |
void | coefficient_decay (FESeries::Legendre< dim, spacedim > &fe_legendre, const DoFHandler< dim, spacedim > &dof_handler, const VectorType &solution, Vector< float > &smoothness_indicators, const VectorTools::NormType regression_strategy=VectorTools::Linfty_norm, const double smallest_abs_coefficient=1e-10, const bool only_flagged_cells=false) |
template<int dim, int spacedim, typename VectorType> | |
void | coefficient_decay_per_direction (FESeries::Legendre< dim, spacedim > &fe_legendre, const DoFHandler< dim, spacedim > &dof_handler, const VectorType &solution, Vector< float > &smoothness_indicators, const ComponentMask &coefficients_predicate={}, const double smallest_abs_coefficient=1e-10, const bool only_flagged_cells=false) |
template<int dim, int spacedim> | |
FESeries::Legendre< dim, spacedim > | default_fe_series (const hp::FECollection< dim, spacedim > &fe_collection, const unsigned int component=numbers::invalid_unsigned_int) |
Smoothness estimation strategy based on the decay of Legendre expansion coefficients.
In one dimension, the finite element solution on cell
where
A function is analytic, i.e., representable by a power series, if and only if their Legendre expansion coefficients decay as (see [eibner2007hp])
We determine their decay rate
for
void SmoothnessEstimator::Legendre::coefficient_decay | ( | FESeries::Legendre< dim, spacedim > & | fe_legendre, |
const DoFHandler< dim, spacedim > & | dof_handler, | ||
const VectorType & | solution, | ||
Vector< float > & | smoothness_indicators, | ||
const VectorTools::NormType | regression_strategy = VectorTools::Linfty_norm, | ||
const double | smallest_abs_coefficient = 1e-10, | ||
const bool | only_flagged_cells = false ) |
In this variant of the estimation strategy for higher dimensions, we will consider all mode vectors
for
For a finite element approximation solution
, this function writes the decay rate for every cell into the output vector smoothness_indicators
.
[in] | fe_legendre | FESeries::Legendre object to calculate coefficients. This object needs to be initialized to have at least ![]() ![]() |
[in] | dof_handler | A DoFHandler. |
[in] | solution | A solution vector. |
[out] | smoothness_indicators | A vector for smoothness indicators. |
[in] | regression_strategy | Determines which norm will be used on the subset of coefficients ![]() ![]() |
[in] | smallest_abs_coefficient | The smallest absolute value of the coefficient to be used in linear regression. Note that Legendre coefficients of some functions may have a repeating pattern of zero coefficients (i.e. for functions that are locally symmetric or antisymmetric about the midpoint of the element in any coordinate direction). Thus this parameters allows to ignore small (in absolute value) coefficients within the linear regression fit. In case there are less than two nonzero coefficients, the returned value for this cell will be ![]() |
[in] | only_flagged_cells | Smoothness indicators are usually used to decide whether to perform h- or p-adaptation. So in most cases, we only need to calculate those indicators on cells flagged for refinement or coarsening. This parameter controls whether this particular subset or all cells will be considered. By default, all cells will be considered. When only flagged cells are supposed to be considered, smoothness indicators will only be set on those vector entries of flagged cells; the others will be set to a signaling NaN. |
For more theoretical details see [mavriplis1994hp] [houston2005hp] [eibner2007hp].
Definition at line 101 of file smoothness_estimator.cc.
void SmoothnessEstimator::Legendre::coefficient_decay_per_direction | ( | FESeries::Legendre< dim, spacedim > & | fe_legendre, |
const DoFHandler< dim, spacedim > & | dof_handler, | ||
const VectorType & | solution, | ||
Vector< float > & | smoothness_indicators, | ||
const ComponentMask & | coefficients_predicate = {}, | ||
const double | smallest_abs_coefficient = 1e-10, | ||
const bool | only_flagged_cells = false ) |
In this variant of the estimation strategy for higher dimensions, we only consider modes in each coordinate direction, i.e., only mode vectors
For a finite element approximation solution
, this function writes the decay rate for every cell into the output vector smoothness_indicators
.
[in] | fe_legendre | FESeries::Legendre object to calculate coefficients. This object needs to be initialized to have at least ![]() ![]() |
[in] | dof_handler | A DoFHandler |
[in] | solution | A solution vector |
[out] | smoothness_indicators | A vector for smoothness indicators |
[in] | coefficients_predicate | A predicate to select Legendre coefficients ![]() ![]() flags provided to this function. Note that its size is ![]() ![]() true . |
[in] | smallest_abs_coefficient | The smallest absolute value of the coefficient to be used in linear regression in each coordinate direction. Note that Legendre coefficients of some functions may have a repeating pattern of zero coefficients (i.e. for functions that are locally symmetric or antisymmetric about the midpoint of the element in any coordinate direction). Thus this parameters allows to ignore small (in absolute value) coefficients within the linear regression fit. In case there are less than two nonzero coefficients for a coordinate direction, this direction will be skipped. If all coefficients are zero, the returned value for this cell will be ![]() |
[in] | only_flagged_cells | Smoothness indicators are usually used to decide whether to perform h- or p-adaptation. So in most cases, we only need to calculate those indicators on cells flagged for refinement or coarsening. This parameter controls whether this particular subset or all cells will be considered. By default, all cells will be considered. When only flagged cells are supposed to be considered, smoothness indicators will only be set on those vector entries of flagged cells; the others will be set to NaN. |
For more theoretical details and the application within the deal.II library see [davydov2017hp].
Definition at line 181 of file smoothness_estimator.cc.
FESeries::Legendre< dim, spacedim > SmoothnessEstimator::Legendre::default_fe_series | ( | const hp::FECollection< dim, spacedim > & | fe_collection, |
const unsigned int | component = numbers::invalid_unsigned_int ) |
Returns a FESeries::Legendre object for Legendre series expansions with the default configuration for smoothness estimation purposes.
For each finite element of the provided fe_collection
, we use as many modes as its polynomial degree plus two. This includes the first Legendre polynomial which is just a constant. Further for each element, we use a Gaussian quadrature designed to yield exact results for the highest order Legendre polynomial used.
As the Legendre expansion can only be performed on scalar fields, this class does not operate on vector-valued finite elements and will therefore throw an assertion. However, each component of a finite element field can be treated as a scalar field, respectively, on which Legendre expansions are again possible. For this purpose, the optional parameter component
defines which component of each FiniteElement will be used. The default value of component
only applies to scalar FEs, in which case it indicates that the sole component is to be decomposed. For vector-valued FEs, a non-default value must be explicitly provided.
Definition at line 288 of file smoothness_estimator.cc.