OOFEM 3.0
Loading...
Searching...
No Matches
scalarerrorindicator.C
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
37#include "element.h"
38#include "integrationrule.h"
39#include "gausspoint.h"
40#include "mathfem.h"
41#include "errorestimatortype.h"
42#include "classfactory.h"
43
44namespace oofem {
46
47int
48ScalarErrorIndicator :: estimateError(EE_ErrorMode mode, TimeStep *tStep)
49{
50 if ( indicatorType == 1 ) {
51 if ( mode == equilibratedEM ) {
52 varType = IST_PrincipalDamageTensor;
53 } else {
54 varType = IST_PrincipalDamageTempTensor;
55 }
56 }
57
58 return 1;
59}
60
61double
62ScalarErrorIndicator :: giveElementError(EE_ErrorType type, Element *elem, TimeStep *tStep)
63{
64 FloatArray val;
65 int result = 1;
66 double sval, maxVal = 0.0;
67
68 if ( type != indicatorET ) {
69 return 0.0;
70 }
71
72 if ( this->skipRegion( elem->giveRegionNumber() ) ) {
73 return 0.0;
74 }
75
76 for ( GaussPoint *gp: *elem->giveDefaultIntegrationRulePtr() ) {
77 result = elem->giveIPValue(val, gp, varType, tStep);
78 if ( result ) {
79 sval = val.computeNorm();
80 if ( gp->giveNumber() == 1 ) {
81 maxVal = sval;
82 } else {
83 maxVal = max(maxVal, sval);
84 }
85 }
86 }
87
88 return maxVal;
89}
90
91
92void
93ScalarErrorIndicator :: initializeFrom(InputRecord &ir)
94{
95 ErrorEstimator :: initializeFrom(ir);
96
98 if ( indicatorType != 1 ) {
99 OOFEM_ERROR("usupported varType");
100 }
101
102 return this->giveRemeshingCrit()->initializeFrom(ir);
103}
104
106ScalarErrorIndicator :: giveRemeshingCrit()
107{
108 if ( !this->rc ) {
109 this->rc = std::make_unique<DirectErrorIndicatorRC>(1, this);
110 }
111
112 return this->rc.get();
113}
114} // end namespace oofem
#define REGISTER_ErrorEstimator(class, type)
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Definition element.h:886
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Definition element.C:1298
int giveRegionNumber()
Definition element.C:546
std ::unique_ptr< RemeshingCriteria > rc
bool skipRegion(int reg)
double computeNorm() const
Definition floatarray.C:861
InternalStateType varType
Corresponding internal state type.
int indicatorType
Type of internal variable to be indicator (type for temp and nontemp version).
RemeshingCriteria * giveRemeshingCrit() override
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
@ equilibratedEM
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
@ EET_SEI
Scalar Error Indicator.
#define _IFT_ScalarErrorIndicator_vartype

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011