OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
compodamagemat.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 
35 #include "compodamagemat.h"
36 #include "../sm/Elements/structuralelement.h"
37 #include "gausspoint.h"
38 #include "../sm/Materials/structuralmaterial.h"
39 #include "../sm/Materials/structuralms.h"
40 #include "mathfem.h"
41 #include "classfactory.h"
42 #include "contextioerr.h"
43 #include "crosssection.h"
44 
45 namespace oofem {
46 REGISTER_Material(CompoDamageMat);
47 
49 {
50 }
51 
52 
54 {
55 }
56 
57 
59 {
60  double value;
61  IRResultType result; // Required by IR_GIVE_FIELD macro
62 
63  //define transversely othotropic material stiffness parameters
65  propertyDictionary.add(Ex, value);
67  propertyDictionary.add(Ey, value);
68  propertyDictionary.add(Ez, value);
70  propertyDictionary.add(NYxy, value);
71  propertyDictionary.add(NYxz, value);
73  propertyDictionary.add(NYyz, value);
74  propertyDictionary.add(NYzy, value);
76  propertyDictionary.add(Gxy, value);
77  propertyDictionary.add(Gxz, value);
78 
79  //calulate remaining components
80  propertyDictionary.add( Gyz, this->give(Ey, NULL) / ( 1. + this->give(NYxy, NULL) ) );
81  propertyDictionary.add( NYyx, this->give(Ey, NULL) * this->give(NYxy, NULL) / this->give(Ex, NULL) );
82  //propertyDictionary -> add(Gzy,this->give(Gyz,NULL));
83  propertyDictionary.add( NYzx, this->give(NYyx, NULL) );
84 
86 
87  //this->inputTension.printYourself();
89 
90  if ( this->inputTension.giveSize() != 12 ) {
91  OOFEM_ERROR("need 12 components for tension in pairs f0 Gf for all 6 directions");
92  }
93 
94  if ( this->inputCompression.giveSize() != 12 ) {
95  OOFEM_ERROR("need 12 components for compression in pairs f0 Gf for all 6 directions");
96  }
97 
98  for ( int i = 1; i <= 12; i += 2 ) {
99  if ( this->inputTension.at(i) < 0.0 ) {
100  OOFEM_ERROR("negative f0 detected for tension");
101  }
102 
103  if ( this->inputCompression.at(i) > 0.0 ) {
104  OOFEM_ERROR("positive f0 detected for compression");
105  }
106  }
107 
108  this->afterIter = 0;
110 
111  this->afterIter = 0;
113 
114  return Material :: initializeFrom(ir);
115 }
116 
118 {
120  OOFEM_ERROR("Not implemented yet");
121 }
122 
123 
124 //called at the beginning of each time increment (not iteration), no influence of parameter
126 {
127  FloatMatrix rotationMatrix;
128 
129  //already with reduced components
130  this->giveUnrotated3dMaterialStiffnessMatrix(answer, mode, gp);
131  if ( this->giveMatStiffRotationMatrix(rotationMatrix, gp) ) { //material rotation due to lcs
132  answer.rotatedWith(rotationMatrix);
133  }
134 }
135 
136 //called in each iteration, support for 3D and 1D material mode
138 {
139  int i_max, s;
140  double delta, sigma, charLen, tmp = 0., Gf_tmp;
141  CompoDamageMatStatus *st = static_cast< CompoDamageMatStatus * >( this->giveStatus(gp) );
142  Element *element = gp->giveElement();
143  FloatArray strainVectorL(6), stressVectorL(6), tempStressVectorL(6), reducedTotalStrainVector(6), ans, equilStressVectorL(6), equilStrainVectorL(6), charLenModes(6);
144  FloatArray *inputFGf;
145  FloatMatrix de, elementCs(3, 3);
146  MaterialMode mMode = gp->giveMaterialMode();
147 
148  st->Iteration++; //increase the call number at IP
149 
150  //subtract strain independent part - temperature, creep ..., in global c.s.
151  this->giveStressDependentPartOfStrainVector(reducedTotalStrainVector, gp, totalStrain, tStep, VM_Total);
152  //reducedTotalStrainVector.printYourself();
153 
154  switch ( mMode ) {
155  case _3dMat: //applies only for 3D
156  {
157  if ( !element->giveLocalCoordinateSystem(elementCs) ) { //lcs undefined
158  elementCs.resize(3, 3);
159  elementCs.beUnitMatrix();
160  }
161 
162  //first run
163  if ( st->elemCharLength.at(1) == 0. ) {
164  this->giveCharLength(st, gp, elementCs);
165  //check that no snap-back occurs due to large element characteristic length (fixed-crack orientation)
166  //see Bazant, Planas: Fracture and Size Effect, pp. 251
167  this->checkSnapBack(gp, mMode);
168  }
169 
170  //transform strain to local c.s.
171  this->transformStrainVectorTo(strainVectorL, elementCs, reducedTotalStrainVector, 0);
172  //strainVectorL.printYourself();
173 
174  //damage criteria based on stress, assuming same damage parameter for tension/compression
175  //determine unequilibrated stress vector
176  this->giveUnrotated3dMaterialStiffnessMatrix(de, SecantStiffness, gp);
177  tempStressVectorL.beProductOf(de, strainVectorL);
178  i_max = 6;
179  break;
180  }
181 
182  case _1dMat:
183  { //applies only for 1D, strain vectors are already in local c.s.
184  if ( st->elemCharLength.at(1) == 0. ) {
185  FloatArray normal(0);
186  st->elemCharLength.at(1) = gp->giveElement()->giveCharacteristicLength(normal); //truss length
187  this->checkSnapBack(gp, mMode);
188  }
189 
190  strainVectorL.at(1) = reducedTotalStrainVector.at(1);
191  tempStressVectorL.zero();
192  tempStressVectorL.at(1) = this->give(Ex, NULL) * strainVectorL.at(1);
193  i_max = 1;
194  break;
195  }
196  default:
197  {
198  OOFEM_ERROR("Material mode %s not supported", __MaterialModeToString(mMode) );
199  i_max = 0;
200  }
201  }
202 
203  //proceed 6 components for 3D or 1 component for 1D, damage evolution is based on the evolution of strains
204  //xx, yy, zz, yz, zx, xy
205  for ( int i = 1; i <= i_max; i++ ) {
206  if ( tempStressVectorL.at(i) >= 0. ) { //unequilibrated stress, tension
207  inputFGf = & inputTension; //contains pairs (stress - fracture energy)
208  s = 0;
209  } else { //unequilibrated stress, compression
210  inputFGf = & inputCompression;
211  s = 6;
212  }
213 
214  if ( ( fabs( tempStressVectorL.at(i) ) > fabs( ( * inputFGf ).at(2 * i - 1) ) ) && ( st->strainAtMaxStress.at(i + s) == 0. ) && ( st->Iteration > this->afterIter ) ) { //damage initiated now, can be replaced for more advanced initiation criteria, e.g. Hill's maximum combination of stresses
215  //equilibrated strain and stress from the last time step, transform to local c.s.
216  switch ( mMode ) {
217  case _3dMat:
218  ans = st->giveStrainVector();
219  this->transformStrainVectorTo(equilStrainVectorL, elementCs, ans, 0);
220  ans = st->giveStressVector();
221  this->transformStressVectorTo(equilStressVectorL, elementCs, ans, 0);
222  break;
223 
224  case _1dMat:
225  equilStrainVectorL = st->giveStrainVector();
226  equilStressVectorL = st->giveStressVector();
227  break;
228 
229  default:
230  OOFEM_ERROR("Material mode %s not supported", __MaterialModeToString(mMode) );
231  }
232 
233  //subdivide last increment, interpolate, delta in range <0;1>
234  delta = ( ( * inputFGf ).at(2 * i - 1) - equilStressVectorL.at(i) ) / ( tempStressVectorL.at(i) - equilStressVectorL.at(i) );
235  delta = min(delta, 1.);
236  delta = max(delta, 0.); //stabilize transition from tensile to compression (denom -> 0)
237 
238  st->strainAtMaxStress.at(i + s) = equilStrainVectorL.at(i) + delta * ( strainVectorL.at(i) - equilStrainVectorL.at(i) );
239 
240  st->initDamageStress.at(i + s) = equilStressVectorL.at(i) + delta * ( tempStressVectorL.at(i) - equilStressVectorL.at(i) );
241 
242  //determine characteristic length for six stresses/strains
243  this->giveCharLengthForModes(charLenModes, gp);
244  charLen = charLenModes.at(i);
245 
246  //determine maximum strain at zero stress based on fracture energy - mode I, linear softening
247  //st->maxStrainAtZeroStress.at(i + s) = st->strainAtMaxStress.at(i + s) + 2 * fabs( ( * inputFGf ).at(2 * i) ) / charLen / st->initDamageStress.at(i + s); //Gf scaled for characteristic size
248  //st->maxStrainAtZeroStress.at(i + s) = 2 * fabs( ( * inputFGf ).at(2 * i) ) / charLen / st->initDamageStress.at(i + s); //Gf scaled for characteristic size
249  //st->maxStrainAtZeroStress.at(i + s) = 2 * fabs( ( * inputFGf ).at(2 * i) ) / charLen / st->initDamageStress.at(i + s);
250 
251  switch ( i ) {
252  case 1: tmp = this->give(Ex, NULL);
253  break;
254  case 2: tmp = this->give(Ey, NULL);
255  break;
256  case 3: tmp = this->give(Ez, NULL);
257  break;
258  case 4: tmp = this->give(Gyz, NULL);
259  break;
260  case 5: tmp = this->give(Gxz, NULL);
261  break;
262  case 6: tmp = this->give(Gxy, NULL);
263  break;
264  }
265 
266  //remaining fracture energy for the softening part in [N/m], calculated as a 1D case
267  Gf_tmp = ( * inputFGf ).at(2 * i) - st->initDamageStress.at(i + s) * st->initDamageStress.at(i + s) * charLen / 2. / tmp;
268 
269  if ( Gf_tmp < 0. ) {
270  OOFEM_WARNING("Too large initiation trial stress in element %d, component %d, |%f| < |%f|=f_t, negative remaining Gf=%f, treated as a snap-back", gp->giveElement()->giveNumber(), s == 0 ? i : -i, st->initDamageStress.at(i + s), tempStressVectorL.at(i), Gf_tmp);
271  st->hasSnapBack.at(i) = 1;
272  }
273 
274  st->maxStrainAtZeroStress.at(i + s) = st->strainAtMaxStress.at(i + s) + 2 * Gf_tmp / charLen / st->initDamageStress.at(i + s); //scaled for element's characteristic size
275 
276  //check the snap-back
277  if ( fabs( st->maxStrainAtZeroStress.at(i + s) ) < fabs( st->strainAtMaxStress.at(i + s) ) && st->hasSnapBack.at(i) == 0 ) {
278  OOFEM_WARNING( "Snap-back occured in element %d, component %d, |elastic strain=%f| > |fracturing strain %f|", gp->giveElement()->giveNumber(), s == 0 ? i : -i, st->strainAtMaxStress.at(i + s), st->maxStrainAtZeroStress.at(i + s) );
279  st->hasSnapBack.at(i) = 1;
280  }
281  }
282 
283  if ( st->strainAtMaxStress.at(i + s) != 0. && fabs( strainVectorL.at(i) ) > fabs( st->kappa.at(i + s) ) ) { //damage started and grows
284  //OOFEM_LOG_INFO("Damage at strain %f and stress %f (i=%d, s=%d) in GP %d element %d\n", st->strainAtMaxStress.at(i + s), tempStressVectorL.at(i), i, s,gp->giveNumber(), gp->giveElement()->giveNumber() );
285  //desired stress
286  sigma = st->initDamageStress.at(i + s) * ( st->maxStrainAtZeroStress.at(i + s) - strainVectorL.at(i) ) / ( st->maxStrainAtZeroStress.at(i + s) - st->strainAtMaxStress.at(i + s) );
287 
288  //check that sigma remains in tension/compression area
289  if ( s == 0 ) { //tension
290  sigma = max(sigma, 0.000001);
291  } else {
292  sigma = min(sigma, -0.000001);
293  }
294 
295  switch ( i ) { //need to subtract contributions from strains
296  //in equations we use nu12 = E11/E22*nu21, nu13 = E11/E33*nu31, nu23 = E22/E33*nu32
297  case 1: tmp = 1. - sigma / ( this->give(Ex, NULL) * strainVectorL.at(i) + this->give(NYxy, NULL) * tempStressVectorL.at(2) + this->give(NYxz, NULL) * tempStressVectorL.at(3) );
298  break;
299  case 2: tmp = 1. - sigma / ( this->give(Ey, NULL) * strainVectorL.at(i) + this->give(NYyx, NULL) * tempStressVectorL.at(1) + this->give(NYyz, NULL) * tempStressVectorL.at(3) );
300  break;
301  case 3: tmp = 1. - sigma / ( this->give(Ez, NULL) * strainVectorL.at(i) + this->give(NYzx, NULL) * tempStressVectorL.at(1) + this->give(NYzy, NULL) * tempStressVectorL.at(2) );
302  break;
303  case 4: tmp = 1. - sigma / this->give(Gyz, NULL) / strainVectorL.at(i);
304  break;
305  case 5: tmp = 1. - sigma / this->give(Gxz, NULL) / strainVectorL.at(i);
306  break;
307  case 6: tmp = 1. - sigma / this->give(Gxy, NULL) / strainVectorL.at(i);
308  break;
309  }
310 
311  st->tempOmega.at(i) = max( tmp, st->omega.at(i) ); //damage can only grow, interval <0;1>
312  st->tempOmega.at(i) = min(st->tempOmega.at(i), 0.9999);
313  st->tempOmega.at(i) = max(st->tempOmega.at(i), 0.0000);
314  st->tempKappa.at(i + s) = strainVectorL.at(i);
315 
316  if ( st->hasSnapBack.at(i) == 1 ) {
317  st->tempOmega.at(i) = 0.9999;
318  }
319  }
320  }
321 
322  switch ( mMode ) {
323  case _3dMat: {
324  //already with reduced stiffness components in local c.s.
325  this->giveUnrotated3dMaterialStiffnessMatrix(de, SecantStiffness, gp);
326  //de.printYourself();
327  //in local c.s.
328  stressVectorL.beProductOf(de, strainVectorL);
329  //stressVectorL.printYourself();
330  //transform local c.s to global c.s.
331  st->tempStressMLCS = stressVectorL;
332  this->transformStressVectorTo(answer, elementCs, stressVectorL, 1);
333  break;
334  }
335  case _1dMat: {
336  answer.resize(1);
337  answer.at(1) = ( 1 - st->tempOmega.at(1) ) * this->give(Ex, NULL) * strainVectorL.at(1); //tempStress
338  st->tempStressMLCS.at(1) = answer.at(1);
339  break;
340  }
341  default:
342  OOFEM_ERROR("Material mode not supported");
343  }
344 
345  st->letTempStressVectorBe(answer); //needed in global c.s for 3D
346 
347  //not changed inside this function body
348  st->letTempStrainVectorBe(totalStrain); //needed in global c.s for 3D
349 }
350 
351 //used for output in *.hom a *.out
353 {
354  CompoDamageMatStatus *status = static_cast< CompoDamageMatStatus * >( this->giveStatus(gp) );
355  if ( type == IST_DamageTensor ) {
356  answer = status->omega;
357  } else {
358  StructuralMaterial :: giveIPValue(answer, gp, type, tStep);
359  }
360 
361  return 1;
362 }
363 
365 {
366  double denom;
367  double ex, ey, ez, nxy, nxz, nyz, gyz, gzx, gxy;
368  double a, b, c, d, e, f;
369  FloatArray tempOmega;
370 
371  answer.resize(6, 6);
372  answer.zero();
373 
374  CompoDamageMatStatus *st = static_cast< CompoDamageMatStatus * >( this->giveStatus(gp) );
375 
376  ex = this->give(Ex, NULL);
377  ey = this->give(Ey, NULL);
378  ez = this->give(Ez, NULL);
379  nxy = this->give(NYxy, NULL);
380  nxz = nxy;
381  nyz = this->give(NYyz, NULL);
382  gyz = this->give(Gyz, NULL);
383  gzx = this->give(Gxz, NULL);
384  gxy = this->give(Gxy, NULL);
385 
386  //xx, yy, zz, yz, zx, xy
387  //assemble stiffness matrix for transversely orthotropic material with reduced moduli, derived from compliance matrix with only reduced diagonal terms. Procedure can be used for fully orthotropic stiffness matrix as well
388  a = 1. - st->tempOmega.at(1);
389  b = 1. - st->tempOmega.at(2);
390  c = 1. - st->tempOmega.at(3);
391  d = 1. - st->tempOmega.at(4);
392  e = 1. - st->tempOmega.at(5);
393  f = 1. - st->tempOmega.at(6);
394 
395  if ( mode == ElasticStiffness ) {
396  a = b = c = d = e = f = 0.;
397  }
398 
399  denom = -ey * ex + ex * nyz * nyz * b * c * ez + nxy * nxy * a * b * ey * ey + 2 * nxy * a * b * ey * nxz * nyz * c * ez + nxz * nxz * a * ey * c * ez;
400 
401  answer.at(1, 1) = ( -ey + nyz * nyz * b * c * ez ) * a * ex * ex / denom;
402  answer.at(1, 2) = -( nxy * ey + nxz * nyz * c * ez ) * ex * ey * a * b / denom;
403  answer.at(1, 3) = -( nxy * nyz * b + nxz ) * ey * ex * a * c * ez / denom;
404  answer.at(2, 2) = ( -ex + nxz * nxz * a * c * ez ) * b * ey * ey / denom;
405  answer.at(2, 3) = -( nyz * ex + nxz * nxy * a * ey ) * ey * b * c * ez / denom;
406  answer.at(3, 3) = ( -ex + nxy * nxy * a * b * ey ) * ey * c * ez / denom;
407  answer.at(4, 4) = gyz;
408  answer.at(5, 5) = gzx;
409  answer.at(6, 6) = gxy;
410  answer.symmetrized();
411  //answer.printYourself();
412 }
413 
414 //returns material rotation stiffness matrix [6x6]
416 {
417  FloatMatrix Lt(3, 3);
418  StructuralElement *element = static_cast< StructuralElement * >( gp->giveElement() );
419  MaterialMode mMode = gp->giveMaterialMode();
420 
421  switch ( mMode ) {
422  case _1dMat: //do not rotate 1D materials on trusses and beams
423  break;
424  case _3dMat:
425  if ( !element->giveLocalCoordinateSystem(Lt) ) { //lcs not defined on element
426  return 0;
427  }
428 
429  //rotate from unrotated (base) c.s. to local material c.s.
430  this->giveStrainVectorTranformationMtrx(answer, Lt);
431  return 1;
432 
433  break;
434  default:
435  OOFEM_ERROR("Material mode %s not supported", __MaterialModeToString(mMode) );
436  }
437 
438  return 0;
439 }
440 
441 // determine characteristic fracture area for three orthogonal cracks, based on the size of element (crack band model).
442 // Since the orientation of cracks is aligned with the orientation of material, determination is based only on the geometry (not on the direction of principal stress etc.).
443 // Assumption that fracture localizes into all integration points on element.
444 // Material orientation in global c.s. is passed. Called in the first run
446 {
447  FloatArray crackPlaneNormal(3);
448 
449  //elementCs.printYourself();
450 
451  //normal to x,y,z is the same as in elementCs
452 
453  for ( int i = 1; i <= 3; i++ ) {
454  for ( int j = 1; j <= 3; j++ ) {
455  crackPlaneNormal.at(j) = elementCs.at(j, i);
456  }
457 
458  status->elemCharLength.at(i) = gp->giveElement()->giveCharacteristicLength(crackPlaneNormal);
459  }
460 }
461 
462 //determine characteristic length for six stresses/strains in their modes
463 void
465 {
466  CompoDamageMatStatus *st = static_cast< CompoDamageMatStatus * >( this->giveStatus(gp) );
467 
468  charLenModes.resize(6);
469  charLenModes.at(1) = st->elemCharLength.at(1);
470  charLenModes.at(2) = st->elemCharLength.at(2);
471  charLenModes.at(3) = st->elemCharLength.at(3);
472  charLenModes.at(4) = ( st->elemCharLength.at(2) + st->elemCharLength.at(3) ) / 2.; //average two directions
473  charLenModes.at(5) = ( st->elemCharLength.at(3) + st->elemCharLength.at(1) ) / 2.; //average two directions
474  charLenModes.at(6) = ( st->elemCharLength.at(1) + st->elemCharLength.at(2) ) / 2.; //average two directions
475 }
476 
477 //check that elemnt is small enough to prevent snap-back
479 {
480  CompoDamageMatStatus *st = static_cast< CompoDamageMatStatus * >( this->giveStatus(gp) );
481  FloatArray charLenModes(6);
482  FloatArray *inputFGf;
483  double l_ch, ft, Gf, elem_h, modulus = -1.0;
484 
485  for ( int j = 0; j <= 1; j++ ) {
486  if ( j == 0 ) {
487  inputFGf = & inputTension;
488  } else {
489  inputFGf = & inputCompression;
490  }
491 
492  switch ( mMode ) {
493  case _3dMat:
494  this->giveCharLengthForModes(charLenModes, gp);
495  for ( int i = 1; i <= 6; i++ ) {
496  ft = fabs( ( * inputFGf ).at(2 * i - 1) );
497  Gf = ( * inputFGf ).at(2 * i);
498  switch ( i ) {
499  case 1:
500  modulus = this->give(Ex, NULL);
501  break;
502  case 2:
503  modulus = this->give(Ey, NULL);
504  break;
505  case 3:
506  modulus = this->give(Ez, NULL);
507  break;
508  case 4:
509  modulus = this->give(Gyz, NULL);
510  break;
511  case 5:
512  modulus = this->give(Gxz, NULL);
513  break;
514  case 6:
515  modulus = this->give(Gxy, NULL);
516  break;
517  }
518 
519  l_ch = modulus * Gf / ft / ft;
520  elem_h = charLenModes.at(i);
521  if ( elem_h > 2 * l_ch ) {
522  if ( this->allowSnapBack.contains(i + 6 * j) ) {
523  OOFEM_LOG_INFO("Allowed snapback of 3D element %d GP %d Gf(%d)=%f, would need Gf>%f\n", gp->giveElement()->giveNumber(), gp->giveNumber(), j == 0 ? i : -i, Gf, ft * ft * elem_h / 2 / modulus);
524  } else {
525  OOFEM_ERROR("Decrease size of 3D element %d or increase Gf(%d)=%f to Gf>%f, possible snap-back problems", gp->giveElement()->giveNumber(), j == 0 ? i : -i, Gf, ft * ft * elem_h / 2 / modulus);
526  }
527  }
528  }
529 
530  break;
531  case _1dMat:
532  ft = fabs( ( * inputFGf ).at(1) );
533  Gf = ( * inputFGf ).at(2);
534  modulus = this->give(Ex, NULL);
535  l_ch = modulus * Gf / ft / ft;
536  elem_h = st->elemCharLength.at(1);
537  if ( elem_h > 2 * l_ch ) {
539  if ( this->allowSnapBack.contains(1 + 6 * j) ) {
540  OOFEM_LOG_INFO("Allowed snapback of 1D element %d GP %d Gf(%d)=%f, would need Gf>%f\n", gp->giveElement()->giveNumber(), gp->giveNumber(), j == 0 ? 1 : -1, Gf, ft * ft * elem_h / 2 / modulus);
541  } else {
542  OOFEM_ERROR("Decrease size of 1D element %d or increase Gf(%d)=%f to Gf>%f, possible snap-back problems", gp->giveElement()->giveNumber(), j == 0 ? 1 : -1, Gf, ft * ft * elem_h / 2 / modulus);
543  }
544  }
545 
546  break;
547  default:
548  OOFEM_ERROR("Material mode %s not supported", __MaterialModeToString(mMode) );
549  }
550  }
551 }
552 
553 // constructor
555 {
556  //largest strain ever reached [6 tension, 6 compression]
557  this->kappa.resize(12);
558  this->kappa.zero();
559  this->tempKappa.resize(12);
560  this->tempKappa.zero();
561 
562  //array of damage parameters [6] for both tension and compression
563  this->omega.resize(6);
564  this->omega.zero();
565  this->tempOmega.resize(6);
566  this->tempOmega.zero();
567  this->hasSnapBack.resize(6);
568  this->hasSnapBack.zero();
569 
570  this->initDamageStress.resize(12);
571  this->initDamageStress.zero();
572  this->maxStrainAtZeroStress.resize(12);
573  this->maxStrainAtZeroStress.zero();
574  this->strainAtMaxStress.resize(12);
575  this->strainAtMaxStress.zero();
576 
577  this->tempStressMLCS.resize(6);
578  this->tempStressMLCS.zero();
579 
580  this->elemCharLength.resize(3);
581  this->elemCharLength.zero();
582 
583  this->Iteration = 0;
584 }
585 
586 // destructor
588 { }
589 
590 
592 {
593  int maxComponents = 0;
595  fprintf(file, "status {");
596  switch ( gp->giveMaterialMode() ) {
597  case _3dMat: {
598  maxComponents = 6;
599  break;
600  }
601  case _1dMat: {
602  maxComponents = 1;
603  break;
604  }
605  default:
606  OOFEM_ERROR("Material mode not supported");
607  }
608 
609  if ( !this->omega.containsOnlyZeroes() ) {
610  fprintf(file, " omega ");
611  for ( int i = 1; i <= maxComponents; i++ ) {
612  fprintf( file, "%.4f ", this->omega.at(i) );
613  }
614  }
615 
616  fprintf(file, " Local_stress ");
617  for ( int i = 1; i <= maxComponents; i++ ) {
618  fprintf( file, "%.2e ", this->tempStressMLCS.at(i) );
619  }
620 
621  fprintf(file, " kappa "); //print pairs tension-compression
622  for ( int i = 1; i <= maxComponents; i++ ) {
623  for ( int j = 0; j < 2; j++ ) {
624  fprintf( file, "%.2e ", this->kappa.at(6 * j + i) );
625  }
626  }
628  fprintf( file, " Cross section num %d", gp->giveElement()->giveCrossSection()->giveNumber() );
629 
630  fprintf(file, "}\n");
631 }
632 
633 
634 //initializes temp variables according to variables form previous equilibrium state, resets tempStressVector, tempStrainVector
635 //function called at the beginning of each time increment (not iteration)
637 { }
638 
639 // updates variables (nonTemp variables describing situation at previous equilibrium state)
640 // after a new equilibrium state has been reached
641 // temporary variables are having values corresponding to newly reached equilibrium
643 {
644  //here stressVector = tempStressVector; strainVector = tempStrainVector;
645  StructuralMaterialStatus :: updateYourself(tStep); //MaterialStatus::updateYourself, i.e. stressVector = tempStressVector; strainVector = tempStrainVector;
646  this->kappa = this->tempKappa;
647  this->omega = this->tempOmega;
648  this->Iteration = 0;
649 }
650 
651 
653 {
654  contextIOResultType iores;
655  // save parent class status
656  if ( ( iores = StructuralMaterialStatus :: saveContext(stream, mode, obj) ) != CIO_OK ) {
657  THROW_CIOERR(iores);
658  }
659 
660  return CIO_OK;
661 }
662 
664  contextIOResultType iores;
665  // read parent class status
666  if ( ( iores = StructuralMaterialStatus :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
667  THROW_CIOERR(iores);
668  }
669 
670  return CIO_OK;
671 }
672 } // end namespace oofem
bool contains(int value) const
Definition: intarray.h:283
CrossSection * giveCrossSection()
Definition: element.C:495
FloatArray inputTension
Six stress components of tension components read from the input file.
IntArray hasSnapBack
Checks whether snapback occurred at IP.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: structuralms.C:96
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
FloatArray maxStrainAtZeroStress
Maximum strain when stress becomes zero due to complete damage (omega = 1) at IP. Determined from fra...
#define NYzx
Definition: matconst.h:54
#define _IFT_CompoDamageMat_compres_f0_gf
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
CompoDamageMatStatus(int n, Domain *d, GaussPoint *g)
Constructor.
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
Definition: structuralms.h:137
FloatArray omega
Highest damage ever reached in all previous equilibrated steps at IP [6 for tension and compression]...
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
GaussPoint * gp
Associated integration point.
Class and object Domain.
Definition: domain.h:115
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
#define Ey
Definition: matconst.h:60
#define Gxz
Definition: matconst.h:71
#define Gxy
Definition: matconst.h:72
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
virtual ~CompoDamageMat()
Destructor.
FloatArray tempKappa
Highest strain ever reached at IP. Can be unequilibrated from last iterations [6 tension, 6 compression].
void zero()
Sets all component to zero.
Definition: intarray.C:52
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
int max(int i, int j)
Returns bigger value form two given decimals.
Definition: mathfem.h:71
This class implements a structural material status information.
Definition: structuralms.h:65
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
#define Ex
Definition: matconst.h:59
Dictionary propertyDictionary
Property dictionary.
Definition: material.h:105
Abstract base class for all finite elements.
Definition: element.h:145
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...
void checkSnapBack(GaussPoint *gp, MaterialMode mMode)
Check that element is small enough or Gf is large enough to prevent the snap-back.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void giveStressDependentPartOfStrainVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode)
Method for subtracting from reduced space strain vector its stress-independent parts (caused by tempe...
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Definition: structuralms.C:73
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
MatResponseMode
Describes the character of characteristic material matrix.
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
IntArray allowSnapBack
Stress components which are allowed for snap back [6 tension, 6 compression].
#define _IFT_CompoDamageMat_allowSnapBack
const char * __MaterialModeToString(MaterialMode _value)
Definition: cltypes.C:314
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property &#39;aProperty&#39;.
Definition: material.C:52
Abstract base class for all "structural" finite elements.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj)
Stores receiver state to output stream.
Class for maintaining Gauss point values for CompoDamageMat model.
#define OOFEM_LOG_INFO(...)
Definition: logger.h:127
int giveMatStiffRotationMatrix(FloatMatrix &answer, GaussPoint *gp)
Returns [6x6] rotation matrix in the global coordinate system.
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
virtual void giveRealStressVector(FloatArray &answer, GaussPoint *gp, const FloatArray &, TimeStep *tStep)
Computes the real stress vector for given total strain and integration point.
#define NYzy
Definition: matconst.h:55
#define OOFEM_ERROR(...)
Definition: error.h:61
int afterIter
Optional parameter determining after how many iterations within the time step the damage is calculate...
FloatArray strainAtMaxStress
Strain when damage is initiated at IP. In literature denoted eps_0 [6 tension, 6 compression].
int giveNumber()
Returns number of receiver.
Definition: gausspoint.h:184
#define Gyz
Definition: matconst.h:70
#define _IFT_CompoDamageMat_nuyz
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_CompoDamageMat_tension_f0_gf
#define _IFT_CompoDamageMat_Gxy
CompoDamageMat(int n, Domain *d)
Constructor.
#define Ez
Definition: matconst.h:61
FloatArray elemCharLength
Characteristic element length at IP in three perpendicular planes aligned with material orientation...
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
void resize(int n)
Checks size of receiver towards requested bounds.
Definition: intarray.C:124
FloatArray initDamageStress
Stress at which damage starts. For uniaxial loading is equal to given maximum stress in the input...
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: structuralms.C:157
virtual ~CompoDamageMatStatus()
Destructor.
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
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
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
static void transformStrainVectorTo(FloatArray &answer, const FloatMatrix &base, const FloatArray &strainVector, bool transpose=false)
Transforms 3d strain vector into another coordinate system.
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
Definition: structuralms.h:135
const FloatArray & giveStressVector() const
Returns the const pointer to receiver&#39;s stress vector.
Definition: structuralms.h:107
FloatArray kappa
Highest strain ever reached in all previous equilibrated steps [6 tension, 6 compression].
FloatArray tempStressMLCS
Only for printing purposes in CompoDamageMatStatus.
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
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual double giveCharacteristicLength(const FloatArray &normalToCrackPlane)
Returns the size of element in the given direction, in some cases adjusted (e.g.
Definition: element.h:874
void giveUnrotated3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp)
Returns 3D material stiffness matrix [6x6] in unrotated form.
#define _IFT_CompoDamageMat_nuxynuxz
Class representing the a dynamic Input Record.
#define _IFT_CompoDamageMat_afteriter
void giveCharLength(CompoDamageMatStatus *status, GaussPoint *gp, FloatMatrix &elementCs)
Fills array elemCharLength with characteristic length related to three perpendicular planes...
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
Abstract base class for all "structural" constitutive models.
FloatArray tempOmega
Highest damage ever reached at IP. Can be unequilibrated from last iterations [6 for tension and comp...
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
int min(int i, int j)
Returns smaller value from two given decimals.
Definition: mathfem.h:59
void beUnitMatrix()
Sets receiver to unity matrix.
Definition: floatmatrix.C:1332
#define NYyx
Definition: matconst.h:56
#define NYyz
Definition: matconst.h:52
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
void giveCharLengthForModes(FloatArray &charLenModes, GaussPoint *gp)
Computes characteristic length for fixed planes of material orientation.
REGISTER_Material(DummyMaterial)
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj)
Restores the receiver state previously written in stream.
bool containsOnlyZeroes() const
Returns nonzero if all coefficients of the receiver are 0, else returns zero.
Definition: floatarray.C:646
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: structuralms.C:133
the oofem namespace is to define a context or scope in which all oofem names are defined.
#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
const FloatArray & giveStrainVector() const
Returns the const pointer to receiver&#39;s strain vector.
Definition: structuralms.h:105
void symmetrized()
Initializes the lower half of the receiver according to the upper half.
Definition: floatmatrix.C:1576
FloatArray inputCompression
Six stress components of compression components read from the input file.
static void transformStressVectorTo(FloatArray &answer, const FloatMatrix &base, const FloatArray &stressVector, bool transpose=false)
Transforms 3d stress vector into another coordinate system.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: material.C:89
#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
Class representing solution step.
Definition: timestep.h:80
#define _IFT_CompoDamageMat_exx
#define NYxz
Definition: matconst.h:51
#define _IFT_CompoDamageMat_eyyezz
int Iteration
Iteration in the time step.
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.

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:27 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011