69 int nelems = this->
domain->giveNumberOfElements();
75 type = IST_StressTensorTemp;
92 oldSmoother = this->
domain->giveSmoother();
93 this->
domain->setSmoother(rm, 0);
101#ifdef ZZErrorEstimator_ElementResultCashed
102 this->
eNorms.resize(nelems);
112 for (
int ielem = 1; ielem <= nelems; ielem++ ) {
113 if ( this->
skipRegion( this->
domain->giveElement(ielem)->giveRegionNumber() ) ) {
118 if ( interface == NULL ) {
119 OOFEM_ERROR(
"Element has no ZZ error estimator interface defined");
122#ifdef ZZErrorEstimator_ElementResultCashed
126 sNorms.
at(ielem) = sNorm;
143 this->
domain->setSmoother(oldSmoother);
167#ifdef ZZErrorEstimator_ElementResultCashed
205ZZErrorEstimator :: giveRemeshingCrit()
208 this->
rc = std::make_unique<ZZRemeshingCriteria>(1,
this);
211 return this->
rc.get();
220 ErrorEstimator :: initializeFrom(ir);
241ZZErrorEstimatorInterface :: ZZErrorEstimatorI_computeElementContributions(
double &eNorm,
double &sNorm,
242 ZZErrorEstimator :: NormType
norm,
252 nDofMans =
element->giveNumberOfDofManagers();
254 for (
int i = 1; i <=
element->giveNumberOfNodes(); i++ ) {
255 element->giveDomain()->giveSmoother()->giveNodalVector( recoveredStress,
256 element->giveDofManager(i)->giveNumber() );
258 nodalRecoveredStreses.
resize( nDofMans, recoveredStress->
giveSize() );
260 for (
int j = 1; j <= recoveredStress->
giveSize(); j++ ) {
261 nodalRecoveredStreses.
at(i, j) = recoveredStress->
at(j);
272 if (
norm == ZZErrorEstimator :: L2Norm ) {
274 double dV =
element->computeVolumeAround(gp);
279 element->giveIPValue(sig, gp, type, tStep);
286 }
else if (
norm == ZZErrorEstimator :: EnergyNorm ) {
292 double dV =
element->computeVolumeAround(gp);
299 element->giveIPValue(sig, gp, type, tStep);
304 StructuralMaterial :: giveReducedSymVectorForm( ldiff_reduced, ldiff, gp->giveMaterialMode() );
309 StructuralMaterial :: giveReducedSymVectorForm( lsig_reduced, lsig, gp->giveMaterialMode() );
329ZZRemeshingCriteria :: giveRequiredDofManDensity(
int num,
TimeStep *tStep,
int relative)
350ZZRemeshingCriteria :: giveRemeshingStrategy(
TimeStep *tStep)
357ZZRemeshingCriteria :: estimateMeshDensities(
TimeStep *tStep)
359 int nelem, nnode, elemPolyOrder, ielemNodes;
360 double globValNorm = 0.0, globValErrorNorm = 0.0, elemErrLimit, eerror, iratio, currDensity, elemSize;
362 double pe, coeff = 2.0;
368 nelem = this->
domain->giveNumberOfElements();
369 nnode = this->
domain->giveNumberOfDofManagers();
373 std :: vector< char > dofManInitFlag(nnode);
374 for (
int i = 0; i < nnode; i++ ) {
375 dofManInitFlag [ i ] = 0;
389 pe = sqrt( globValErrorNorm * globValErrorNorm / ( globValErrorNorm * globValErrorNorm + globValNorm * globValNorm ) );
402 elemErrLimit = sqrt( ( globValNorm * globValNorm + globValErrorNorm * globValErrorNorm ) / nelem ) *
403 this->requiredError * coeff;
405 for (
auto &elem :
domain->giveElements() ) {
407 if ( this->
ee->skipRegion( elem->giveRegionNumber() ) ) {
411 eerror = this->
ee->giveElementError(errorType, elem.get(), tStep);
412 iratio = eerror / elemErrLimit;
413 if ( fabs(iratio) < 1.e-3 ) {
417 if ( iratio > 1.0 ) {
421 if ( iratio < 0.5 ) {
427 currDensity = elem->computeMeanSize();
428 elemPolyOrder = elem->giveInterpolation()->giveInterpolationOrder();
429 elemSize = currDensity / pow(iratio, 1.0 / elemPolyOrder);
431 ielemNodes = elem->giveNumberOfDofManagers();
432 for (
int j = 1; j <= ielemNodes; j++ ) {
433 int jnode = elem->giveDofManager(j)->giveNumber();
434 if ( dofManInitFlag [ jnode - 1 ] ) {
438 dofManInitFlag [ jnode - 1 ] = 1;
444 for (
int i = 0; i < nnode; i++ ) {
445 if ( dofManInitFlag [ i ] == 0 ) {
464ZZRemeshingCriteria :: giveDofManDensity(
int num)
477 for (
int i = 1; i <= isize; i++ ) {
489 for (
int i = 1; i <= isize; i++ ) {
#define REGISTER_ErrorEstimator(class, type)
const IntArray * giveDofManConnectivityArray(int dofman)
std ::unique_ptr< RemeshingCriteria > rc
InternalStateType IStype
Internal state type of variable to get internal forces.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual Interface * giveInterface(InterfaceType t)
Domain * domain
Link to domain object, useful for communicating with other FEM components.
double computeSquaredNorm() const
double dotProduct(const FloatArray &x) const
Index giveSize() const
Returns the size of receiver.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void subtract(const FloatArray &src)
void resize(Index rows, Index cols)
bool beInverseOf(const FloatMatrix &src)
double at(std::size_t i, std::size_t j) const
virtual int recoverValues(Set elementSet, InternalStateType type, TimeStep *tStep)=0
double accumulate(double local)
RemeshingCriteria(int n, ErrorEstimator *e)
Constructor.
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)=0
StateCounterType giveSolutionStateCounter()
virtual void ZZErrorEstimatorI_computeElementContributions(double &eNorm, double &sNorm, ZZErrorEstimator ::NormType norm, InternalStateType type, TimeStep *tStep)
virtual IntegrationRule * ZZErrorEstimatorI_giveIntegrationRule()
virtual void ZZErrorEstimatorI_computeLocalStress(FloatArray &answer, FloatArray &sig)
double globalSNorm
Global norm of quantity which error is evaluated.
NodalRecoveryType nodalRecoveryType
Nodal recovery type.
FloatArray eNorms
Cache storing element norms.
RemeshingCriteria * giveRemeshingCrit() override
double globalErrorEstimate
Global error estimate (relative).
NormType normType
Type of norm used.
int estimateError(EE_ErrorMode mode, TimeStep *tStep) override
double globalENorm
Global error norm.
StateCounterType stateCounter
Actual state counter.
ZZRemeshingCriteriaModeType mode
Mode of receiver.
RemeshingStrategy remeshingStrategy
Remeshing strategy proposed.
StateCounterType stateCounter
Actual values (densities) state counter.
int estimateMeshDensities(TimeStep *tStep) override
double requiredError
Required error to obtain.
double minElemSize
Minimum element size allowed.
double giveDofManDensity(int num) override
FloatArray nodalDensities
Array of nodal mesh densities.
#define OOFEM_LOG_RELEVANT(...)
static FloatArray Vec2(const double &a, const double &b)
double norm(const FloatArray &x)
FloatArrayF< N > min(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
RemeshingStrategy
Type representing the remeshing strategy.
@ RemeshingFromPreviousState_RS
@ ZZErrorEstimatorInterfaceType
@ relativeErrorEstimateEEV
@ EET_ZZEE
Zienkiewicz-Zhu EE.
#define _IFT_ZZErrorEstimator_normtype
#define _IFT_ZZErrorEstimator_recoverytype
#define _IFT_ZZRemeshingCriteria_requirederror
#define _IFT_ZZRemeshingCriteria_minelemsize