OOFEM 3.0
Loading...
Searching...
No Matches
isolinearelasticmaterial.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
39#include "floatmatrix.h"
40#include "gausspoint.h"
41#include "classfactory.h"
42#include "dynamicinputrecord.h"
43#include "contextioerr.h"
44
45namespace oofem {
47
48IsotropicLinearElasticMaterial :: IsotropicLinearElasticMaterial(int n, Domain *d) :
50{ }
51
52IsotropicLinearElasticMaterial :: IsotropicLinearElasticMaterial(int n, Domain *d,
53 double _E, double _nu) :
55 E(_E),
56 nu(_nu),
57 G( E / ( 2.0 * ( 1. + nu ) ) ),
58 a(0.)
59{
60 this->initTangents();
61}
62
63
64void
65IsotropicLinearElasticMaterial :: initializeFrom(InputRecord &ir)
66{
67 LinearElasticMaterial :: initializeFrom(ir);
68
72 // propertyDictionary.add(tAlpha, a);
73 // compute value of shear modulus
74 G = E / ( 2.0 * ( 1. + nu ) );
75 this->initTangents();
76}
77
78
79void
80IsotropicLinearElasticMaterial :: initTangents()
81{
82 double K = E / ( 3.0 * ( 1. - 2. * nu ) );
83 this->tangent = 2 * G * I_dev6 + K * I6_I6;
84 this->computesSubTangents();
85 this->alpha = {
86 a, a, a, 0., 0., 0.
87 };
88}
89
90void
91IsotropicLinearElasticMaterial :: giveInputRecord(DynamicInputRecord &input)
92{
93 this->LinearElasticMaterial :: giveInputRecord(input);
94 StructuralMaterial :: giveInputRecord(input);
95
99}
100
101
102void IsotropicLinearElasticMaterial :: saveContext(DataStream &stream, ContextMode mode)
103{
104 LinearElasticMaterial :: saveContext(stream, mode);
105
106 if ( ( mode & CM_Definition ) ) {
107 if ( !stream.write(E) ) {
109 }
110 if ( !stream.write(nu) ) {
112 }
113 if ( !stream.write(a) ) {
115 }
116 }
117}
118
119
120void IsotropicLinearElasticMaterial :: restoreContext(DataStream &stream, ContextMode mode)
121{
122 LinearElasticMaterial :: restoreContext(stream, mode);
123
124 if ( mode & CM_Definition ) {
125 if ( !stream.read(E) ) {
127 }
128 if ( !stream.read(nu) ) {
130 }
131 if ( !stream.read(a) ) {
133 }
134 }
135 G = E / ( 2.0 * ( 1. + nu ) );
136 this->initTangents();
137}
138
139
140
141double
142IsotropicLinearElasticMaterial :: give(int aProperty, GaussPoint *gp) const
143{
144 if ( ( aProperty == NYxy ) || ( aProperty == NYxz ) || ( aProperty == NYyz ) ) {
145 return nu;
146 }
147
148 if ( ( aProperty == 'G' ) || ( aProperty == Gyz ) || ( aProperty == Gxz ) ||
149 ( aProperty == Gxy ) ) {
150 return G;
151 }
152
153 if ( ( aProperty == 'E' ) || ( aProperty == Ex ) || ( aProperty == Ey ) ||
154 ( aProperty == Ez ) ) {
155 return E;
156 }
157
158 if ( ( aProperty == 'n' ) || ( aProperty == NYzx ) || ( aProperty == NYzy ) ||
159 ( aProperty == NYyx ) ) {
160 return nu;
161 }
162
163 return this->Material :: give(aProperty, gp);
164}
165
166
168IsotropicLinearElasticMaterial :: givePlaneStressStiffMtrx(MatResponseMode mode,
169 GaussPoint *gp,
170 TimeStep *tStep) const
171{
172 if ( ( tStep->giveIntrinsicTime() < this->castingTime ) ) {
173 return tangentPlaneStress * (1. - this->preCastStiffnessReduction);
174 } else {
175 return tangentPlaneStress;
176 }
177}
178
179
181IsotropicLinearElasticMaterial :: givePlaneStrainStiffMtrx(MatResponseMode mode,
182 GaussPoint *gp,
183 TimeStep *tStep) const
184{
185 if ( ( tStep->giveIntrinsicTime() < this->castingTime ) ) {
186 return tangentPlaneStrain * (1. - this->preCastStiffnessReduction);
187 } else {
188 return tangentPlaneStrain;
189 }
190}
191
192
194IsotropicLinearElasticMaterial :: give1dStressStiffMtrx(MatResponseMode mode,
195 GaussPoint *gp,
196 TimeStep *tStep) const
197{
198 double e = this->E;
199 if ( tStep->giveIntrinsicTime() < this->castingTime ) {
200 e *= 1. - this->preCastStiffnessReduction;
201 }
202 return {e};
203}
204
205
206
207
208
209
210
211
212void
213IsotropicLinearElasticMaterial :: giveDeviatoric3dMaterialStiffnessMatrix(FloatMatrix &answer,
214 MatResponseMode mode,
215 GaussPoint *gp,
216 TimeStep *tStep) const
217//
218// forceElasticResponse ignored - always elastic
219//
220{
221 double mu = this->E / 2 / ( 1. + this->nu );
222
223
224 answer.resize(6, 6);
225 answer.zero();
226
227 answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = 4. / 3.;
228 answer.at(1, 2) = answer.at(1, 3) = -2. / 3.;
229 answer.at(2, 1) = answer.at(2, 3) = -2. / 3.;
230 answer.at(3, 1) = answer.at(3, 2) = -2. / 3.;
231
232 answer.at(4, 4) = answer.at(5, 5) = answer.at(6, 6) = 1.0;
233
234 answer.times(mu);
235}
236
237
238void
239IsotropicLinearElasticMaterial :: giveDeviatoricPlaneStrainStiffMtrx(FloatMatrix &answer,
240 MatResponseMode mode,
241 GaussPoint *gp,
242 TimeStep *tStep) const
243{
244 answer.resize(4, 4);
245
246 double mu = this->E / 2 / ( 1. + this->nu );
247
248 answer.zero();
249 answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = 4. / 3.;
250 answer.at(1, 2) = answer.at(1, 3) = -2. / 3.;
251 answer.at(2, 1) = answer.at(2, 3) = -2. / 3.;
252 answer.at(3, 1) = answer.at(3, 2) = -2. / 3.;
253
254 answer.at(4, 4) = 1.0;
255
256 answer.times(mu);
257}
258
259
260
261void
262IsotropicLinearElasticMaterial :: giveRealStressVectorUP_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, double pressure, TimeStep *tStep) const
263{
264 FloatArray strainVector;
265 FloatMatrix d;
266 StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
267
268 this->giveStressDependentPartOfStrainVector(strainVector, gp, reducedStrain, tStep, VM_Total);
269
270 this->giveDeviatoric3dMaterialStiffnessMatrix(d, TangentStiffness, gp, tStep);
271 answer.beProductOf(d, strainVector);
272 answer.at(1) -= pressure;
273 answer.at(2) -= pressure;
274 answer.at(3) -= pressure;
275
276 // update gp
277 status->letTempStrainVectorBe(reducedStrain);
278 status->letTempStressVectorBe(answer);
279}
280
281
282
283void
284IsotropicLinearElasticMaterial :: giveRealStressVectorUP_PlaneStrain(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, double pressure, TimeStep *tStep) const
285{
286 FloatArray strainVector;
287 FloatMatrix d;
288 StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
289
290 this->giveStressDependentPartOfStrainVector(strainVector, gp, reducedStrain, tStep, VM_Total);
291
292 this->giveDeviatoricPlaneStrainStiffMtrx(d, TangentStiffness, gp, tStep);
293 answer.beProductOf(d, strainVector);
294 answer.at(1) -= pressure;
295 answer.at(2) -= pressure;
296 answer.at(3) -= pressure;
297
298
299 // update gp
300 status->letTempStrainVectorBe(reducedStrain);
301 status->letTempStressVectorBe(answer);
302}
303
304double
306 switch (type) {
307 case ElasticBulkModulus:
308 return giveBulkModulus();
309 case ElasticBulkModulusInverse:
310 return 1./giveBulkModulus();
311 case MRM_ScalarOne:
312 return 1.0;
313 default:
314 return this->Material::giveCharacteristicValue(type, gp, tStep);
315 }
316}
317
318void
320 if (type == Stress) {
321 return LinearElasticMaterial::giveRealStressVector(answer, gp, flux, tStep);
322 } else if (type == DeviatoricStress) {
323 FloatMatrix d;
324 this->giveDeviatoricConstitutiveMatrix(d, TangentStiffness, gp, tStep);
325 answer.beProductOf(d, flux);
326 return;
327 } else {
328 OOFEM_ERROR("Not implemented");
329 }
330}
331
332void
334 if (type == DeviatoricStiffness) {
335 return this->giveDeviatoricConstitutiveMatrix(answer, type, gp, tStep);
336 } else {
337 return this->LinearElasticMaterial::giveCharacteristicMatrix(answer, type, gp, tStep);
338 }
339}
340
341} // end namespace oofem
#define REGISTER_Material(class)
virtual int read(int *data, std::size_t count)=0
Reads count integer values into array pointed by data.
virtual int write(const int *data, std::size_t count)=0
Writes count integer values from array pointed by data.
void setField(int item, InputFieldType id)
double & at(Index i)
Definition floatarray.h:202
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Definition floatarray.C:689
void times(double f)
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
void zero()
Zeroes all coefficient of receiver.
double at(std::size_t i, std::size_t j) const
void giveDeviatoric3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep) const override
double giveCharacteristicValue(MatResponseMode type, GaussPoint *gp, TimeStep *tStep) const override
Returns characteristic value of the receiver.
void giveDeviatoricPlaneStrainStiffMtrx(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep) const override
void giveCharacteristicMatrix(FloatMatrix &answer, MatResponseMode type, GaussPoint *gp, TimeStep *tStep) const override
void initTangents()
Initialized fixed size tangents. Called by ctor and initializeFrom.
double giveBulkModulus() const
Returns the bulk elastic modulus .
void giveCharacteristicVector(FloatArray &answer, FloatArray &flux, MatResponseMode type, GaussPoint *gp, TimeStep *tStep) const override
Returns characteristic vector of the receiver.
FloatMatrixF< 4, 4 > tangentPlaneStrain
LinearElasticMaterial(int n, Domain *d)
Constructor.
FloatMatrixF< 3, 3 > tangentPlaneStress
FloatMatrixF< 6, 6 > tangent
Preconstructed 3d tangent.
FloatArrayF< 6 > alpha
Thermal expansion.
double preCastStiffnessReduction
artificial isotropic damage to reflect reduction in stiffness for time < castingTime.
virtual void giveCharacteristicMatrix(FloatMatrix &answer, MatResponseMode type, GaussPoint *gp, TimeStep *tStep) const
Returns characteristic matrix of the receiver.
Definition material.h:140
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
virtual double giveCharacteristicValue(MatResponseMode type, GaussPoint *gp, TimeStep *tStep) const
Returns characteristic value of the receiver.
Definition material.C:68
virtual void giveDeviatoricConstitutiveMatrix(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep) const
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
void giveStressDependentPartOfStrainVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode) const
virtual void giveRealStressVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep) const
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
Definition timestep.h:166
#define THROW_CIOERR(e)
#define CM_Definition
Definition contextmode.h:47
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define _IFT_IsotropicLinearElasticMaterial_talpha
#define _IFT_IsotropicLinearElasticMaterial_n
#define _IFT_IsotropicLinearElasticMaterial_e
#define Ey
Definition matconst.h:60
#define NYyz
Definition matconst.h:52
#define Ez
Definition matconst.h:61
#define Gxz
Definition matconst.h:71
#define NYxy
Definition matconst.h:53
#define NYxz
Definition matconst.h:51
#define NYyx
Definition matconst.h:56
#define NYzy
Definition matconst.h:55
#define Gyz
Definition matconst.h:70
#define Ex
Definition matconst.h:59
#define NYzx
Definition matconst.h:54
#define Gxy
Definition matconst.h:72
long ContextMode
Definition contextmode.h:43
const FloatMatrixF< 6, 6 > I6_I6
I(x)I expressed in Voigt form.
const FloatMatrixF< 6, 6 > I_dev6
I_dev matrix in Voigt (stress) form.
@ CIO_IOERR
General IO error.

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