OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 2013 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 "../sm/Elements/structuralelement.h"
38 #include "material.h"
39 #include "../sm/Materials/structuralms.h"
40 #include "floatmatrix.h"
41 #include "gausspoint.h"
42 #include "mathfem.h"
43 #include "classfactory.h"
44 #include "dynamicinputrecord.h"
45 
46 namespace oofem {
47 #define ZERO_LENGTH 1.e-6
48 
49 REGISTER_Material(OrthotropicLinearElasticMaterial);
50 
53 {
54  IRResultType result; // Required by IR_GIVE_FIELD macro
55 
56  double value;
57  int size;
58  FloatArray triplets;
59 
60 
62  if ( result != IRRT_OK ) {
63  return result;
64  }
65 
67  propertyDictionary.add(Ex, value);
68 
70  propertyDictionary.add(Ey, value);
71 
73  propertyDictionary.add(Ez, value);
74 
75 
77  propertyDictionary.add(NYyz, value);
78 
80  propertyDictionary.add(NYxz, value);
81 
83  propertyDictionary.add(NYxy, value);
84 
85 
87  propertyDictionary.add(Gyz, value);
88 
90  propertyDictionary.add(Gxz, value);
91 
93  propertyDictionary.add(Gxy, value);
94 
95 
96 
99 
102 
105 
106  // check for suspicious parameters
107  // ask for dependent parameters (symmetry conditions) and check if reasonable
108  /*
109  * nyzx = this->give(NYzx);
110  * nyzy = this->give(NYzy);
111  * nyyx = this->give(NYyx);
112  * if ( ( nyzx < 0. ) || ( nyzx > 0.5 ) || ( nyzy < 0. ) || ( nyzy > 0.5 ) || ( nyyx < 0. ) || ( nyyx > 0.5 ) ) {
113  * OOFEM_WARNING("suspicious parameters", 1);
114  * }
115  */
116 
117  // Read local coordinate system of principal axes of ortotrophy
118  // in localCoordinateSystem the unity vectors are stored
119  // COLUMNWISE (this is exception, but allows faster numerical
120  // implementation)
121  // if you wish to align local material orientation with element, use "lcs" keyword as an element parameter
122 
123  // try to read lcs section
124  triplets.clear();
126 
127  size = triplets.giveSize();
128  if ( !( ( size == 0 ) || ( size == 6 ) ) ) {
129  OOFEM_WARNING( "Warning: lcs in material %d is not properly defined, will be assumed as global",
130  this->giveNumber() );
131  }
132 
133  if ( size == 6 ) {
134  cs_type = localCS;
135  double n1 = 0.0, n2 = 0.0;
136 
138  for ( int j = 1; j <= 3; j++ ) {
139  localCoordinateSystem->at(j, 1) = triplets.at(j);
140  n1 += triplets.at(j) * triplets.at(j);
141  localCoordinateSystem->at(j, 2) = triplets.at(j + 3);
142  n2 += triplets.at(j + 3) * triplets.at(j + 3);
143  }
144 
145  n1 = sqrt(n1);
146  n2 = sqrt(n2);
147  for ( int j = 1; j <= 3; j++ ) { // normalize e1' e2'
148  localCoordinateSystem->at(j, 1) /= n1;
149  localCoordinateSystem->at(j, 2) /= n2;
150  }
151 
152  // vector e3' computed from vector product of e1', e2'
153  localCoordinateSystem->at(1, 3) =
156  localCoordinateSystem->at(2, 3) =
159  localCoordinateSystem->at(3, 3) =
162  }
163 
164  // try to read ElementCS section
165  if ( cs_type == unknownCS ) {
166  triplets.clear();
167  IR_GIVE_OPTIONAL_FIELD(ir, triplets, _IFT_OrthotropicLinearElasticMaterial_scs); // cs for shells.
168  // first three numbers are direction of normal n - see orthoelasticmaterial.h for description
169  // shellCS - coordinate system of principal axes is specified in shell coordinate system
170  // this is defined as follows: principal z-axis is perpendicular to mid-section
171  // x-axis is perpendicular to z-axis and normal to user specified vector n.
172  // (so x-axis is parallel to plane, with n beeing normal to this plane).
173  // y-axis is then perpendicular both to x and z axes.
174  // WARNING: this definition of cs is valid only for plates and shells
175  // when vector n is paralel to z-axis an error occurs and program is terminated.
176  //
177  size = triplets.giveSize();
178  if ( !( ( size == 0 ) || ( size == 3 ) ) ) {
179  OOFEM_WARNING( "scs in material %d is not properly defined, will be assumed as global",
180  this->giveNumber() );
181  }
182 
183  if ( size == 3 ) {
184  cs_type = shellCS;
185  triplets.normalize();
186  helpPlaneNormal = new FloatArray(triplets);
187 
188  //
189  // store normal defining help plane into row matrix
190  // localCoordinateSystemmust be computed on demand from specific element
191  //
192  }
193  } //
194 
195  if ( cs_type == unknownCS ) {
196  //
197  // if no cs defined assume global one
198  //
199  cs_type = localCS;
202  }
203 
204  return IRRT_OK;
205 }
206 
207 
208 void
210 {
212 
213 
217 
221 
225 
229 
230 
232  // _IFT_OrthotropicLinearElasticMaterial_lcs
233  // _IFT_OrthotropicLinearElasticMaterial_scs
234 }
235 
236 double
238 {
239  if ( aProperty == NYzx ) {
240  return this->give(NYxz, gp) * this->give(Ez, gp) / this->give(Ex, gp);
241  }
242 
243  if ( aProperty == NYzy ) {
244  return this->give(NYyz, gp) * this->give(Ez, gp) / this->give(Ey, gp);
245  }
246 
247  if ( aProperty == NYyx ) {
248  return this->give(NYxy, gp) * this->give(Ey, gp) / this->give(Ex, gp);
249  }
250 
251  return this->Material :: give(aProperty, gp);
252 }
253 
254 
255 void
257  MatResponseMode mode,
258  GaussPoint *gp,
259  TimeStep *tStep)
260 {
261  FloatMatrix rotationMatrix;
262 
263  this->give3dLocalMaterialStiffnessMatrix(answer, mode, gp, tStep);
264 
265  this->giveRotationMatrix(rotationMatrix, gp);
266  answer.rotatedWith(rotationMatrix);
267 }
268 
269 
270 void
272  MatResponseMode mode,
273  GaussPoint *gp,
274  TimeStep *tStep)
275 {
276  double eksi, nxz, nyz, nxy, nzx, nzy, nyx;
277 
278  nxz = this->give(NYxz, gp);
279  nyz = this->give(NYyz, gp);
280  nxy = this->give(NYxy, gp);
281  nzx = this->give(NYzx, gp);
282  nzy = this->give(NYzy, gp);
283  nyx = this->give(NYyx, gp);
284 
285  eksi = 1. - ( nxy * nyx + nyz * nzy + nzx * nxz ) - ( nxy * nyz * nzx + nyx * nzy * nxz );
286 
287  answer.resize(6, 6);
288  answer.zero();
289  // switched letters from original oofem -> now produces same material stiffness matrix as Abaqus method
290  answer.at(1, 1) = this->give(Ex, gp) * ( 1. - nyz * nzy ) / eksi;
291  answer.at(1, 2) = this->give(Ey, gp) * ( nxy + nxz * nzy ) / eksi;
292  answer.at(1, 3) = this->give(Ez, gp) * ( nxz + nyz * nxy ) / eksi;
293  answer.at(2, 2) = this->give(Ey, gp) * ( 1. - nxz * nzx ) / eksi;
294  answer.at(2, 3) = this->give(Ez, gp) * ( nyz + nyx * nxz ) / eksi;
295  answer.at(3, 3) = this->give(Ez, gp) * ( 1. - nyx * nxy ) / eksi;
296 
297  // define the lower triangle
298  for ( int i = 1; i < 4; i++ ) {
299  for ( int j = 1; j < i; j++ ) {
300  answer.at(i, j) = answer.at(j, i);
301  }
302  }
303 
304  answer.at(4, 4) = this->give(Gyz, gp);
305  answer.at(5, 5) = this->give(Gxz, gp);
306  answer.at(6, 6) = this->give(Gxy, gp);
307 
308  if ( ( tStep->giveIntrinsicTime() < this->castingTime ) ) {
309  answer.times(1. - this->preCastStiffnessReduction);
310  }
311 }
312 
313 
314 void
316 //
317 // returns [3,3] rotation matrix from local principal axes of material
318 // to local axes used at gp (element) level
319 //
320 {
321  int elementCsFlag;
322  FloatMatrix elementCs;
323  StructuralElement *element = static_cast< StructuralElement * >( gp->giveElement() );
324 
325  if ( gp->giveMaterialMode() == _1dMat ) { //do not rotate 1D materials on trusses and beams
326  answer.resize(3, 3);
327  answer.beUnitMatrix();
328  return;
329  }
330 
331  elementCsFlag = element->giveLocalCoordinateSystem(elementCs);
332  //
333  // in localCoordinateSystem the directional cosines are stored columwise (exception)
334  // in elementCs rowwise.
335  //
336  if ( this->cs_type == localCS ) {
337  //
338  // in localCoordinateSystem are stored directional cosines
339  //
340  if ( elementCsFlag ) {
341  answer.beProductOf(elementCs, * this->localCoordinateSystem);
342  } else {
343  answer = * this->localCoordinateSystem;
344  }
345  } else if ( this->cs_type == shellCS ) {
346  FloatArray elementNormal, helpx, helpy;
348 
349  element->computeMidPlaneNormal(elementNormal, gp);
350  helpx.beVectorProductOf(* ( this->helpPlaneNormal ), elementNormal);
351  // test if localCoordinateSystem is uniquely
352  // defined by elementNormal and helpPlaneNormal
353  if ( helpx.computeNorm() < ZERO_LENGTH ) {
354  OOFEM_ERROR("element normal parallel to plane normal encountered");
355  }
356 
357  helpy.beVectorProductOf(elementNormal, helpx);
358  for ( int i = 1; i < 4; i++ ) {
359  localCoordinateSystem->at(i, 1) = helpx.at(i);
360  localCoordinateSystem->at(i, 2) = helpy.at(i);
361  localCoordinateSystem->at(i, 3) = elementNormal.at(i);
362  }
363 
364  //
365  // possible rotation about local z-axis should be considered in future
366  //
367  /*
368  * //
369  * // GiveZRotationMtrx assembles rotMtrx from cs rotated from curent about rotAngle
370  * // to current cs
371  * //
372  * zRotMtrx = GiveZRotationMtrx (rotAngle); // rotAngle supplied by user
373  * rotatedLocalCoordinateSystem = localCoordinateSystem->Times (zRotMtrx);
374  * delete localCoordinateSystem;
375  * localCoordinateSystem = rotatedLocalCoordinateSystem;
376  */
377  if ( elementCsFlag ) {
378  answer.beProductOf(elementCs, * this->localCoordinateSystem);
379  } else {
380  answer = * this->localCoordinateSystem;
381  }
382 
383  delete localCoordinateSystem;
384  localCoordinateSystem = NULL;
385  } else {
386  OOFEM_ERROR("internal error no cs defined");
387  }
388  // t at (i,j) contains cosine of angle between elementAxis(i) and localMaterialAxis(j).
389 }
390 
391 
392 void
394 //
395 // returns [6,6] rotation matrix from local principal axes of material
396 // to local axes used at the gp (element) level for beams and trusses
397 // at element level is implemented next transformation to global cs.
398 //
399 //
400 {
401  FloatMatrix t;
402  this->giveTensorRotationMatrix(t, gp);
403  this->giveStrainVectorTranformationMtrx(answer, t);
404 }
405 
406 
407 void
409  GaussPoint *gp, TimeStep *tStep)
410 //
411 // returns a FloatArray(3) of coefficients of thermal dilatation in direction
412 // of each (local) axis given by element lcs.
413 //
414 {
415  FloatMatrix transf;
416  FloatArray help(6);
417  help.at(1) = this->give(tAlphax, gp);
418  help.at(2) = this->give(tAlphay, gp);
419  help.at(3) = this->give(tAlphaz, gp);
420 
421  this->giveRotationMatrix(transf, gp);
422  answer.beProductOf(transf, help);
423 }
424 } // end namespace oofem
coordinate system of principal axes is specified in shell coordinate system this is defined as follow...
#define _IFT_OrthotropicLinearElasticMaterial_talphay
void setField(int item, InputFieldType id)
#define NYzx
Definition: matconst.h:54
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
virtual void giveThermalDilatationVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
Returns a vector of coefficients of thermal dilatation in direction of each material principal (local...
#define _IFT_OrthotropicLinearElasticMaterial_talphaz
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Computes vector product (or cross product) of vectors given as parameters, , and stores the result in...
Definition: floatarray.C:415
#define Ey
Definition: matconst.h:60
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
#define Gxz
Definition: matconst.h:71
#define Gxy
Definition: matconst.h:72
#define _IFT_OrthotropicLinearElasticMaterial_gxy
double & at(int aKey)
Returns the value of the pair which key is aKey.
Definition: dictionary.C:106
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
#define _IFT_OrthotropicLinearElasticMaterial_nyxz
void clear()
Clears receiver (zero size).
Definition: floatarray.h:206
double preCastStiffnessReduction
artificial isotropic damage to reflect reduction in stiffness for time < castingTime.
#define _IFT_OrthotropicLinearElasticMaterial_nyxy
#define Ex
Definition: matconst.h:59
Dictionary propertyDictionary
Property dictionary.
Definition: material.h:105
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Element * giveElement()
Returns corresponding element to receiver.
Definition: gausspoint.h:188
static void giveStrainVectorTranformationMtrx(FloatMatrix &answer, const FloatMatrix &base, bool transpose=false)
Computes 3d strain vector transformation matrix from standard vector transformation matrix...
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: material.C:110
Coordinate system of principal axes is specified in global coordinate system (general).
MatResponseMode
Describes the character of characteristic material matrix.
#define ZERO_LENGTH
#define _IFT_OrthotropicLinearElasticMaterial_lcs
void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
#define _IFT_OrthotropicLinearElasticMaterial_scs
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property &#39;aProperty&#39;.
Definition: material.C:52
void giveTensorRotationMatrix(FloatMatrix &answer, GaussPoint *gp)
Abstract base class for all "structural" finite elements.
#define _IFT_OrthotropicLinearElasticMaterial_ey
#define _IFT_OrthotropicLinearElasticMaterial_ex
#define _IFT_OrthotropicLinearElasticMaterial_nyyz
#define NYzy
Definition: matconst.h:55
#define OOFEM_ERROR(...)
Definition: error.h:61
#define Gyz
Definition: matconst.h:70
void giveRotationMatrix(FloatMatrix &answer, GaussPoint *gp)
void times(double f)
Multiplies receiver by factor f.
Definition: floatmatrix.C:1594
void rotatedWith(const FloatMatrix &r, char mode= 'n')
Returns the receiver &#39;a&#39; transformed using give transformation matrix r.
Definition: floatmatrix.C:1557
#define _IFT_OrthotropicLinearElasticMaterial_gxz
#define _IFT_OrthotropicLinearElasticMaterial_talphax
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
#define Ez
Definition: matconst.h:61
#define _IFT_OrthotropicLinearElasticMaterial_gyz
virtual int giveLocalCoordinateSystem(FloatMatrix &answer)
Returns local coordinate system of receiver Required by material models with ortho- and anisotrophy...
Definition: element.C:1234
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
Definition: timestep.h:148
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property &#39;aProperty&#39;.
Pair * add(int aKey, double value)
Adds a new Pair with given keyword and value into receiver.
Definition: dictionary.C:81
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
double computeNorm() const
Computes the norm (or length) of the vector.
Definition: floatarray.C:840
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
Class representing the general Input Record.
Definition: inputrecord.h:101
#define _IFT_OrthotropicLinearElasticMaterial_ez
Class representing the a dynamic Input Record.
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
void beUnitMatrix()
Sets receiver to unity matrix.
Definition: floatmatrix.C:1332
#define NYyx
Definition: matconst.h:56
#define NYyz
Definition: matconst.h:52
REGISTER_Material(DummyMaterial)
double castingTime
Casting time.
Definition: material.h:113
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:337
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual void give3dLocalMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes local 3d stiffness matrix of the receiver.
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
int giveNumber() const
Definition: femcmpnn.h:107
double normalize()
Normalizes receiver.
Definition: floatarray.C:828
#define tAlphax
Definition: matconst.h:64
#define tAlphay
Definition: matconst.h:65
#define NYxy
Definition: matconst.h:53
Class representing integration point in finite element program.
Definition: gausspoint.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
virtual void computeMidPlaneNormal(FloatArray &answer, const GaussPoint *gp)
Computes mid-plane normal of receiver at integration point.
Definition: element.C:1248
Class representing solution step.
Definition: timestep.h:80
Unknown coordinate system.
#define NYxz
Definition: matconst.h:51
#define tAlphaz
Definition: matconst.h:66

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011