OOFEM 3.0
Loading...
Searching...
No Matches
trabbonenlembed.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 "trabbonenlembed.h"
36#include "gausspoint.h"
37#include "floatmatrix.h"
38#include "floatarray.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
54TrabBoneNLEmbed :: TrabBoneNLEmbed(int n, Domain *d) : TrabBoneEmbed(n, d), StructuralNonlocalMaterialExtensionInterface(d)
55{
56}
57
58void
59TrabBoneNLEmbed :: updateBeforeNonlocAverage(const FloatArray &strainVector, GaussPoint *gp, TimeStep *tStep) const
60{
61 auto nlstatus = static_cast< TrabBoneNLEmbedStatus * >( this->giveStatus(gp) );
62
63 this->initTempStatus(gp);
64
65 FloatArray SDstrainVector;
66 this->giveStressDependentPartOfStrainVector(SDstrainVector, gp, strainVector, tStep, VM_Total);
67
68 nlstatus->letTempStrainVectorBe(strainVector);
69
70 this->performPlasticityReturn(gp, strainVector);
71 double cumPlastStrain = this->computeLocalCumPlastStrain(strainVector, gp, tStep);
72
73 nlstatus->setLocalCumPlastStrainForAverage(cumPlastStrain);
74}
75
77TrabBoneNLEmbed :: giveRealStressVector_3d(const FloatArrayF<6> &strain, GaussPoint *gp,
78 TimeStep *tStep) const
79{
80 auto nlStatus = static_cast< TrabBoneNLEmbedStatus * >( this->giveStatus(gp) );
81
82 auto compliance = this->constructIsoComplTensor(eps0, nu0);
83 auto elasticity = inv(compliance);
84
85 // Unused?
86 double tempDam = 0;
87 FloatArrayF<6> plasDef;
88
89 auto totalStress = dot(elasticity, strain);
90
91 double tempTSED = 0.5 * dot(strain, totalStress);
92
93 nlStatus->setTempDam(tempDam);
94 nlStatus->letTempStrainVectorBe(strain);
95 nlStatus->letTempStressVectorBe(totalStress);
96 nlStatus->setTempTSED(tempTSED);
97 return totalStress;
98}
99
100double
101TrabBoneNLEmbed :: computeCumPlastStrain(GaussPoint *gp, TimeStep *tStep) const
102{
103 /*
104 auto status = static_cast< TrabBoneNLEmbedStatus * >( this->giveStatus(gp) );
105
106 this->buildNonlocalPointTable(gp);
107 this->updateDomainBeforeNonlocAverage(tStep);
108
109 auto list = status->giveIntegrationDomainList();
110
111 //double nonlocalCumPlastStrain = 0.0;
112 for ( auto &lir: *list ) {
113 auto nonlocStatus = static_cast< TrabBoneNLEmbedStatus * >( this->giveStatus(lir.nearGp) );
114 double nonlocalContribution = nonlocStatus->giveLocalCumPlastStrainForAverage();
115 nonlocalContribution *= lir.weight;
116 //nonlocalCumPlastStrain += nonlocalContribution;
117 }
118
119 nonlocalCumPlastStrain /= status->giveIntegrationScale(); ///@todo This is never used.
120
121 // double localCumPlastStrain = status->giveLocalCumPlastStrainForAverage();
122 // alpha = mParam*nonlocalCumPlastStrain +(1-mParam)*localCumPlastStrain ;
123 */
124 return 0.;
125}
126
127Interface *
128TrabBoneNLEmbed :: giveInterface(InterfaceType type)
129{
131 return static_cast< StructuralNonlocalMaterialExtensionInterface * >(this);
132 } else {
133 return nullptr;
134 }
135}
136
137void
138TrabBoneNLEmbed :: initializeFrom(InputRecord &ir)
139{
140 TrabBoneEmbed :: initializeFrom(ir);
141 StructuralNonlocalMaterialExtensionInterface :: initializeFrom(ir);
142
144 if ( R < 0.0 ) {
145 R = 0.0;
146 }
147
148 mParam = 1.5;
150}
151
152
153void
154TrabBoneNLEmbed :: giveInputRecord(DynamicInputRecord &input)
155{
156 TrabBoneEmbed :: giveInputRecord(input);
157 input.setField(this->R, _IFT_TrabBoneNLEmbed_r);
159}
160
161
162double
163TrabBoneNLEmbed :: computeWeightFunction(const double R, const FloatArray &src, const FloatArray &coord) const
164{
165 double dist = distance(src, coord);
166
167 if ( ( dist >= 0. ) && ( dist <= this->R ) ) {
168 double help = ( 1. - dist * dist / ( R * R ) );
169 return help * help;
170 }
171
172 return 0.0;
173}
174
175
176TrabBoneNLEmbedStatus :: TrabBoneNLEmbedStatus(GaussPoint *g) :
178{
179}
180
181
182void
183TrabBoneNLEmbedStatus :: printOutputAt(FILE *file, TimeStep *tStep) const
184{
185 StructuralMaterialStatus :: printOutputAt(file, tStep);
186 fprintf(file, "status {");
187 fprintf(file, " plastrains ");
188 for ( auto &val : plasDef ) {
189 fprintf( file, " %.4e", val );
190 }
191
192 fprintf(file, " ,");
193 fprintf(file, " alpha %.4e ,", alpha);
194 fprintf(file, " dam %.4e ,", dam);
195 fprintf(file, " esed %.4e ,", this->tempTSED);
196 fprintf(file, " psed 0. ,");
197 fprintf(file, " tsed %.4e ,", this->tempTSED);
198 fprintf(file, "}\n");
199}
200
201void
202TrabBoneNLEmbedStatus :: initTempStatus()
203{
204 TrabBoneEmbedStatus :: initTempStatus();
205}
206
207void
208TrabBoneNLEmbedStatus :: updateYourself(TimeStep *tStep)
209{
210 TrabBoneEmbedStatus :: updateYourself(tStep);
211}
212
213void
214TrabBoneNLEmbedStatus :: saveContext(DataStream &stream, ContextMode mode)
215{
216 TrabBoneEmbedStatus :: saveContext(stream, mode);
217}
218
219void
220TrabBoneNLEmbedStatus :: restoreContext(DataStream &stream, ContextMode mode)
221{
222 TrabBoneEmbedStatus :: restoreContext(stream, mode);
223}
224
225
226Interface *
227TrabBoneNLEmbedStatus :: giveInterface(InterfaceType type)
228{
230 return this;
231 } else {
232 return nullptr;
233 }
234}
235} // end namespace oofem
#define REGISTER_Material(class)
void setField(int item, InputFieldType id)
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
virtual void initTempStatus(GaussPoint *gp) const
Definition material.C:221
void giveStressDependentPartOfStrainVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode) const
TrabBoneEmbedStatus(GaussPoint *g)
static FloatMatrixF< 6, 6 > constructIsoComplTensor(double eps0, double nu0)
Constructs the anisotropic compliance tensor.
void performPlasticityReturn(GaussPoint *gp, const FloatArrayF< 6 > &totalStrain) const
TrabBoneEmbed(int n, Domain *d)
double computeLocalCumPlastStrain(const FloatArrayF< 6 > &strain, GaussPoint *gp, TimeStep *tStep) const
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
long ContextMode
Definition contextmode.h:43
double dot(const FloatArray &x, const FloatArray &y)
FloatMatrixF< N, N > inv(const FloatMatrixF< N, N > &mat, double zeropiv=1e-24)
Computes the inverse.
@ NonlocalMaterialStatusExtensionInterfaceType
@ NonlocalMaterialExtensionInterfaceType
double distance(const FloatArray &x, const FloatArray &y)
#define _IFT_TrabBoneNLEmbed_m
#define _IFT_TrabBoneNLEmbed_r

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