35 #include "../sm/ErrorEstimators/zzerrorestimator.h" 36 #include "../sm/Elements/structuralelement.h" 37 #include "../sm/Materials/structuralmaterial.h" 75 type = IST_StressTensorTemp;
101 #ifdef ZZErrorEstimator_ElementResultCashed 104 sNorms.resize(nelems);
112 for (
int ielem = 1; ielem <= nelems; ielem++ ) {
118 if ( interface == NULL ) {
119 OOFEM_ERROR(
"Element has no ZZ error estimator interface defined");
122 #ifdef ZZErrorEstimator_ElementResultCashed 126 sNorms.at(ielem) = sNorm;
139 this->globalSNorm = gnorms [ 1 ];
150 this->globalSNorm = sqrt(this->globalSNorm);
167 #ifdef ZZErrorEstimator_ElementResultCashed 211 return this->
rc.get();
253 nDofMans = element->giveNumberOfDofManagers();
255 for (
int i = 1; i <= element->giveNumberOfNodes(); i++ ) {
256 element->giveDomain()->giveSmoother()->giveNodalVector( recoveredStress,
257 element->giveDofManager(i)->giveNumber() );
259 nodalRecoveredStreses.
resize( nDofMans, recoveredStress->
giveSize() );
261 for (
int j = 1; j <= recoveredStress->
giveSize(); j++ ) {
262 nodalRecoveredStreses.
at(i, j) = recoveredStress->
at(j);
274 for (
GaussPoint *gp: *this->ZZErrorEstimatorI_giveIntegrationRule() ) {
275 double dV = element->computeVolumeAround(gp);
280 element->giveIPValue(sig, gp, type, tStep);
292 for (
GaussPoint *gp: *this->ZZErrorEstimatorI_giveIntegrationRule() ) {
300 element->giveIPValue(sig, gp, type, tStep);
304 this->ZZErrorEstimatorI_computeLocalStress(ldiff, diff);
309 this->ZZErrorEstimatorI_computeLocalStress(lsig, sig);
360 int nelem, nnode, elemPolyOrder, ielemNodes;
361 double globValNorm = 0.0, globValErrorNorm = 0.0, elemErrLimit, eerror, iratio, currDensity, elemSize;
363 double pe, coeff = 2.0;
374 std :: vector< char > dofManInitFlag(nnode);
375 for (
int i = 0; i < nnode; i++ ) {
376 dofManInitFlag [ i ] = 0;
390 pe = sqrt( globValErrorNorm * globValErrorNorm / ( globValErrorNorm * globValErrorNorm + globValNorm * globValNorm ) );
403 elemErrLimit = sqrt( ( globValNorm * globValNorm + globValErrorNorm * globValErrorNorm ) / nelem ) *
404 this->requiredError * coeff;
408 if ( this->
ee->
skipRegion( elem->giveRegionNumber() ) ) {
413 iratio = eerror / elemErrLimit;
414 if ( fabs(iratio) < 1.e-3 ) {
418 if ( iratio > 1.0 ) {
422 if ( iratio < 0.5 ) {
428 currDensity = elem->computeMeanSize();
429 elemPolyOrder = elem->giveInterpolation()->giveInterpolationOrder();
430 elemSize = currDensity / pow(iratio, 1.0 / elemPolyOrder);
432 ielemNodes = elem->giveNumberOfDofManagers();
433 for (
int j = 1; j <= ielemNodes; j++ ) {
434 int jnode = elem->giveDofManager(j)->giveNumber();
435 if ( dofManInitFlag [ jnode - 1 ] ) {
439 dofManInitFlag [ jnode - 1 ] = 1;
445 for (
int i = 0; i < nnode; i++ ) {
446 if ( dofManInitFlag [ i ] == 0 ) {
482 for (
int i = 1; i <= isize; i++ ) {
494 for (
int i = 1; i <= isize; i++ ) {
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
The base class for all remeshing criteria.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
double globalErrorEstimate
Global error estimate (relative)
double computeMeanSize()
Computes the size of the element defined as its length.
virtual double giveRequiredDofManDensity(int num, TimeStep *tStep, int relative=0)
Returns the required mesh size n given dof manager.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
virtual RemeshingCriteria * giveRemeshingCrit()
Returns reference to associated remeshing criteria.
REGISTER_ErrorEstimator(CombinedZZSIErrorEstimator, EET_CZZSI)
std::unique_ptr< RemeshingCriteria > rc
double globalENorm
Global error norm.
#define _IFT_ZZRemeshingCriteria_minelemsize
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)=0
Computes constitutive matrix of receiver.
double & at(int i)
Coefficient access function.
int max(int i, int j)
Returns bigger value form two given decimals.
ConnectivityTable * giveConnectivityTable()
Returns receiver's associated connectivity table.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Abstract base class for all finite elements.
InternalStateType IStype
Internal state type of variable to get internal forces.
EE_ErrorType
Type characterizing different type of element errors.
int giveNumber()
Returns domain number.
NodalRecoveryModel * giveSmoother()
Returns the actual Smoother associated to receiver.
int giveNumberOfElements() const
Returns number of elements in domain.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
void setSmoother(NodalRecoveryModel *newSmoother, bool destroyOld=true)
Sets the given smoother as an actual smoother for receiver.
virtual double giveDofManDensity(int num)
Returns existing mesh size for given dof manager.
#define OOFEM_LOG_RELEVANT(...)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
#define _IFT_ZZRemeshingCriteria_requirederror
Class representing a general abstraction for finite element interpolation class.
virtual double giveElementError(EE_ErrorType type, Element *elem, TimeStep *tStep)
Returns the element error.
virtual double giveValue(EE_ValueType type, TimeStep *tStep)
Returns the characteristic value of given type.
Abstract base class for all "structural" finite elements.
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
static void giveReducedSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the full unsymmetric Voigt vector (2nd order tensor) to reduced form.
virtual RemeshingStrategy giveRemeshingStrategy(TimeStep *tStep)
Determines, if the remeshing is needed, and if needed, the type of strategy used. ...
Element * giveElement(int n)
Service for accessing particular domain fe element.
The element interface corresponding to ZZErrorEstimator.
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
#define _IFT_ZZErrorEstimator_recoverytype
StateCounterType giveSolutionStateCounter()
Returns current solution state counter.
RemeshingStrategy remeshingStrategy
Remeshing strategy proposed.
double computeSquaredNorm() const
Computes the square of the norm.
The class representing Zienkiewicz-Zhu remeshing criteria.
Set of elements, boundaries, edges and/or nodes.
NodalRecoveryType nodalRecoveryType
Nodal recovery type.
Class representing connectivity table.
Wrapper around element definition to provide FEICellGeometry interface.
virtual ParallelContext * giveParallelContext(int n)
Returns the parallel context corresponding to given domain (n) and unknown type Default implementatio...
ZZRemeshingCriteriaModeType mode
Mode of receiver.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
NormType
Type of norm used.
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
double at(int i, int j) const
Coefficient access function.
double requiredError
Required error to obtain.
FloatArray eNorms
Cache storing element norms.
The base class for all error estimation or error indicator algorithms.
#define _IFT_ZZErrorEstimator_normtype
Class representing vector of real numbers.
RemeshingStrategy
Type representing the remeshing strategy.
Implementation of matrix containing floating point numbers.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
const IntArray * giveDofManConnectivityArray(int dofman)
EE_ErrorMode
Type determining whether temporary or equilibrated variables are used for error evaluation.
IRResultType
Type defining the return values of InputRecord reading operations.
virtual int estimateMeshDensities(TimeStep *tStep)
Estimates the nodal densities.
StateCounterType stateCounter
Actual state counter.
ZZRemeshingCriteria(int n, ErrorEstimator *e)
Constructor.
The Superconvergent Patch Recovery (SPR) nodal recovery model is based on paper of Zienkiewicz and Zh...
double norm(const FloatArray &x)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
bool skipRegion(int reg)
Returns nonzero if region has been skipped in error estimation (user option).
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual int recoverValues(Set elementSet, InternalStateType type, TimeStep *tStep)=0
Recovers the nodal values for all regions.
This class provides an communication context for distributed memory parallelism.
virtual int estimateError(EE_ErrorMode mode, TimeStep *tStep)
Estimates the error on associated domain at given time step.
virtual double giveValue(EE_ValueType type, TimeStep *tStep)=0
Returns the characteristic value of given type.
virtual void ZZErrorEstimatorI_computeElementContributions(double &eNorm, double &sNorm, ZZErrorEstimator::NormType norm, InternalStateType type, TimeStep *tStep)
Computes the element contributions to global norms.
void addAllElements()
Initialize the element set to contain all elements in the receiver domain.
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
double accumulate(double local)
Accumulates the global value.
FloatArray nodalDensities
Array of nodal mesh densities.
StateCounterType stateCounter
Actual values (densities) state counter.
EE_ValueType
Type characterizing different type of errors.
double globalSNorm
Global norm of quantity which error is evaluated.
int min(int i, int j)
Returns smaller value from two given decimals.
std::vector< std::unique_ptr< Element > > & giveElements()
NormType normType
Type of norm used.
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual double giveElementError(EE_ErrorType type, Element *elem, TimeStep *tStep)=0
Returns the element error.
The base class for all recovery models, which perform nodal averaging or projection processes for int...
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
Class representing integration point in finite element program.
Class representing solution step.
The nodal recovery model based on paper of Zienkiewicz and Zhu "A Simple Estimator and Adaptive Proce...
void resize(int s)
Resizes receiver towards requested size.
double minElemSize
Minimum element size allowed.