OOFEM 3.0
Loading...
Searching...
No Matches
trabbonenl.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
35#include "trabbonenl.h"
36#include "gausspoint.h"
37#include "floatarray.h"
38#include "mathfem.h"
39#include "nonlocalmaterialext.h"
40#include "classfactory.h"
41#include "dynamicinputrecord.h"
42
43#ifdef __OOFEG
44 #include "oofeggraphiccontext.h"
45#endif
46
47namespace oofem {
51
53
55// BEGIN: CONSTRUCTOR
56//
57
58TrabBoneNL :: TrabBoneNL(int n, Domain *d) : TrabBoneMaterial(n, d), StructuralNonlocalMaterialExtensionInterface(d)
59{
60}
61
62//
63// END: CONSTRUCTOR
65
66
68// BEGIN: SUBROUTINE FOR UPDATE BEFORE NON LOCAL AVERAGE
69// update local values of accumulated pastic strain
70
71void
72TrabBoneNL :: updateBeforeNonlocAverage(const FloatArray &strainVector, GaussPoint *gp, TimeStep *tStep) const
73{
74 auto nlstatus = static_cast< TrabBoneNLStatus * >( this->giveStatus(gp) );
75
76 FloatArray SDstrainVector;
77
78 this->initTempStatus(gp);
79 this->giveStressDependentPartOfStrainVector(SDstrainVector, gp, strainVector, tStep, VM_Total);
80
81 nlstatus->letTempStrainVectorBe(strainVector);
82
83 this->performPlasticityReturn(gp, strainVector);
84 double cumPlastStrain = this->computeLocalCumPlastStrain(strainVector, gp, tStep);
85 nlstatus->setLocalCumPlastStrainForAverage(cumPlastStrain);
86}
87
88//
89// END: SUBROUTINE FOR UPDATE BEFORE NON LOCAL AVERAGE
91
92
94// BEGIN: SUBROUTINE FOR EVALUATION OF TOTAL STRESS
95//
96
98TrabBoneNL :: giveRealStressVector_1d(const FloatArrayF<1> &strainVector,
99 GaussPoint *gp, TimeStep *tStep) const
100{
101 auto nlStatus = static_cast< TrabBoneNLStatus * >( this->giveStatus(gp) );
102
103 double tempDamage = computeDamage(gp, tStep);
104 double plasStrain = nlStatus->giveTempPlasStrainVector().at(1);
105 double elasStrain = strainVector.at(1) - plasStrain;
106 double effStress = E0 * elasStrain;
107 double sigc = nlStatus->giveSigC();
108
109 FloatArrayF<1> stress = {( 1. - tempDamage ) * effStress + sigc};
110
111 nlStatus->setTempDam(tempDamage);
112 nlStatus->letTempStrainVectorBe(strainVector);
113 nlStatus->letTempStressVectorBe(stress);
114 return stress;
115}
116
117//
118// END: SUBROUTINE FOR EVALUATION OF TOTAL STRESS
120
121
123// BEGIN: SUBROUTINE OF NONLOCAL ALPHA EVALUATION
124//
125
126double
127TrabBoneNL :: computeCumPlastStrain(GaussPoint *gp, TimeStep *tStep) const
128{
129 auto status = static_cast< TrabBoneNLStatus * >( this->giveStatus(gp) );
130
131 this->buildNonlocalPointTable(gp);
133
134 auto list = status->giveIntegrationDomainList();
135
136 double nonlocalCumPlastStrain = 0.0;
137 for ( auto &lir: *list ) {
138 auto nonlocStatus = static_cast< TrabBoneNLStatus * >( this->giveStatus(lir.nearGp) );
139 double nonlocalContribution = nonlocStatus->giveLocalCumPlastStrainForAverage();
140 nonlocalContribution *= lir.weight;
141 nonlocalCumPlastStrain += nonlocalContribution;
142 }
143
144 nonlocalCumPlastStrain *= 1. / status->giveIntegrationScale();
145
146 double localCumPlastStrain = status->giveLocalCumPlastStrainForAverage();
147 return mParam * nonlocalCumPlastStrain + ( 1 - mParam ) * localCumPlastStrain;
148}
149
150//
151// END: SUBROUTINE OF NONLOCAL ALPHA EVALUATION
153
154
156// BEGIN: INTERFACE ????
157//
158
159Interface *
160TrabBoneNL :: giveInterface(InterfaceType type)
161{
163 return static_cast< StructuralNonlocalMaterialExtensionInterface * >(this);
164 } else {
165 return NULL;
166 }
167}
168
169//
170// END: INTERFACE ????
172
173
175// BEGIN: PARAMETERS OF INPUT FILE
176//
177
178void
179TrabBoneNL :: initializeFrom(InputRecord &ir)
180{
181 TrabBoneMaterial :: initializeFrom(ir);
182 StructuralNonlocalMaterialExtensionInterface :: initializeFrom(ir);
183
185 if ( R < 0.0 ) {
186 R = 0.0;
187 }
188
189 mParam = 1.;
191}
192
193//
194// END: PARAMETERS OF INPUT FILE
196
197
199// BEGIN: ??????????????
200//
201
202void
203TrabBoneNL :: giveInputRecord(DynamicInputRecord &input)
204{
205 TrabBoneMaterial :: giveInputRecord(input);
206 input.setField(this->R, _IFT_TrabBoneNL_r);
207 input.setField(this->mParam, _IFT_TrabBoneNL_m);
208}
209
210
211//
212// END: ????????????????
214
215
217// BEGIN: WEIGHT FUNCTION FOR NONLOCAL CONTRIBUTION
218//
219
220double
221TrabBoneNL :: computeWeightFunction(const double R, const FloatArray &src, const FloatArray &coord) const
222{
223 double dist = distance(src, coord);
224
225 if ( ( dist >= 0. ) && ( dist <= this->R ) ) {
226 double help = ( 1. - dist * dist / ( R * R ) );
227 return help * help;
228 }
229
230 return 0.0;
231}
232
233//
234// END: WEIGHT FUNCTION FOR NONLOCAL CONTRIBUTION
236
237
241
242
243TrabBoneNLStatus :: TrabBoneNLStatus(GaussPoint *g) :
245{
246}
247
248
249void
250TrabBoneNLStatus :: printOutputAt(FILE *file, TimeStep *tStep) const
251{
252 StructuralMaterialStatus :: printOutputAt(file, tStep);
253 fprintf(file, "status {");
254 fprintf(file, " plastrains ");
255 for ( auto &val : epsp) {
256 fprintf( file, " %.4e", val );
257 }
258
259 fprintf(file, ",");
260 fprintf(file, " alpha %.4e,", alpha);
261 fprintf(file, " dam %.4e", dam);
262 fprintf(file, "}\n");
263}
264
266// BEGIN: INITIALIZE TEMP VARIABLE (UPDATED DURING ITERATIONS)
267// initialize temporary state variables according to equilibriated state vars
268
269void
270TrabBoneNLStatus :: initTempStatus()
271{
272 TrabBoneMaterialStatus :: initTempStatus();
273}
274
275//
276// END: INITIALIZE TEMP VARIABLE (UPDATED DURING ITERATIONS)
278
279
281// BEGIN: SETS VARIABLE EQUAL TO TEMP VARIABLE AT THE END OF THE STEP
282// Called when equlibrium reached, set equilibriated vars according to temporary (working) ones.
283
284void
285TrabBoneNLStatus :: updateYourself(TimeStep *tStep)
286{
287 TrabBoneMaterialStatus :: updateYourself(tStep);
288}
289
290//
291// END: SETS VARIABLE EQUAL TO TEMP VARIABLE AT THE END OF THE STE
293
294
296// BEGIN: INTERFACE ???????????
297//
298
299Interface *
300TrabBoneNLStatus :: giveInterface(InterfaceType type)
301{
303 return this;
304 } else {
305 return nullptr;
306 }
307}
308
309//
310// END: INTERFACE ???????????????
312} // end namespace oofem
#define REGISTER_Material(class)
void setField(int item, InputFieldType id)
double & at(std::size_t i)
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
virtual void initTempStatus(GaussPoint *gp) const
Definition material.C:221
void buildNonlocalPointTable(GaussPoint *gp) const
void updateDomainBeforeNonlocAverage(TimeStep *tStep) const
void giveStressDependentPartOfStrainVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode) const
TrabBoneMaterial(int n, Domain *d)
void performPlasticityReturn(GaussPoint *gp, const FloatArray &totalStrain) const
double computeDamage(GaussPoint *gp, TimeStep *tStep) const
double giveLocalCumPlastStrainForAverage() const
Definition trabbonenl.h:65
double computeLocalCumPlastStrain(const FloatArray &strain, GaussPoint *gp, TimeStep *tStep) const
Definition trabbonenl.h:102
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
@ NonlocalMaterialStatusExtensionInterfaceType
@ NonlocalMaterialExtensionInterfaceType
double distance(const FloatArray &x, const FloatArray &y)
#define _IFT_TrabBoneNL_m
Definition trabbonenl.h:47
#define _IFT_TrabBoneNL_r
Definition trabbonenl.h:46

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