OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::ErrorEstimator Class Referenceabstract

The base class for all error estimation or error indicator algorithms. More...

#include <errorestimator.h>

+ Inheritance diagram for oofem::ErrorEstimator:
+ Collaboration diagram for oofem::ErrorEstimator:

Public Member Functions

 ErrorEstimator (int n, Domain *d)
 Constructor. More...
 
virtual ~ErrorEstimator ()
 Destructor. More...
 
void setDomain (Domain *d)
 Sets Domain; should also re-initialize attributes if necessary. More...
 
virtual double giveElementError (EE_ErrorType type, Element *elem, TimeStep *tStep)=0
 Returns the element error. More...
 
virtual double giveValue (EE_ValueType type, TimeStep *tStep)=0
 Returns the characteristic value of given type. More...
 
int giveNumberOfSkippedElements ()
 Returns number of elements skipped in error estimation. More...
 
virtual int estimateError (EE_ErrorMode mode, TimeStep *tStep)=0
 Estimates the error on associated domain at given time step. More...
 
virtual RemeshingCriteriagiveRemeshingCrit ()=0
 Returns reference to associated remeshing criteria. More...
 
ErrorEstimatorType giveErrorEstimatorType () const
 Returns error estimation type of receiver. More...
 
bool skipRegion (int reg)
 Returns nonzero if region has been skipped in error estimation (user option). More...
 
virtual void reinitialize ()
 
virtual IRResultType initializeFrom (InputRecord *ir)
 Initializes receiver according to object description stored in input record. More...
 
virtual const char * giveInputRecordName () const
 
- Public Member Functions inherited from oofem::FEMComponent
 FEMComponent (int n, Domain *d)
 Regular constructor, creates component with given number and belonging to given domain. More...
 
virtual ~FEMComponent ()
 Virtual destructor. More...
 
virtual const char * giveClassName () const =0
 
DomaingiveDomain () const
 
int giveNumber () const
 
void setNumber (int num)
 Sets number of receiver. More...
 
virtual void updateLocalNumbering (EntityRenumberingFunctor &f)
 Local renumbering support. More...
 
virtual void giveInputRecord (DynamicInputRecord &input)
 Setups the input record string of receiver. More...
 
virtual contextIOResultType saveContext (DataStream &stream, ContextMode mode, void *obj=NULL)
 Stores receiver state to output stream. More...
 
virtual contextIOResultType restoreContext (DataStream &stream, ContextMode mode, void *obj=NULL)
 Restores the receiver state previously written in stream. More...
 
virtual int checkConsistency ()
 Allows programmer to test some internal data, before computation begins. More...
 
virtual void printOutputAt (FILE *file, TimeStep *tStep)
 Prints output of receiver to stream, for given time step. More...
 
virtual void printYourself ()
 Prints receiver state on stdout. Useful for debugging. More...
 
virtual InterfacegiveInterface (InterfaceType t)
 Interface requesting service. More...
 
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros). More...
 

Protected Attributes

ErrorEstimatorType eeType
 
std::unique_ptr< RemeshingCriteriarc
 
IntArray regionSkipMap
 Map indicating regions to skip (region - cross section model). More...
 
int skippedNelems
 Number of skipped elements. More...
 
InternalStateType IStype
 Internal state type of variable to get internal forces. More...
 
- Protected Attributes inherited from oofem::FEMComponent
int number
 Component number. More...
 
Domaindomain
 Link to domain object, useful for communicating with other FEM components. More...
 

Detailed Description

The base class for all error estimation or error indicator algorithms.

The basic task is to evaluate the error on associated domain. If this task requires the special element algorithms, these should be included using interface concept.

This estimator should also provide the compatible Remeshing Criteria class, which based on various error measures will evaluate the required mesh density of a new domain.

Definition at line 80 of file errorestimator.h.

Constructor & Destructor Documentation

oofem::ErrorEstimator::ErrorEstimator ( int  n,
Domain d 
)

Constructor.

Definition at line 40 of file errorestimator.C.

References oofem::IntArray::clear(), regionSkipMap, and skippedNelems.

oofem::ErrorEstimator::~ErrorEstimator ( )
virtual

Destructor.

Definition at line 46 of file errorestimator.C.

Member Function Documentation

virtual int oofem::ErrorEstimator::estimateError ( EE_ErrorMode  mode,
TimeStep tStep 
)
pure virtual

Estimates the error on associated domain at given time step.

The estimated values can be requested using giveElementError and giveValue methods. The type of errors provided depends on error estimator type implementing the service.

Parameters
modeError mode.
tStepTime step.

Implemented in oofem::HuertaErrorEstimator, oofem::ZZErrorEstimator, oofem::MeshQualityErrorEstimator, oofem::CombinedZZSIErrorEstimator, and oofem::ScalarErrorIndicator.

Referenced by oofem::AdaptiveNonLinearStatic::solveYourselfAt(), oofem::AdaptiveLinearStatic::updateYourself(), and oofem::EngngModel::updateYourself().

virtual double oofem::ErrorEstimator::giveElementError ( EE_ErrorType  type,
Element elem,
TimeStep tStep 
)
pure virtual
ErrorEstimatorType oofem::ErrorEstimator::giveErrorEstimatorType ( ) const
inline

Returns error estimation type of receiver.

Definition at line 142 of file errorestimator.h.

Referenced by oofem::HuertaRemeshingCriteria::estimateMeshDensities().

virtual const char* oofem::ErrorEstimator::giveInputRecordName ( ) const
inlinevirtual
Returns
Input record name of the receiver.

Implements oofem::FEMComponent.

Reimplemented in oofem::HuertaErrorEstimator, and oofem::CombinedZZSIErrorEstimator.

Definition at line 156 of file errorestimator.h.

int oofem::ErrorEstimator::giveNumberOfSkippedElements ( )
inline

Returns number of elements skipped in error estimation.

Returns
Number of skipped elements.

Definition at line 125 of file errorestimator.h.

Referenced by oofem::HuertaRemeshingCriteria::estimateMeshDensities().

virtual double oofem::ErrorEstimator::giveValue ( EE_ValueType  type,
TimeStep tStep 
)
pure virtual

Returns the characteristic value of given type.

The estimateError service should be called before. This method is supposed to be used by associated remeshingCriteria to access some characteristic values already computed or known at error estimator level.

Parameters
typeError type.
tStepTime step.
Returns
Error value for given type.

Implemented in oofem::HuertaErrorEstimator, oofem::ZZErrorEstimator, oofem::MeshQualityErrorEstimator, oofem::ScalarErrorIndicator, and oofem::CombinedZZSIErrorEstimator.

Referenced by oofem::ZZRemeshingCriteria::estimateMeshDensities(), oofem::HuertaRemeshingCriteria::estimateMeshDensities(), and oofem::AdaptiveLinearStatic::printOutputAt().

IRResultType oofem::ErrorEstimator::initializeFrom ( InputRecord ir)
virtual

Initializes receiver according to object description stored in input record.

This function is called immediately after creating object using constructor. Input record can be imagined as data record in component database belonging to receiver. Receiver may use value-name extracting functions to extract particular field from record.

See also
IR_GIVE_FIELD
IR_GIVE_OPTIONAL_FIELD
Parameters
irInput record to initialize from.
Returns
IRResultType

Reimplemented from oofem::FEMComponent.

Reimplemented in oofem::HuertaErrorEstimator, oofem::ZZErrorEstimator, oofem::MeshQualityErrorEstimator, oofem::ScalarErrorIndicator, and oofem::CombinedZZSIErrorEstimator.

Definition at line 60 of file errorestimator.C.

References _IFT_ErrorEstimator_IStype, _IFT_ErrorEstimator_regionskipmap, oofem::IntArray::clear(), IR_GIVE_OPTIONAL_FIELD, oofem::IRRT_OK, IStype, and regionSkipMap.

Referenced by oofem::ScalarErrorIndicator::initializeFrom(), oofem::MeshQualityErrorEstimator::initializeFrom(), oofem::ZZErrorEstimator::initializeFrom(), oofem::HuertaErrorEstimator::initializeFrom(), and oofem::EngngModel::initializeFrom().

void oofem::ErrorEstimator::reinitialize ( )
virtual
void oofem::ErrorEstimator::setDomain ( Domain d)
virtual
bool oofem::ErrorEstimator::skipRegion ( int  reg)

Returns nonzero if region has been skipped in error estimation (user option).

It is strongly recommended to use this function, instead of direct access to regionSkipMap variable by derived classes, since the size check is done here.

Parameters
regRegion to check.
Returns
True if region should be skipped.

Definition at line 79 of file errorestimator.C.

References oofem::IntArray::at(), oofem::IntArray::giveSize(), and regionSkipMap.

Referenced by oofem::ZZErrorEstimator::estimateError(), oofem::HuertaErrorEstimator::estimateError(), oofem::ZZRemeshingCriteria::estimateMeshDensities(), oofem::ScalarErrorIndicator::giveElementError(), and oofem::ZZErrorEstimator::giveElementError().

Member Data Documentation

InternalStateType oofem::ErrorEstimator::IStype
protected

Internal state type of variable to get internal forces.

Definition at line 95 of file errorestimator.h.

Referenced by oofem::ZZErrorEstimator::estimateError(), and initializeFrom().

IntArray oofem::ErrorEstimator::regionSkipMap
protected

Map indicating regions to skip (region - cross section model).

Do not access this variable directly, since this variable is read from input and could have size different from actual number of regions - use always the skipRegion method, since it performs size check. and handles all regions correctly.

Definition at line 91 of file errorestimator.h.

Referenced by ErrorEstimator(), initializeFrom(), and skipRegion().

int oofem::ErrorEstimator::skippedNelems
protected

Number of skipped elements.

Definition at line 93 of file errorestimator.h.

Referenced by ErrorEstimator(), and oofem::HuertaErrorEstimator::estimateError().


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:35 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011