Functions | |
template<int dim, int spacedim, typename VectorType> | |
void | coefficient_decay (FESeries::Fourier< dim, spacedim > &fe_fourier, 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::Fourier< dim, spacedim > &fe_fourier, 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::Fourier< 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 Fourier expansion coefficients.
From the definition, we can write our Fourier series expansion
with
If the finite element approximation on cell
The sum is finite only if the summands decay at least with order
for all
The next step is to estimate how fast these coefficients decay with
with regression coefficients
where
Solving for
While we are not particularly interested in the actual value of
void SmoothnessEstimator::Fourier::coefficient_decay | ( | FESeries::Fourier< dim, spacedim > & | fe_fourier, |
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
The regression_strategy
parameter determines which norm will be used on the subset of coefficients
For a provided solution vector solution
defined on a DoFHandler dof_handler
, this function returns a vector smoothness_indicators
with as many elements as there are cells where each element contains the estimated regularity
A series expansion object fe_fourier
has to be supplied, which needs to be constructed with the same FECollection object as the dof_handler
.
The parameter smallest_abs_coefficient
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
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. The parameter only_flagged_cells
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.
Definition at line 368 of file smoothness_estimator.cc.
void SmoothnessEstimator::Fourier::coefficient_decay_per_direction | ( | FESeries::Fourier< dim, spacedim > & | fe_fourier, |
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
The coefficients_predicate
parameter selects Fourier coefficients flags
provided to this function. Note that its size is true
.
For a provided solution vector solution
defined on a DoFHandler dof_handler
, this function returns a vector smoothness_indicators
with as many elements as there are cells where each element contains the estimated regularity
A series expansion object fe_fourier
has to be supplied, which needs to be constructed with the same FECollection object as the dof_handler
.
The parameter smallest_abs_coefficient
allows to ignore small (in absolute value) coefficients within the linear regression fit. In case there are fewer 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
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. The parameter only_flagged_cells
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.
Definition at line 466 of file smoothness_estimator.cc.
FESeries::Fourier< dim, spacedim > SmoothnessEstimator::Fourier::default_fe_series | ( | const hp::FECollection< dim, spacedim > & | fe_collection, |
const unsigned int | component = numbers::invalid_unsigned_int ) |
Returns a FESeries::Fourier object for Fourier 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. Further for each element, we use a 5-point Gaussian quarature iterated in each dimension by the maximal wave number, which is the number of modes decreased by one since we start with
As the Fourier 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 Fourier 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 575 of file smoothness_estimator.cc.