OOFEM 3.0
Loading...
Searching...
No Matches
ortholinearelasticmaterial.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
38#include "material.h"
40#include "floatmatrix.h"
41#include "floatarrayf.h"
42#include "floatmatrixf.h"
43#include "gausspoint.h"
44#include "mathfem.h"
45#include "classfactory.h"
46#include "dynamicinputrecord.h"
47
48namespace oofem {
49#define ZERO_LENGTH 1.e-6
50
52
53void
54OrthotropicLinearElasticMaterial :: initializeFrom(InputRecord &ir)
55{
56 double value;
57 int size;
58 FloatArray triplets;
59
60 LinearElasticMaterial :: initializeFrom(ir);
61
63 propertyDictionary.add(Ex, value);
64
66 propertyDictionary.add(Ey, value);
67
69 propertyDictionary.add(Ez, value);
70
71
73 propertyDictionary.add(NYyz, value);
74
76 propertyDictionary.add(NYxz, value);
77
79 propertyDictionary.add(NYxy, value);
80
81
83 propertyDictionary.add(Gyz, value);
84
86 propertyDictionary.add(Gxz, value);
87
89 propertyDictionary.add(Gxy, value);
90
91
92
94 propertyDictionary.add(tAlphax, value);
95
97 propertyDictionary.add(tAlphay, value);
98
100 propertyDictionary.add(tAlphaz, value);
101
102 // check for suspicious parameters
103 // ask for dependent parameters (symmetry conditions) and check if reasonable
104 /*
105 * nyzx = this->give(NYzx);
106 * nyzy = this->give(NYzy);
107 * nyyx = this->give(NYyx);
108 * if ( ( nyzx < 0. ) || ( nyzx > 0.5 ) || ( nyzy < 0. ) || ( nyzy > 0.5 ) || ( nyyx < 0. ) || ( nyyx > 0.5 ) ) {
109 * OOFEM_WARNING("suspicious parameters", 1);
110 * }
111 */
112
113 // Read local coordinate system of principal axes of ortotrophy
114 // in localCoordinateSystem the unity vectors are stored
115 // COLUMNWISE (this is exception, but allows faster numerical
116 // implementation)
117 // if you wish to align local material orientation with element, use "lcs" keyword as an element parameter
118
119 // try to read lcs section
120 triplets.clear();
122
123 size = triplets.giveSize();
124 if ( !( ( size == 0 ) || ( size == 6 ) ) ) {
125 OOFEM_WARNING( "Warning: lcs in material %d is not properly defined, will be assumed as global",
126 this->giveNumber() );
127 }
128
129 if ( size == 6 ) {
131 double n1 = 0.0, n2 = 0.0;
132
134 for ( int j = 1; j <= 3; j++ ) {
135 localCoordinateSystem.at(j, 1) = triplets.at(j);
136 n1 += triplets.at(j) * triplets.at(j);
137 localCoordinateSystem.at(j, 2) = triplets.at(j + 3);
138 n2 += triplets.at(j + 3) * triplets.at(j + 3);
139 }
140
141 n1 = sqrt(n1);
142 n2 = sqrt(n2);
143 for ( int j = 1; j <= 3; j++ ) { // normalize e1' e2'
144 localCoordinateSystem.at(j, 1) /= n1;
145 localCoordinateSystem.at(j, 2) /= n2;
146 }
147
148 // vector e3' computed from vector product of e1', e2'
149 localCoordinateSystem.at(1, 3) =
150 ( localCoordinateSystem.at(2, 1) * localCoordinateSystem.at(3, 2) -
151 localCoordinateSystem.at(3, 1) * localCoordinateSystem.at(2, 2) );
152 localCoordinateSystem.at(2, 3) =
153 ( localCoordinateSystem.at(3, 1) * localCoordinateSystem.at(1, 2) -
154 localCoordinateSystem.at(1, 1) * localCoordinateSystem.at(3, 2) );
155 localCoordinateSystem.at(3, 3) =
156 ( localCoordinateSystem.at(1, 1) * localCoordinateSystem.at(2, 2) -
157 localCoordinateSystem.at(2, 1) * localCoordinateSystem.at(1, 2) );
158 }
159
160 // try to read ElementCS section
161 if ( cs_type == unknownCS ) {
162 triplets.clear();
164 // first three numbers are direction of normal n - see orthoelasticmaterial.h for description
165 // shellCS - coordinate system of principal axes is specified in shell coordinate system
166 // this is defined as follows: principal z-axis is perpendicular to mid-section
167 // x-axis is perpendicular to z-axis and normal to user specified vector n.
168 // (so x-axis is parallel to plane, with n beeing normal to this plane).
169 // y-axis is then perpendicular both to x and z axes.
170 // WARNING: this definition of cs is valid only for plates and shells
171 // when vector n is paralel to z-axis an error occurs and program is terminated.
172 //
173 size = triplets.giveSize();
174 if ( !( ( size == 0 ) || ( size == 3 ) ) ) {
175 OOFEM_WARNING( "scs in material %d is not properly defined, will be assumed as global",
176 this->giveNumber() );
177 }
178
179 if ( size == 3 ) {
181 triplets.normalize();
182 helpPlaneNormal = triplets;
183
184 //
185 // store normal defining help plane into row matrix
186 // localCoordinateSystemmust be computed on demand from specific element
187 //
188 }
189 } //
190
191 if ( cs_type == unknownCS ) {
192 //
193 // if no cs defined assume global one
194 //
197 }
198
199 {
200 double ex = propertyDictionary.at(Ex);
201 double ey = propertyDictionary.at(Ey);
202 double ez = propertyDictionary.at(Ez);
203 double nxz = propertyDictionary.at(NYxz);
204 double nyz = propertyDictionary.at(NYyz);
205 double nxy = propertyDictionary.at(NYxy);
206 double nzx = nxz * ez / ex;
207 double nzy = nyz * ez / ey;
208 double nyx = nxy * ey / ex;
209 double eksi = 1. - ( nxy * nyx + nyz * nzy + nzx * nxz ) - ( nxy * nyz * nzx + nyx * nzy * nxz );
210
212 tangent.at(1, 1) = ex * ( 1. - nyz * nzy ) / eksi;
213 tangent.at(1, 2) = ey * ( nxy + nxz * nzy ) / eksi;
214 tangent.at(1, 3) = ez * ( nxz + nyz * nxy ) / eksi;
215 tangent.at(2, 2) = ey * ( 1. - nxz * nzx ) / eksi;
216 tangent.at(2, 3) = ez * ( nyz + nyx * nxz ) / eksi;
217 tangent.at(3, 3) = ez * ( 1. - nyx * nxy ) / eksi;
218 tangent.at(4, 4) = propertyDictionary.at(Gyz);
219 tangent.at(5, 5) = propertyDictionary.at(Gxz);
220 tangent.at(6, 6) = propertyDictionary.at(Gxy);
221 tangent.symmetrized();
222 this->computesSubTangents();
223
225 }
226}
227
228
229void
256
257double
258OrthotropicLinearElasticMaterial :: give(int aProperty, GaussPoint *gp) const
259{
260 if ( aProperty == NYzx ) {
261 return this->give(NYxz, gp) * this->give(Ez, gp) / this->give(Ex, gp);
262 }
263
264 if ( aProperty == NYzy ) {
265 return this->give(NYyz, gp) * this->give(Ez, gp) / this->give(Ey, gp);
266 }
267
268 if ( aProperty == NYyx ) {
269 return this->give(NYxy, gp) * this->give(Ey, gp) / this->give(Ex, gp);
270 }
271
272 return this->Material :: give(aProperty, gp);
273}
274
275
277OrthotropicLinearElasticMaterial :: give3dMaterialStiffnessMatrix(MatResponseMode mode,
278 GaussPoint *gp,
279 TimeStep *tStep) const
280{
281 auto t = tangent;
282 if ( ( tStep->giveIntrinsicTime() < this->castingTime ) ) {
283 t *= 1. - this->preCastStiffnessReduction;
284 }
285
286 auto rotationMatrix = this->giveRotationMatrix(gp);
287 return rotate(t, rotationMatrix);
288}
289
290
292OrthotropicLinearElasticMaterial :: giveTensorRotationMatrix(GaussPoint *gp) const
293//
294// returns [3,3] rotation matrix from local principal axes of material
295// to local axes used at gp (element) level
296//
297{
298 if ( gp->giveMaterialMode() == _1dMat ) { //do not rotate 1D materials on trusses and beams
299 return eye<3>();
300 }
301
302 auto element = static_cast< StructuralElement * >( gp->giveElement() );
303 FloatMatrix elementCs_;
304 int elementCsFlag = element->giveLocalCoordinateSystem(elementCs_);
305 FloatMatrixF<3,3> elementCs;
306 if (elementCsFlag) {
307 elementCs = elementCs_;
308 }
309 //
310 // in localCoordinateSystem the directional cosines are stored columwise (exception)
311 // in elementCs rowwise.
312 //
313 if ( this->cs_type == localCS ) {
314 //
315 // in localCoordinateSystem are stored directional cosines
316 //
317 if ( elementCsFlag ) {
318 return dot(elementCs, this->localCoordinateSystem);
319 } else {
320 return this->localCoordinateSystem;
321 }
322 } else if ( this->cs_type == shellCS ) {
323 FloatArray elementNormal;
324 element->computeMidPlaneNormal(elementNormal, gp);
325 auto helpx = cross(this->helpPlaneNormal, elementNormal);
326 // test if localCoordinateSystem is uniquely
327 // defined by elementNormal and helpPlaneNormal
328 if ( norm(helpx) < ZERO_LENGTH ) {
329 OOFEM_ERROR("element normal parallel to plane normal encountered");
330 }
331
332 auto helpy = cross(elementNormal, helpx);
334 for ( int i = 1; i < 4; i++ ) {
335 cs.at(i, 1) = helpx.at(i);
336 cs.at(i, 2) = helpy.at(i);
337 cs.at(i, 3) = elementNormal.at(i);
338 }
339
340 //
341 // possible rotation about local z-axis should be considered in future
342 //
343 /*
344 * //
345 * // GiveZRotationMtrx assembles rotMtrx from cs rotated from curent about rotAngle
346 * // to current cs
347 * //
348 * zRotMtrx = GiveZRotationMtrx (rotAngle); // rotAngle supplied by user
349 * rotatedLocalCoordinateSystem = localCoordinateSystem->Times (zRotMtrx);
350 * localCoordinateSystem = rotatedLocalCoordinateSystem;
351 */
352 if ( elementCsFlag ) {
353 return dot(elementCs, cs);
354 } else {
355 return cs;
356 }
357 } else {
358 OOFEM_ERROR("internal error no cs defined");
359 }
360 // t at (i,j) contains cosine of angle between elementAxis(i) and localMaterialAxis(j).
361}
362
363
365OrthotropicLinearElasticMaterial :: giveRotationMatrix(GaussPoint *gp) const
366//
367// returns [6,6] rotation matrix from local principal axes of material
368// to local axes used at the gp (element) level for beams and trusses
369// at element level is implemented next transformation to global cs.
370//
371//
372{
373 auto t = this->giveTensorRotationMatrix(gp);
374 return this->giveStrainVectorTranformationMtrx(t);
375}
376
377
379OrthotropicLinearElasticMaterial :: giveThermalDilatationVector(GaussPoint *gp, TimeStep *tStep) const
380{
381 auto transf = this->giveRotationMatrix(gp);
382 return dot(transf, alpha);
383}
384} // end namespace oofem
#define REGISTER_Material(class)
void setField(int item, InputFieldType id)
int giveNumber() const
Definition femcmpnn.h:104
double & at(Index i)
Definition floatarray.h:202
Index giveSize() const
Returns the size of receiver.
Definition floatarray.h:261
double at(std::size_t i, std::size_t j) const
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.
Dictionary propertyDictionary
Definition material.h:107
double give(int aProperty, GaussPoint *gp) const override
FloatMatrixF< 6, 6 > giveRotationMatrix(GaussPoint *gp) const
FloatMatrixF< 3, 3 > giveTensorRotationMatrix(GaussPoint *gp) const
static FloatMatrixF< 6, 6 > giveStrainVectorTranformationMtrx(const FloatMatrixF< 3, 3 > &base, bool transpose=false)
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
Definition timestep.h:166
#define OOFEM_WARNING(...)
Definition error.h:80
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define Ey
Definition matconst.h:60
#define NYyz
Definition matconst.h:52
#define tAlphay
Definition matconst.h:65
#define Ez
Definition matconst.h:61
#define Gxz
Definition matconst.h:71
#define NYxy
Definition matconst.h:53
#define tAlphaz
Definition matconst.h:66
#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
#define tAlphax
Definition matconst.h:64
double norm(const FloatArray &x)
@ localCS
Coordinate system of principal axes is specified in global coordinate system (general).
@ unknownCS
Unknown coordinate system.
FloatArrayF< 3 > cross(const FloatArrayF< 3 > &x, const FloatArrayF< 3 > &y)
Computes $ x \cross y $.
FloatMatrixF< M, M > rotate(FloatMatrixF< N, N > &a, const FloatMatrixF< N, M > &r)
Computes .
double dot(const FloatArray &x, const FloatArray &y)
FloatMatrixF< N, N > eye()
Constructs an identity matrix.
#define ZERO_LENGTH
#define _IFT_OrthotropicLinearElasticMaterial_scs
#define _IFT_OrthotropicLinearElasticMaterial_nyyz
#define _IFT_OrthotropicLinearElasticMaterial_lcs
#define _IFT_OrthotropicLinearElasticMaterial_talphaz
#define _IFT_OrthotropicLinearElasticMaterial_talphay
#define _IFT_OrthotropicLinearElasticMaterial_nyxz
#define _IFT_OrthotropicLinearElasticMaterial_ey
#define _IFT_OrthotropicLinearElasticMaterial_gxz
#define _IFT_OrthotropicLinearElasticMaterial_nyxy
#define _IFT_OrthotropicLinearElasticMaterial_talphax
#define _IFT_OrthotropicLinearElasticMaterial_gyz
#define _IFT_OrthotropicLinearElasticMaterial_ex
#define _IFT_OrthotropicLinearElasticMaterial_gxy
#define _IFT_OrthotropicLinearElasticMaterial_ez

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