Given a elliptic equation: More...

#include <explicitResidual.hh>

Inheritance diagram for hp2D::ExplicitResidual2D< F >:
concepts::ExplicitResidual< F > concepts::LocalEstimator< F > concepts::Estimator< F > concepts::PiecewiseFormulaBase< F > concepts::OutputOperator concepts::ElementFormula< F, concepts::Realtype< F >::type > concepts::Cloneable concepts::OutputOperator

Classes

class  Distance
 Weight class for 2d Elements. More...
 
class  EdgeWeight
 Weight class for 1d Elements. More...
 

Public Types

typedef HashMap< Real >::const_iterator const_iterator
 
typedef concepts::Realtype< F >::type G
 
typedef HashMap< Real >::iterator iterator
 
typedef F value_type
 
enum  weight { DIAM, DIAM_HP, DIAM_P }
 

Public Member Functions

void addHNData (const Set< uint > &nSet)
 Add attributes for homogen neumann boundary conditions. More...
 
void addHNData (uint attrb)
 
void addINData (const Set< uint > &nSet, concepts::ElementFormulaContainer< F > frm)
 Add inhomogen Neumanndata if exist. More...
 
iterator begin ()
 
const_iterator begin () const
 
virtual ExplicitResidual2D< F > * clone () const
 Virtual constructor. More...
 
virtual ElementFormula< F, concepts::Realtype< F >::type > * clone () const=0
 Virtual copy constructor. More...
 
void compute ()
 
virtual F & dflt_value ()
 Gives default value. More...
 
virtual const F & dflt_value () const
 Gives default value. More...
 
iterator end ()
 
const_iterator end () const
 
 ExplicitResidual2D (const concepts::SpaceOnCells< F > &spc, const concepts::Vector< F > &sol, const concepts::ElementFormulaContainer< F > res, const concepts::ElementFormulaContainer< F > *a=0, bool square=false, enum weight w=DIAM, Real alpha=0)
 Constructor of the 2d explicit residual a posteriori Error estimator. More...
 
const Real getGlobal () const
 
uint nelm () const
 
virtual const Real operator() () const
 
virtual F operator() (const Connector &cntr, const Real p, const Real t=0.0) const
 Gives the value in an particular cell on a particular point. More...
 
virtual F operator() (const Connector &cntr, const Real2d &p, const Real t=0.0) const
 
virtual F operator() (const Connector &cntr, const Real3d &p, const Real t=0.0) const
 
virtual F operator() (const ElementWithCell< concepts::Realtype< F >::type > &elm, const Real p, const Real t=0.0) const=0
 Evaluates the formula. More...
 
virtual F operator() (const ElementWithCell< concepts::Realtype< F >::type > &elm, const Real2d &p, const Real t=0.0) const=0
 Evaluates the formula. More...
 
virtual F operator() (const ElementWithCell< concepts::Realtype< F >::type > &elm, const Real3d &p, const Real t=0.0) const=0
 Evaluates the formula. More...
 
virtual F operator() (const ElementWithCell< G > &elm, const Real p, const Real t=0.0) const
 
virtual F operator() (const ElementWithCell< G > &elm, const Real2d &p, const Real t=0.0) const
 
virtual F operator() (const ElementWithCell< G > &elm, const Real3d &p, const Real t=0.0) const
 
const Real operator() (uint key) const
 Return the error on given local element, that belongs to the input key. More...
 
virtual ~ExplicitResidual2D ()
 

Protected Member Functions

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

Protected Attributes

Sequence< ElementFormulaContainer< F > > frms_
 
Real globError_
 
Set< uint > hNAttrbs_
 
Sequence< Set< uint > > iNAttrbs_
 
concepts::HashMap< Real > locError_
 
const ElementFormulaContainer< F > res_
 
const concepts::Vector< F > & sol_
 
const concepts::SpaceOnCells< F > & spc_
 

Private Member Functions

virtual void computeError_ (const concepts::ElementFormulaContainer< F > &res, concepts::HashMap< Real > &jumpResidual)
 
virtual void computeJumpPart_ (concepts::HashMap< Real > &jumpResidual) const
 

Private Attributes

const concepts::ElementFormulaContainer< F > * a_
 
concepts::Set< uint > allNattrb_
 
Real alpha_
 
dflt_value_
 default value More...
 
bool square_
 
enum weight weight_
 

Detailed Description

template<class F>
class hp2D::ExplicitResidual2D< F >

Given a elliptic equation:

     Lu = f  in \Omega
    u = 0  on \Gamma_D  (Dirichletboundary)

\partial_n u = g on \Gamma_N (Neumannboundary)

Let highest order operator be given as div(alpha(x,y)*grad(.)), so consider isotropic case.

For more general case div ( IK * grad(.) ), one may think of a diffusion-tensor IK, this class is not builded up so far. MatrixFormulas will be needed. We just consider the special case IK = I*alpha so far.

Remarks
Interior edges are assumed to have attribute zero only. Boundary edges are assumed to have non zero attribute.

Given a FEM solution u_h, the error estimator local on a element K becomes

eta_K^2 := w_K^2*||f-Lu_h||_L^2(K)^2

  • sum\limits_{E \subset \partial K\ w_E*||[[n^T * alpha grad u_h]]_K||_L^2(E)^2

where [[.]]_K is defined as [[.]] local on a element K where

 { [n^T * alpha grad u_h]     on inner edges E (i.e two underylying Elements)

[[v]] = { g - [n^T * alpha grad u_h] on neumann edges E (one underlying Element) { 0 on dirichlet boundary

while [.] denotes the jump and grad_n the normal derivative.

As weight w_K we may choose

  • w_K= diam(K)
  • w_K= diam(K)/(1+p_K) where p_K is minimum polynomial degree along one direction.

For weight w_E we may choose

  • w_E = diam(E)/2
  • w_E= diam(E)/2*(1+p_E) where p_E is polynomial degree along the Edge E.

The second weights are motivated from : An hp-Efficient Residual-Based A Posteriori Error Estimator for Maxwell’s Equations, Markus Bürg

and the inverse polynomial Interpolation estimates within. They may have to be taken with care for reliably error estimator, this is not checked.

Author
Robert Gruhlke, 2014

Definition at line 169 of file explicitResidual.hh.

Member Typedef Documentation

◆ const_iterator

template<class F >
typedef HashMap<Real>::const_iterator concepts::LocalEstimator< F >::const_iterator
inherited

Definition at line 96 of file estimator.hh.

◆ G

template<typename F >
typedef concepts::Realtype<F>::type concepts::PiecewiseFormulaBase< F >::G
inherited

Definition at line 45 of file piecewiseFormula.hh.

◆ iterator

template<class F >
typedef HashMap<Real>::iterator concepts::LocalEstimator< F >::iterator
inherited

Definition at line 95 of file estimator.hh.

◆ value_type

typedef F concepts::ElementFormula< F, concepts::Realtype< F >::type >::value_type
inherited

Definition at line 37 of file elementFormula.hh.

Member Enumeration Documentation

◆ weight

template<class F >
enum hp2D::ExplicitResidual2D::weight
Enumerator
DIAM 
DIAM_HP 
DIAM_P 

Definition at line 187 of file explicitResidual.hh.

Constructor & Destructor Documentation

◆ ExplicitResidual2D()

template<class F >
hp2D::ExplicitResidual2D< F >::ExplicitResidual2D ( const concepts::SpaceOnCells< F > &  spc,
const concepts::Vector< F > &  sol,
const concepts::ElementFormulaContainer< F >  res,
const concepts::ElementFormulaContainer< F > *  a = 0,
bool  square = false,
enum weight  w = DIAM,
Real  alpha = 0 
)

Constructor of the 2d explicit residual a posteriori Error estimator.

Parameters
spcThe FEM space
solthe solution vector representing the FEM solution
resThe residual formula, res = f-Lu_h
aThe coefficient function in the highest derivative operator div ( a * grad(.)) if no function a is given, by default a is const and therefore set to ONE.
squareAddition flag information marking that all Elements in the space are squared, this increases the diameter computation time.
weightform of the weight for the local contributions
alpha\in [0,1] exponent of the weight in the error estimator, only comes into account for weight w = DIAM_HP

◆ ~ExplicitResidual2D()

template<class F >
virtual hp2D::ExplicitResidual2D< F >::~ExplicitResidual2D ( )
inlinevirtual

Definition at line 215 of file explicitResidual.hh.

Member Function Documentation

◆ addHNData() [1/2]

template<class F >
void concepts::ExplicitResidual< F >::addHNData ( const Set< uint > &  nSet)
inlineinherited

Add attributes for homogen neumann boundary conditions.

Definition at line 41 of file explicitResidual.hh.

◆ addHNData() [2/2]

template<class F >
void concepts::ExplicitResidual< F >::addHNData ( uint  attrb)
inlineinherited

Definition at line 44 of file explicitResidual.hh.

◆ addINData()

template<class F >
void concepts::ExplicitResidual< F >::addINData ( const Set< uint > &  nSet,
concepts::ElementFormulaContainer< F >  frm 
)
inlineinherited

Add inhomogen Neumanndata if exist.

This is needed for computing the jump terms

Definition at line 33 of file explicitResidual.hh.

◆ begin() [1/2]

template<class F >
iterator concepts::LocalEstimator< F >::begin ( )
inlineinherited

Definition at line 100 of file estimator.hh.

◆ begin() [2/2]

template<class F >
const_iterator concepts::LocalEstimator< F >::begin ( ) const
inlineinherited

Definition at line 104 of file estimator.hh.

◆ clone() [1/2]

template<class F >
virtual ExplicitResidual2D<F>* hp2D::ExplicitResidual2D< F >::clone ( ) const
inlinevirtual

Virtual constructor.

Returns a pointer to a copy of itself. The caller is responsible to destroy this copy.

Implements concepts::ExplicitResidual< F >.

Definition at line 332 of file explicitResidual.hh.

◆ clone() [2/2]

virtual ElementFormula<F,concepts::Realtype< F >::type >* concepts::ElementFormula< F, concepts::Realtype< F >::type >::clone ( ) const
pure virtualinherited

Virtual copy constructor.

◆ compute()

template<class F >
void hp2D::ExplicitResidual2D< F >::compute ( )

◆ computeError_()

template<class F >
virtual void hp2D::ExplicitResidual2D< F >::computeError_ ( const concepts::ElementFormulaContainer< F > &  res,
concepts::HashMap< Real > &  jumpResidual 
)
privatevirtual

◆ computeJumpPart_()

template<class F >
virtual void hp2D::ExplicitResidual2D< F >::computeJumpPart_ ( concepts::HashMap< Real > &  jumpResidual) const
privatevirtual

◆ dflt_value() [1/2]

template<typename F >
virtual F& concepts::PiecewiseFormulaBase< F >::dflt_value ( )
inlinevirtualinherited

Gives default value.

Definition at line 83 of file piecewiseFormula.hh.

◆ dflt_value() [2/2]

template<typename F >
virtual const F& concepts::PiecewiseFormulaBase< F >::dflt_value ( ) const
inlinevirtualinherited

Gives default value.

Definition at line 81 of file piecewiseFormula.hh.

◆ end() [1/2]

template<class F >
iterator concepts::LocalEstimator< F >::end ( )
inlineinherited

Definition at line 108 of file estimator.hh.

◆ end() [2/2]

template<class F >
const_iterator concepts::LocalEstimator< F >::end ( ) const
inlineinherited

Definition at line 112 of file estimator.hh.

◆ getGlobal()

template<typename F >
const Real concepts::Estimator< F >::getGlobal ( ) const
inlineinherited

Definition at line 22 of file estimator.hh.

◆ info()

template<class F >
virtual std::ostream& hp2D::ExplicitResidual2D< F >::info ( std::ostream &  os) const
inlineprotectedvirtual

Returns information in an output stream.

Reimplemented from concepts::ExplicitResidual< F >.

Definition at line 335 of file explicitResidual.hh.

◆ nelm()

template<class F >
uint concepts::LocalEstimator< F >::nelm ( ) const
inlineinherited

Definition at line 116 of file estimator.hh.

◆ operator()() [1/11]

template<class F >
virtual const Real hp2D::ExplicitResidual2D< F >::operator() ( ) const
inlinevirtual

Definition at line 330 of file explicitResidual.hh.

◆ operator()() [2/11]

template<class F >
virtual F concepts::LocalEstimator< F >::operator() ( const Connector cntr,
const Real  p,
const Real  t = 0.0 
) const
inlinevirtualinherited

Gives the value in an particular cell on a particular point.

Parameters
celltopological cell
pphysical coordinates
ttime

Implements concepts::PiecewiseFormulaBase< F >.

Definition at line 132 of file estimator.hh.

◆ operator()() [3/11]

template<class F >
virtual F concepts::LocalEstimator< F >::operator() ( const Connector cntr,
const Real2d p,
const Real  t = 0.0 
) const
inlinevirtualinherited

Implements concepts::PiecewiseFormulaBase< F >.

Definition at line 135 of file estimator.hh.

◆ operator()() [4/11]

template<class F >
virtual F concepts::LocalEstimator< F >::operator() ( const Connector cntr,
const Real3d p,
const Real  t = 0.0 
) const
inlinevirtualinherited

Implements concepts::PiecewiseFormulaBase< F >.

Definition at line 138 of file estimator.hh.

◆ operator()() [5/11]

virtual F concepts::ElementFormula< F, concepts::Realtype< F >::type >::operator() ( const ElementWithCell< G > &  elm,
const Real  p,
const Real  t = 0.0 
) const
pure virtualinherited

Evaluates the formula.

Parameters
elmElement
pPoint in space in local element coordinates
tPoint in time

◆ operator()() [6/11]

virtual F concepts::ElementFormula< F, concepts::Realtype< F >::type >::operator() ( const ElementWithCell< G > &  elm,
const Real2d p,
const Real  t = 0.0 
) const
pure virtualinherited

Evaluates the formula.

Parameters
elmElement
pPoint in space in local element coordinates
tPoint in time

◆ operator()() [7/11]

virtual F concepts::ElementFormula< F, concepts::Realtype< F >::type >::operator() ( const ElementWithCell< G > &  elm,
const Real3d p,
const Real  t = 0.0 
) const
pure virtualinherited

Evaluates the formula.

Parameters
elmElement
pPoint in space in local element coordinates
tPoint in time

◆ operator()() [8/11]

template<typename F >
virtual F concepts::PiecewiseFormulaBase< F >::operator() ( const ElementWithCell< G > &  elm,
const Real  p,
const Real  t = 0.0 
) const
inlinevirtualinherited

Definition at line 52 of file piecewiseFormula.hh.

◆ operator()() [9/11]

template<typename F >
virtual F concepts::PiecewiseFormulaBase< F >::operator() ( const ElementWithCell< G > &  elm,
const Real2d p,
const Real  t = 0.0 
) const
inlinevirtualinherited

Definition at line 57 of file piecewiseFormula.hh.

◆ operator()() [10/11]

template<typename F >
virtual F concepts::PiecewiseFormulaBase< F >::operator() ( const ElementWithCell< G > &  elm,
const Real3d p,
const Real  t = 0.0 
) const
inlinevirtualinherited

Definition at line 63 of file piecewiseFormula.hh.

◆ operator()() [11/11]

template<class F >
const Real concepts::LocalEstimator< F >::operator() ( uint  key) const
inlineinherited

Return the error on given local element, that belongs to the input key.

Definition at line 123 of file estimator.hh.

Member Data Documentation

◆ a_

template<class F >
const concepts::ElementFormulaContainer<F>* hp2D::ExplicitResidual2D< F >::a_
private

Definition at line 344 of file explicitResidual.hh.

◆ allNattrb_

template<class F >
concepts::Set<uint> hp2D::ExplicitResidual2D< F >::allNattrb_
private

Definition at line 352 of file explicitResidual.hh.

◆ alpha_

template<class F >
Real hp2D::ExplicitResidual2D< F >::alpha_
private

Definition at line 349 of file explicitResidual.hh.

◆ dflt_value_

template<typename F >
F concepts::PiecewiseFormulaBase< F >::dflt_value_
privateinherited

default value

Definition at line 88 of file piecewiseFormula.hh.

◆ frms_

template<class F >
Sequence<ElementFormulaContainer<F> > concepts::ExplicitResidual< F >::frms_
protectedinherited

Definition at line 77 of file explicitResidual.hh.

◆ globError_

template<typename F >
Real concepts::Estimator< F >::globError_
protectedinherited

Definition at line 37 of file estimator.hh.

◆ hNAttrbs_

template<class F >
Set<uint> concepts::ExplicitResidual< F >::hNAttrbs_
protectedinherited

Definition at line 81 of file explicitResidual.hh.

◆ iNAttrbs_

template<class F >
Sequence<Set<uint> > concepts::ExplicitResidual< F >::iNAttrbs_
protectedinherited

Definition at line 79 of file explicitResidual.hh.

◆ locError_

template<class F >
concepts::HashMap<Real> concepts::LocalEstimator< F >::locError_
protectedinherited

Definition at line 151 of file estimator.hh.

◆ res_

template<class F >
const ElementFormulaContainer<F> concepts::ExplicitResidual< F >::res_
protectedinherited

Definition at line 74 of file explicitResidual.hh.

◆ sol_

template<typename F >
const concepts::Vector<F>& concepts::Estimator< F >::sol_
protectedinherited

Definition at line 35 of file estimator.hh.

◆ spc_

template<typename F >
const concepts::SpaceOnCells<F>& concepts::Estimator< F >::spc_
protectedinherited

Definition at line 33 of file estimator.hh.

◆ square_

template<class F >
bool hp2D::ExplicitResidual2D< F >::square_
private

Definition at line 342 of file explicitResidual.hh.

◆ weight_

template<class F >
enum weight hp2D::ExplicitResidual2D< F >::weight_
private

Definition at line 344 of file explicitResidual.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