Refines element or raises its polynomial degree. More...

#include <hpExtension.hh>

Inheritance diagram for hp3D::RefineOrRaise< F, G >:
concepts::CellPostprocess< F > concepts::OutputOperator

Public Member Functions

virtual void operator() (const concepts::Cell &cell) throw (concepts::MissingFeature)
 Application operator. More...
 
virtual void operator() (const concepts::Element< F > &elm) throw (concepts::MissingFeature)
 Application operator. More...
 
 RefineOrRaise (const concepts::Vector< F > &solution, const Real theta, concepts::AdaptiveSpace< G, concepts::AdaptiveAdjustP< 3 > > &spc)
 Constructor. More...
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 Returns information in an output stream. More...
 

Private Member Functions

bool regression_ (concepts::Array< F > &coeff, const uint p) const
 Makes the regression test. More...
 
Real transCoeff_ (const uint i, const uint j) const
 Returns the ith coefficient of the jth shape function in a Legendre expansion. More...
 

Private Attributes

concepts::Array< F > coeff_
 Elementwise coefficients of the shape functions. More...
 
concepts::Array< F > legendre_
 Legendre coefficients. More...
 
concepts::Array< F > regr_
 Temporary space for the log linear regression. More...
 
const concepts::Vector< F > & solution_
 Vector of the variable to plot. More...
 
concepts::AdaptiveSpace< G, concepts::AdaptiveAdjustP< 3 > > & spc_
 Space. More...
 
const Real theta_
 Decision parameter. More...
 

Detailed Description

template<typename F, typename G = typename concepts::Realtype<F>::type>
class hp3D::RefineOrRaise< F, G >

Refines element or raises its polynomial degree.

The decision is based on a log linear regression to find out if the Legendre coefficients of the solution decrease exponentially.

The parameter theta is used to control this decision. If $e^m$ is less than theta, the element's polynomial degree is raised, otherwise it is refined. m is the slope of the fitted line in the regression. This decision is taken anisotropic!

Author
Philipp Frauenfelder, 2002

Definition at line 40 of file hpExtension.hh.

Constructor & Destructor Documentation

◆ RefineOrRaise()

template<typename F , typename G = typename concepts::Realtype<F>::type>
hp3D::RefineOrRaise< F, G >::RefineOrRaise ( const concepts::Vector< F > &  solution,
const Real  theta,
concepts::AdaptiveSpace< G, concepts::AdaptiveAdjustP< 3 > > &  spc 
)

Constructor.

Parameters
solutionSolution vector
thetaDecision parameter
spcSpace (is used for the refinements)

Member Function Documentation

◆ info()

◆ operator()() [1/2]

template<typename F , typename G = typename concepts::Realtype<F>::type>
virtual void hp3D::RefineOrRaise< F, G >::operator() ( const concepts::Cell cell)
throw (concepts::MissingFeature
)
inlinevirtual

Application operator.

This application operator has to be overloaded to post process a mesh.

Parameters
cellCurrent cell

Implements concepts::CellPostprocess< F >.

Definition at line 52 of file hpExtension.hh.

◆ operator()() [2/2]

template<typename F , typename G = typename concepts::Realtype<F>::type>
virtual void hp3D::RefineOrRaise< F, G >::operator() ( const concepts::Element< F > &  elm)
throw (concepts::MissingFeature
)
virtual

Application operator.

This application operator has to be overloaded to post process a space.

Parameters
elmCurrent element

Implements concepts::CellPostprocess< F >.

◆ regression_()

template<typename F , typename G = typename concepts::Realtype<F>::type>
bool hp3D::RefineOrRaise< F, G >::regression_ ( concepts::Array< F > &  coeff,
const uint  p 
) const
private

Makes the regression test.

The coefficients in coeff are one dimensional, ie. 3D coefficients are collapsed to 1D using

\[ |\hat a_i| = \left( \sum_{j=0}^{n_y} \sum_{k=0}^{n_z} |a_{ijk}|^2 \frac{2}{2j+1} \frac{2}{2k+1} \right)^{1/2} \]

before calling this function.

Parameters
coeff1D coefficients, will be overwritten
pPolynomial degree
Returns
true if the coefficients seem to decrease exponentially, ie. increasing p is recommended

◆ transCoeff_()

template<typename F , typename G = typename concepts::Realtype<F>::type>
Real hp3D::RefineOrRaise< F, G >::transCoeff_ ( const uint  i,
const uint  j 
) const
private

Returns the ith coefficient of the jth shape function in a Legendre expansion.

\[ a_{ij} = \frac{2i+1}{2} \int_{-1}^1 \psi_j(x) L_i(x) \, dx \]

Member Data Documentation

◆ coeff_

template<typename F , typename G = typename concepts::Realtype<F>::type>
concepts::Array<F> hp3D::RefineOrRaise< F, G >::coeff_
private

Elementwise coefficients of the shape functions.

Definition at line 56 of file hpExtension.hh.

◆ legendre_

template<typename F , typename G = typename concepts::Realtype<F>::type>
concepts::Array<F> hp3D::RefineOrRaise< F, G >::legendre_
private

Legendre coefficients.

Definition at line 58 of file hpExtension.hh.

◆ regr_

template<typename F , typename G = typename concepts::Realtype<F>::type>
concepts::Array<F> hp3D::RefineOrRaise< F, G >::regr_
private

Temporary space for the log linear regression.

Definition at line 60 of file hpExtension.hh.

◆ solution_

template<typename F , typename G = typename concepts::Realtype<F>::type>
const concepts::Vector<F>& hp3D::RefineOrRaise< F, G >::solution_
private

Vector of the variable to plot.

Definition at line 62 of file hpExtension.hh.

◆ spc_

template<typename F , typename G = typename concepts::Realtype<F>::type>
concepts::AdaptiveSpace<G, concepts::AdaptiveAdjustP<3> >& hp3D::RefineOrRaise< F, G >::spc_
private

Space.

Definition at line 64 of file hpExtension.hh.

◆ theta_

template<typename F , typename G = typename concepts::Realtype<F>::type>
const Real hp3D::RefineOrRaise< F, G >::theta_
private

Decision parameter.

Definition at line 66 of file hpExtension.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich