ug4
ug::IElemEstimatorFuncs< TLeaf, TDomain > Class Template Reference

This class encapsulates all functions related to error estimation. More...

#include <elem_disc_interface.h>

Public Types

typedef TDomain domain_type
 Domain type. More...
 
typedef TLeaf leaf_type
 Barton Nackman trick (TODO: needed?) More...
 

Public Member Functions

TLeaf & asLeaf ()
 
void check_roid (ReferenceObjectID roid, int discType)
 check, if all inputs have been set More...
 
virtual void compute_err_est_A_elem (const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const number &scale)
 virtual compute the error estimator (stiffness part) contribution for one element More...
 
virtual void compute_err_est_M_elem (const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const number &scale)
 virtual compute the error estimator (mass part) contribution for one element More...
 
virtual void compute_err_est_rhs_elem (GridObject *elem, const MathVector< dim > vCornerCoords[], const number &scale)
 virtual compute the error estimator (rhs part) contribution for one element More...
 
void do_compute_err_est_A_elem (LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const number &scale)
 
void do_compute_err_est_M_elem (LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const number &scale)
 
void do_compute_err_est_rhs_elem (GridObject *elem, const MathVector< dim > vCornerCoords[], const number &scale)
 
void do_fsh_err_est_elem_loop ()
 
void do_prep_err_est_elem (LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
 
void do_prep_err_est_elem_loop (const ReferenceObjectID roid, const int si)
 
virtual SmartPtr< IErrEstData< TDomain > > err_est_data ()
 returns the pointer to the error estimator data object (or NULL) More...
 
bool err_est_enabled () const
 find out whether or not a posteriori error estimation is to be performed for this disc More...
 
virtual void fsh_err_est_elem_loop ()
 virtual postprocesses the loop over all elements of one type in the computation of the error estimator More...
 
 IElemEstimatorFuncs ()
 constructor More...
 
virtual void prep_err_est_elem (const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
 virtual prepares the loop over all elements of one type for the computation of the error estimator More...
 
virtual void prep_err_est_elem_loop (const ReferenceObjectID roid, const int si)
 virtual prepares the loop over all elements of one type for the computation of the error estimator More...
 
void set_error_estimator (SmartPtr< IErrEstData< TDomain > > ee)
 sets the pointer to an error estimator data object (or NULL) More...
 
void set_roid (ReferenceObjectID id, int discType)
 sets the geometric object type More...
 
virtual ~IElemEstimatorFuncs ()
 Virtual destructor. More...
 

Static Public Attributes

static const int dim = TDomain::dim
 World dimension. More...
 

Protected Member Functions

void clear_add_fct ()
 sets all assemble functions to NULL (for all ReferenceObjectID's) More...
 
void clear_add_fct (ReferenceObjectID id)
 sets all assemble functions to NULL for a given ReferenceObjectID More...
 
void remove_compute_err_est_A_elem (ReferenceObjectID id)
 
void remove_compute_err_est_M_elem (ReferenceObjectID id)
 
void remove_compute_err_est_rhs_elem (ReferenceObjectID id)
 
void remove_fsh_err_est_elem_loop (ReferenceObjectID id)
 
void remove_prep_err_est_elem (ReferenceObjectID id)
 
void remove_prep_err_est_elem_loop (ReferenceObjectID id)
 
template<typename TAssFunc >
void set_compute_err_est_A_elem (ReferenceObjectID id, TAssFunc func)
 
template<typename TAssFunc >
void set_compute_err_est_M_elem (ReferenceObjectID id, TAssFunc func)
 
template<typename TAssFunc >
void set_compute_err_est_rhs_elem (ReferenceObjectID id, TAssFunc func)
 
void set_default_add_fct ()
 sets all assemble functions to the corresponding virtual ones More...
 
template<typename TAssFunc >
void set_fsh_err_est_elem_loop (ReferenceObjectID id, TAssFunc func)
 
template<typename TAssFunc >
void set_prep_err_est_elem (ReferenceObjectID id, TAssFunc func)
 
template<typename TAssFunc >
void set_prep_err_est_elem_loop (ReferenceObjectID id, TAssFunc func)
 

Protected Attributes

ReferenceObjectID m_roid
 current Geometric Object More...
 
SmartPtr< IErrEstData< TDomain > > m_spErrEstData
 error estimation object associated to the element discretization More...
 

Private Types

typedef void(T::* ElemComputeErrEstAFct) (const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const number &)
 
typedef void(T::* ElemComputeErrEstMFct) (const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const number &)
 
typedef void(T::* ElemComputeErrEstRhsFct) (GridObject *elem, const MathVector< dim > vCornerCoords[], const number &)
 
typedef void(T::* FinishErrEstElemLoopFct) ()
 
typedef void(T::* PrepareErrEstElemFct) (const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
 
typedef void(T::* PrepareErrEstElemLoopFct) (ReferenceObjectID roid, int si)
 
typedef IElemEstimatorFuncs< TLeaf, TDomain > T
 

Private Attributes

bool m_bDoErrEst
 flag indicating whether or not a posteriori error estimation is to be performed for this disc More...
 
ElemComputeErrEstAFct m_vElemComputeErrEstAFct [NUM_REFERENCE_OBJECTS]
 
ElemComputeErrEstMFct m_vElemComputeErrEstMFct [NUM_REFERENCE_OBJECTS]
 
ElemComputeErrEstRhsFct m_vElemComputeErrEstRhsFct [NUM_REFERENCE_OBJECTS]
 
FinishErrEstElemLoopFct m_vFinishErrEstElemLoopFct [NUM_REFERENCE_OBJECTS]
 
PrepareErrEstElemFct m_vPrepareErrEstElemFct [NUM_REFERENCE_OBJECTS]
 
PrepareErrEstElemLoopFct m_vPrepareErrEstElemLoopFct [NUM_REFERENCE_OBJECTS]
 

Detailed Description

template<typename TLeaf, typename TDomain>
class ug::IElemEstimatorFuncs< TLeaf, TDomain >

This class encapsulates all functions related to error estimation.

Member Typedef Documentation

◆ domain_type

template<typename TLeaf , typename TDomain >
typedef TDomain ug::IElemEstimatorFuncs< TLeaf, TDomain >::domain_type

Domain type.

◆ ElemComputeErrEstAFct

template<typename TLeaf , typename TDomain >
typedef void(T::* ug::IElemEstimatorFuncs< TLeaf, TDomain >::ElemComputeErrEstAFct) (const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const number &)
private

◆ ElemComputeErrEstMFct

template<typename TLeaf , typename TDomain >
typedef void(T::* ug::IElemEstimatorFuncs< TLeaf, TDomain >::ElemComputeErrEstMFct) (const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const number &)
private

◆ ElemComputeErrEstRhsFct

template<typename TLeaf , typename TDomain >
typedef void(T::* ug::IElemEstimatorFuncs< TLeaf, TDomain >::ElemComputeErrEstRhsFct) (GridObject *elem, const MathVector< dim > vCornerCoords[], const number &)
private

◆ FinishErrEstElemLoopFct

template<typename TLeaf , typename TDomain >
typedef void(T::* ug::IElemEstimatorFuncs< TLeaf, TDomain >::FinishErrEstElemLoopFct) ()
private

◆ leaf_type

template<typename TLeaf , typename TDomain >
typedef TLeaf ug::IElemEstimatorFuncs< TLeaf, TDomain >::leaf_type

Barton Nackman trick (TODO: needed?)

◆ PrepareErrEstElemFct

template<typename TLeaf , typename TDomain >
typedef void(T::* ug::IElemEstimatorFuncs< TLeaf, TDomain >::PrepareErrEstElemFct) (const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
private

◆ PrepareErrEstElemLoopFct

template<typename TLeaf , typename TDomain >
typedef void(T::* ug::IElemEstimatorFuncs< TLeaf, TDomain >::PrepareErrEstElemLoopFct) (ReferenceObjectID roid, int si)
private

◆ T

template<typename TLeaf , typename TDomain >
typedef IElemEstimatorFuncs<TLeaf, TDomain> ug::IElemEstimatorFuncs< TLeaf, TDomain >::T
private

Constructor & Destructor Documentation

◆ IElemEstimatorFuncs()

template<typename TLeaf , typename TDomain >
ug::IElemEstimatorFuncs< TLeaf, TDomain >::IElemEstimatorFuncs ( )
inline

◆ ~IElemEstimatorFuncs()

template<typename TLeaf , typename TDomain >
virtual ug::IElemEstimatorFuncs< TLeaf, TDomain >::~IElemEstimatorFuncs ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ asLeaf()

template<typename TLeaf , typename TDomain >
TLeaf& ug::IElemEstimatorFuncs< TLeaf, TDomain >::asLeaf ( )
inline

◆ check_roid()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::check_roid ( ReferenceObjectID  roid,
int  discType 
)

check, if all inputs have been set

◆ clear_add_fct() [1/2]

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::clear_add_fct
protected

sets all assemble functions to NULL (for all ReferenceObjectID's)

◆ clear_add_fct() [2/2]

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::clear_add_fct ( ReferenceObjectID  id)
protected

sets all assemble functions to NULL for a given ReferenceObjectID

◆ compute_err_est_A_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::compute_err_est_A_elem ( const LocalVector u,
GridObject elem,
const MathVector< dim vCornerCoords[],
const number scale 
)
virtual

◆ compute_err_est_M_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::compute_err_est_M_elem ( const LocalVector u,
GridObject elem,
const MathVector< dim vCornerCoords[],
const number scale 
)
virtual

◆ compute_err_est_rhs_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::compute_err_est_rhs_elem ( GridObject elem,
const MathVector< dim vCornerCoords[],
const number scale 
)
virtual

◆ do_compute_err_est_A_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::do_compute_err_est_A_elem ( LocalVector u,
GridObject elem,
const MathVector< dim vCornerCoords[],
const number scale 
)

◆ do_compute_err_est_M_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::do_compute_err_est_M_elem ( LocalVector u,
GridObject elem,
const MathVector< dim vCornerCoords[],
const number scale 
)

◆ do_compute_err_est_rhs_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::do_compute_err_est_rhs_elem ( GridObject elem,
const MathVector< dim vCornerCoords[],
const number scale 
)

◆ do_fsh_err_est_elem_loop()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::do_fsh_err_est_elem_loop

◆ do_prep_err_est_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::do_prep_err_est_elem ( LocalVector u,
GridObject elem,
const MathVector< dim vCornerCoords[] 
)

◆ do_prep_err_est_elem_loop()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::do_prep_err_est_elem_loop ( const ReferenceObjectID  roid,
const int  si 
)

References UG_ASSERT.

◆ err_est_data()

template<typename TLeaf , typename TDomain >
virtual SmartPtr<IErrEstData<TDomain> > ug::IElemEstimatorFuncs< TLeaf, TDomain >::err_est_data ( )
inlinevirtual

returns the pointer to the error estimator data object (or NULL)

References ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_spErrEstData.

◆ err_est_enabled()

template<typename TLeaf , typename TDomain >
bool ug::IElemEstimatorFuncs< TLeaf, TDomain >::err_est_enabled ( ) const
inline

find out whether or not a posteriori error estimation is to be performed for this disc

References ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_bDoErrEst.

◆ fsh_err_est_elem_loop()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::fsh_err_est_elem_loop
virtual

◆ prep_err_est_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::prep_err_est_elem ( const LocalVector u,
GridObject elem,
const MathVector< dim vCornerCoords[] 
)
virtual

◆ prep_err_est_elem_loop()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::prep_err_est_elem_loop ( const ReferenceObjectID  roid,
const int  si 
)
virtual

◆ remove_compute_err_est_A_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::remove_compute_err_est_A_elem ( ReferenceObjectID  id)
protected

◆ remove_compute_err_est_M_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::remove_compute_err_est_M_elem ( ReferenceObjectID  id)
protected

◆ remove_compute_err_est_rhs_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::remove_compute_err_est_rhs_elem ( ReferenceObjectID  id)
protected

◆ remove_fsh_err_est_elem_loop()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::remove_fsh_err_est_elem_loop ( ReferenceObjectID  id)
protected

◆ remove_prep_err_est_elem()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::remove_prep_err_est_elem ( ReferenceObjectID  id)
protected

◆ remove_prep_err_est_elem_loop()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::remove_prep_err_est_elem_loop ( ReferenceObjectID  id)
protected

◆ set_compute_err_est_A_elem()

template<typename TLeaf , typename TDomain >
template<typename TAssFunc >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::set_compute_err_est_A_elem ( ReferenceObjectID  id,
TAssFunc  func 
)
protected

◆ set_compute_err_est_M_elem()

template<typename TLeaf , typename TDomain >
template<typename TAssFunc >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::set_compute_err_est_M_elem ( ReferenceObjectID  id,
TAssFunc  func 
)
protected

References func().

◆ set_compute_err_est_rhs_elem()

template<typename TLeaf , typename TDomain >
template<typename TAssFunc >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::set_compute_err_est_rhs_elem ( ReferenceObjectID  id,
TAssFunc  func 
)
protected

References func().

◆ set_default_add_fct()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::set_default_add_fct
protected

sets all assemble functions to the corresponding virtual ones

References ug::NUM_REFERENCE_OBJECTS.

Referenced by ug::IElemEstimatorFuncs< TLeaf, TDomain >::IElemEstimatorFuncs().

◆ set_error_estimator()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::set_error_estimator ( SmartPtr< IErrEstData< TDomain > >  ee)
inline

sets the pointer to an error estimator data object (or NULL)

This function sets the pointer to an error estimator data object that should be used for this discretization. Note that the ElemDisc object must use RTTI to try to convert this pointer to the type of the objects accepted by it for this purpose. If the conversion fails than an exception must be thrown since this situation is not allowed.

References ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_bDoErrEst, and ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_spErrEstData.

◆ set_fsh_err_est_elem_loop()

template<typename TLeaf , typename TDomain >
template<typename TAssFunc >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::set_fsh_err_est_elem_loop ( ReferenceObjectID  id,
TAssFunc  func 
)
protected

References func().

◆ set_prep_err_est_elem()

template<typename TLeaf , typename TDomain >
template<typename TAssFunc >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::set_prep_err_est_elem ( ReferenceObjectID  id,
TAssFunc  func 
)
protected

References func().

◆ set_prep_err_est_elem_loop()

template<typename TLeaf , typename TDomain >
template<typename TAssFunc >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::set_prep_err_est_elem_loop ( ReferenceObjectID  id,
TAssFunc  func 
)
protected

◆ set_roid()

template<typename TLeaf , typename TDomain >
void ug::IElemEstimatorFuncs< TLeaf, TDomain >::set_roid ( ReferenceObjectID  id,
int  discType 
)

sets the geometric object type

This functions set the geometric object type of the object, that is assembled next. The user has to call this function before most of the assembling routines can be called. Keep in mind, that the elements are looped type by type, thus this function has to be called very few times.

References ug::ROID_UNKNOWN, and UG_THROW.

Member Data Documentation

◆ dim

template<typename TLeaf , typename TDomain >
const int ug::IElemEstimatorFuncs< TLeaf, TDomain >::dim = TDomain::dim
static

World dimension.

◆ m_bDoErrEst

template<typename TLeaf , typename TDomain >
bool ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_bDoErrEst
private

flag indicating whether or not a posteriori error estimation is to be performed for this disc

Referenced by ug::IElemEstimatorFuncs< TLeaf, TDomain >::err_est_enabled(), and ug::IElemEstimatorFuncs< TLeaf, TDomain >::set_error_estimator().

◆ m_roid

template<typename TLeaf , typename TDomain >
ReferenceObjectID ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_roid
protected

current Geometric Object

◆ m_spErrEstData

template<typename TLeaf , typename TDomain >
SmartPtr<IErrEstData<TDomain> > ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_spErrEstData
protected

error estimation object associated to the element discretization

Referenced by ug::IElemEstimatorFuncs< TLeaf, TDomain >::err_est_data(), and ug::IElemEstimatorFuncs< TLeaf, TDomain >::set_error_estimator().

◆ m_vElemComputeErrEstAFct

template<typename TLeaf , typename TDomain >
ElemComputeErrEstAFct ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_vElemComputeErrEstAFct[NUM_REFERENCE_OBJECTS]
private

◆ m_vElemComputeErrEstMFct

template<typename TLeaf , typename TDomain >
ElemComputeErrEstMFct ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_vElemComputeErrEstMFct[NUM_REFERENCE_OBJECTS]
private

◆ m_vElemComputeErrEstRhsFct

template<typename TLeaf , typename TDomain >
ElemComputeErrEstRhsFct ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_vElemComputeErrEstRhsFct[NUM_REFERENCE_OBJECTS]
private

◆ m_vFinishErrEstElemLoopFct

template<typename TLeaf , typename TDomain >
FinishErrEstElemLoopFct ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_vFinishErrEstElemLoopFct[NUM_REFERENCE_OBJECTS]
private

◆ m_vPrepareErrEstElemFct

template<typename TLeaf , typename TDomain >
PrepareErrEstElemFct ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_vPrepareErrEstElemFct[NUM_REFERENCE_OBJECTS]
private

◆ m_vPrepareErrEstElemLoopFct

template<typename TLeaf , typename TDomain >
PrepareErrEstElemLoopFct ug::IElemEstimatorFuncs< TLeaf, TDomain >::m_vPrepareErrEstElemLoopFct[NUM_REFERENCE_OBJECTS]
private

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