Reference documentation for deal.II version 9.4.1
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim > Class Template Reference

#include <deal.II/fe/mapping_q_internal.h>

Inheritance diagram for internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim >:
[legend]

Public Member Functions

 InverseQuadraticApproximation (const std::vector< Point< spacedim > > &real_support_points, const std::vector< Point< dim > > &unit_support_points)
 
 InverseQuadraticApproximation (const InverseQuadraticApproximation &)=default
 
template<typename Number >
Point< dim, Number > compute (const Point< spacedim, Number > &p) const
 

Static Public Attributes

static constexpr unsigned int n_functions
 

Private Attributes

const Point< spacedim > normalization_shift
 
const double normalization_length
 
std::array< Point< dim >, n_functionscoefficients
 
bool is_affine
 

Detailed Description

template<int dim, int spacedim>
class internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim >

A class to compute a quadratic approximation to the inverse map from real to unit points by a least-squares fit along the mapping support points. The least squares fit is special in the sense that the approximation is constructed for the inverse function of a MappingQ, which is generally a rational function. This allows for a very cheap evaluation of the inverse map by a simple polynomial interpolation, which can be used as a better initial guess for transforming points from real to unit coordinates than an affine approximation.

Far away outside the unit cell, this approximation can become inaccurate for non-affine cell shapes. This must be expected from a fit of a polynomial to a rational function, and due to the fact that the region of the least squares fit, the unit cell, is left. Hence, use this function with care in those situations.

Definition at line 873 of file mapping_q_internal.h.

Constructor & Destructor Documentation

◆ InverseQuadraticApproximation() [1/2]

template<int dim, int spacedim>
internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim >::InverseQuadraticApproximation ( const std::vector< Point< spacedim > > &  real_support_points,
const std::vector< Point< dim > > &  unit_support_points 
)
inline

Constructor.

Parameters
real_support_pointsThe position of the mapping support points in real space, queried by MappingQ::compute_mapping_support_points().
unit_support_pointsThe location of the support points in reference coordinates \([0, 1]^d\) that map to the mapping support points in real space by a polynomial map.

Definition at line 893 of file mapping_q_internal.h.

◆ InverseQuadraticApproximation() [2/2]

template<int dim, int spacedim>
internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim >::InverseQuadraticApproximation ( const InverseQuadraticApproximation< dim, spacedim > &  )
default

Copy constructor.

Member Function Documentation

◆ compute()

template<int dim, int spacedim>
template<typename Number >
Point< dim, Number > internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim >::compute ( const Point< spacedim, Number > &  p) const
inline

Evaluate the quadratic approximation.

Definition at line 1030 of file mapping_q_internal.h.

Member Data Documentation

◆ n_functions

template<int dim, int spacedim>
constexpr unsigned int internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim >::n_functions
staticconstexpr
Initial value:
=
(spacedim == 1 ? 3 : (spacedim == 2 ? 6 : 10))

Number of basis functions in the quadratic approximation.

Definition at line 879 of file mapping_q_internal.h.

◆ normalization_shift

template<int dim, int spacedim>
const Point<spacedim> internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim >::normalization_shift
private

In order to guarantee a good conditioning, we need to apply a transformation to the points in real space that is computed by a shift vector normalization_shift (first point of the mapping support points in real space) and an inverse length scale called length_normalization as the distance between the first two points.

Definition at line 1085 of file mapping_q_internal.h.

◆ normalization_length

template<int dim, int spacedim>
const double internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim >::normalization_length
private

See the documentation of normalization_shift above.

Definition at line 1090 of file mapping_q_internal.h.

◆ coefficients

template<int dim, int spacedim>
std::array<Point<dim>, n_functions> internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim >::coefficients
private

The vector of coefficients in the quadratic approximation.

Definition at line 1095 of file mapping_q_internal.h.

◆ is_affine

template<int dim, int spacedim>
bool internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim >::is_affine
private

In case the quadratic approximation is not possible due to an insufficient number of support points, we switch to an affine approximation that always works but is less accurate.

Definition at line 1102 of file mapping_q_internal.h.


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