OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
dustmat.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 "dustmat.h"
36 
37 #include "floatarray.h"
38 #include "floatmatrix.h"
39 #include "../sm/Materials/structuralms.h"
40 #include "gausspoint.h"
41 #include "intarray.h"
42 #include "../sm/Materials/structuralmaterial.h"
44 #include "datastream.h"
45 #include "contextioerr.h"
46 #include "mathfem.h"
47 #include "classfactory.h"
48 
49 namespace oofem {
50 REGISTER_Material(DustMaterial);
51 
53  StructuralMaterialStatus(n, d, gp),
54  plasticStrain( 6 ),
55  tempPlasticStrain( 6 )
56 {
61  q = q0;
62 }
63 
65 { }
66 
67 void
69 {
70  // Call the function of the parent class to initialize the variables defined there.
73  tempQ = q;
75 }
76 
77 void
79 {
80  // Call the corresponding function of the parent class to update variables defined there.
83  q = tempQ;
85 }
86 
87 void
89 {
90  // Call the corresponding function of the parent class to print variables defined there.
92 
93  fprintf(file, "\tstatus { ");
94 
95  // print status flag
96  switch ( stateFlag ) {
98  fprintf(file, " Elastic");
99  break;
101  fprintf(file, " Yielding1");
102  break;
104  fprintf(file, " Yielding2");
105  break;
107  fprintf(file, " Yielding3");
108  break;
110  fprintf(file, " Unloading");
111  break;
112  }
113 
114  fprintf(file, ", plasticStrains ");
115  for ( auto &val : this->givePlasticStrain() ) {
116  fprintf( file, " %.4e", val );
117  }
118 
119  fprintf(file, ", q %.4e", q);
120 
121  fprintf(file, "}\n");
122 }
123 
126 {
127  contextIOResultType iores;
128 
129  // save parent class status
130  if ( ( iores = StructuralMaterialStatus :: saveContext(stream, mode, obj) ) != CIO_OK ) {
131  THROW_CIOERR(iores);
132  }
133 
134  return CIO_OK;
135 }
136 
137 
140 {
141  contextIOResultType iores;
142 
143  // read parent class status
144  if ( ( iores = StructuralMaterialStatus :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
145  THROW_CIOERR(iores);
146  }
147 
148  return CIO_OK;
149 }
150 
151 
152 
153 // *************************************************************
154 // *** CLASS DUST MATERIAL ***
155 // *************************************************************
156 
157 
159 {
161 }
162 
164 {
165  delete LEMaterial;
166 }
167 
170 {
171  // Required by IR_GIVE_FIELD macro
172  IRResultType result;
173  // call the corresponding service of structural material
175  if ( result != IRRT_OK ) return result;
176 
177  // call the corresponding service for the linear elastic material
178  result = this->LEMaterial->initializeFrom(ir);
179  if ( result != IRRT_OK ) return result;
180 
181  // instanciate the variables defined in DustMaterial
182  ft = 3e6;
183  x0 = 150e6;
184  rEll = .5;
185  beta = .008e-6;
186  theta = .32;
187  alpha = 44e6;
188  lambda = 34e6;
189  wHard = .1;
190  dHard = .0003e-6;
191  mStiff = 0.;
192  newtonTol = 1e-8;
193  newtonIter = 200;
194 
207 
208  // check parameters admissibility
209  if ( ft < 0 ) {
210  OOFEM_WARNING("parameter 'ft' must be positive");
211  return IRRT_BAD_FORMAT;
212  }
213 
214  if ( x0 < 0 ) {
215  OOFEM_WARNING("parameter 'x0' must be positive");
216  return IRRT_BAD_FORMAT;
217  }
218 
219  if ( rEll < 0 ) {
220  OOFEM_WARNING("parameter 'rEll' must be positive");
221  return IRRT_BAD_FORMAT;
222  }
223 
224  if ( theta < 0 ) {
225  OOFEM_WARNING("parameter 'theta' must be positive");
226  return IRRT_BAD_FORMAT;
227  }
228 
229  if ( beta < 0 ) {
230  OOFEM_WARNING("parameter 'beta' must be positive");
231  return IRRT_BAD_FORMAT;
232  }
233 
234  if ( lambda < 0 ) {
235  OOFEM_WARNING("parameter 'lambda' must be positive");
236  return IRRT_BAD_FORMAT;
237  }
238 
239  if ( alpha < lambda ) {
240  OOFEM_WARNING("parameter 'alpha' must be greater than parameter 'lambda'");
241  return IRRT_BAD_FORMAT;
242  }
243 
244  x0 = -x0; // compressive strength is negative, although on input it is a positive number
245 
246  hardeningType = 0;
248 
249  q0 = x0;
250  solveQ0(q0);
251 
252  return IRRT_OK;
253 }
254 
255 void
257  GaussPoint *gp,
258  const FloatArray &totalStrain,
259  TimeStep *tStep)
260 {
261  FloatArray strainVectorR;
262 
263  DustMaterialStatus *status = static_cast< DustMaterialStatus * >( this->giveStatus(gp) );
264 
265  // Initialize temp variables for this Gauss point
266  this->initTempStatus(gp);
267 
268  // subtract stress-independent part of strain
269  this->giveStressDependentPartOfStrainVector_3d(strainVectorR, gp, totalStrain, tStep, VM_Total);
270 
271  // perform the local stress return and update the history variables
272  performStressReturn(gp, strainVectorR);
273 
274  // copy total strain vector to the temp status
275  status->letTempStrainVectorBe(totalStrain);
276 
277  // pass the correct form of stressVector to giveRealStressVector
278  answer = status->giveTempStressVector();
279 }
280 
281 void
283 {
284  DustMaterialStatus *status = static_cast< DustMaterialStatus * >( giveStatus(gp) );
285 
286  // compute total strain components
287  FloatArray strainDeviator;
288  double volumetricStrain;
289  volumetricStrain = computeDeviatoricVolumetricSplit(strainDeviator, strain);
290 
291  // compute trial elastic strains
292  FloatArray plasticStrain = status->givePlasticStrain();
293  double volumetricPlasticStrain;
294  FloatArray plasticStrainDeviator;
295  volumetricPlasticStrain = computeDeviatoricVolumetricSplit(plasticStrainDeviator, plasticStrain);
296  double volumetricElasticStrain = volumetricStrain - volumetricPlasticStrain;
297  FloatArray elasticStrainDeviator = strainDeviator;
298  elasticStrainDeviator.subtract(plasticStrainDeviator);
299 
300  // compute trial stresses
301  double bulkModulus, shearModulus;
302  computeAndSetBulkAndShearModuli(bulkModulus, shearModulus, gp);
303  double volumetricStress = 3. * bulkModulus * volumetricElasticStrain;
304  FloatArray stressDeviator = {2 * elasticStrainDeviator[0], 2 * elasticStrainDeviator[1], 2 * elasticStrainDeviator[2],
305  elasticStrainDeviator[3], elasticStrainDeviator[4], elasticStrainDeviator[5]};
306  stressDeviator.times(shearModulus);
307 
308  // norm of trial stress deviator
309  double rho = computeSecondCoordinate(stressDeviator);
310  double i1 = 3 * volumetricStress;
311  double f1, f2, f3, q, tempQ;
312  q = tempQ = status->giveQ();
313  f1 = yieldFunction1(rho, i1);
314  f2 = yieldFunction2(rho, i1, q);
315  f3 = yieldFunction3(i1);
316 
317  // actual stress return
318  double lambda = 0.;
319  FloatArray m(6);
320  double feft = functionFe(ft);
321  double auxModulus = 2 * shearModulus / ( 9 * bulkModulus );
322  double temp = feft - auxModulus * ( i1 - ft ) / functionFeDI1(ft);
323 
324  if ( f1 > 0 && i1 >= q && rho >= temp ) { // yield function 1
326  performF1return(i1, rho, gp);
327  tempQ = status->giveTempQ();
328  lambda = ( rho - functionFe( functionI1(q, tempQ, i1, bulkModulus) ) ) / ( 2 * shearModulus );
329  computePlastStrainDirM1(m, stressDeviator, rho, i1, q);
330  } else if ( f2 > 0 && i1 < q ) { // yield function 2
332  performF2return(i1, rho, gp);
333  tempQ = status->giveTempQ();
334  lambda = computeDeltaGamma2(tempQ, q, i1, bulkModulus);
335  computePlastStrainDirM2(m, stressDeviator, rho, i1, tempQ);
336  } else if ( f3 > 0 && rho < temp ) { // yield function 3
338  double fFeFt = functionFe(ft);
339  double fFeDqFt = functionFeDI1(ft);
340  double b = fFeFt - 2 * shearModulus / ( 9 * bulkModulus ) * ( i1 - ft ) - ( 1 + fFeDqFt ) * rho;
341  double c = -fFeFt / ( 9 * bulkModulus ) * ( i1 - ft );
342  lambda = 1 / ( 4 * shearModulus ) * ( -b + sqrt(b * b - 8 * shearModulus * c) );
343  double deltaVolumetricPlasticStrain = 3 * ( 1 - ( 1 + fFeDqFt ) * rho / fFeFt ) * lambda;
344  if ( volumetricPlasticStrain + deltaVolumetricPlasticStrain < -.5 * wHard ) {
345  deltaVolumetricPlasticStrain = -.5 * wHard - volumetricPlasticStrain;
346  }
347 
348  if ( q <= 0.0 ) {
349  computeQFromPlastVolEps(tempQ, q, deltaVolumetricPlasticStrain);
350  }
351 
352  status->letTempQBe(tempQ);
353  computePlastStrainDirM3(m, stressDeviator, rho, i1, tempQ);
354  } else { // elastic case
355  int stateFlag = status->giveStateFlag();
356  if ( ( stateFlag == DustMaterialStatus :: DM_Unloading ) || ( stateFlag == DustMaterialStatus :: DM_Elastic ) ) {
358  } else {
360  }
361  }
362 
363  if ( lambda < 0 ) {
364  OOFEM_ERROR("TODO");
365  }
366 
367  // compute correct stress
368  m.times(lambda);
369  plasticStrain.add(m);
370  double mVol;
371  FloatArray mDeviator;
372  mVol = computeDeviatoricVolumetricSplit(mDeviator, m);
373  i1 -= 3 * bulkModulus * mVol;
374  volumetricStress = i1 / 3.;
375  mDeviator.times(-2 * shearModulus);
376  stressDeviator.add(mDeviator);
377 
378  // compute full stresses from deviatoric and volumetric part and store them
379  FloatArray stress = stressDeviator;
380  stress.at(1) += volumetricStress;
381  stress.at(2) += volumetricStress;
382  stress.at(3) += volumetricStress;
383  status->letTempStressVectorBe(stress);
384 
385  // compute and update plastic strain and q
386  status->letTempPlasticStrainBe(plasticStrain);
387 }
388 
389 void
390 DustMaterial :: performF1return(double i1, double rho, GaussPoint *gp)
391 {
392  DustMaterialStatus *status = static_cast< DustMaterialStatus * >( giveStatus(gp) );
393  double bulkModulus = status->giveBulkModulus();
394  double shearModulus = status->giveShearModulus();
395  double q = status->giveQ();
396  double tempQ = status->giveTempQ();
397  double fx, dfx;
398  double m = 9 * bulkModulus / ( 2 * shearModulus );
399  double vfI1, vfI1DQ, a, b, c, d, da, db, dc;
400  int positiveFlag = 0;
401 
402  for ( int i = 0; i < newtonIter; i++ ) {
403  vfI1 = functionI1(q, tempQ, i1, bulkModulus);
404  vfI1DQ = functionI1DQ(tempQ, bulkModulus);
405  a = ( vfI1 - tempQ ) / ( ft - tempQ );
406  b = functionFeDI1(vfI1);
407  c = rho - functionFe(vfI1);
408  da = ( ( vfI1DQ - 1 ) * ( ft - tempQ ) + ( vfI1 - tempQ ) ) / ( ( ft - tempQ ) * ( ft - tempQ ) );
409  db = functionFeDI1DI1(vfI1) * vfI1DQ;
410  dc = -functionFeDI1(vfI1) * vfI1DQ;
411  d = da * b * c + a * db * c + a * b * dc;
412  fx = -3 *bulkModulus *functionH(q, tempQ) - m * a * b * c;
413  dfx = -3 *bulkModulus *functionHDQ(tempQ) - m * d;
414  tempQ -= fx / dfx;
415  if ( tempQ >= 0 ) {
416  if ( positiveFlag >= 1 ) {
417  status->letTempQBe(0.0);
418  return;
419  }
420 
421  tempQ = 0;
422  positiveFlag += 1;
423  }
424 
425  if ( fabs(fx / dfx / tempQ) < newtonTol ) {
426  status->letTempQBe(tempQ);
427  return;
428  }
429  }
430 
431  OOFEM_LOG_DEBUG(" i1 %e rho %e bulkM %e shearM %e\n", i1, rho, bulkModulus, shearModulus);
432  OOFEM_ERROR("Newton's method did not converge");
433 }
434 
435 void
436 DustMaterial :: performF2return(double i1, double rho, GaussPoint *gp)
437 {
438  DustMaterialStatus *status = static_cast< DustMaterialStatus * >( giveStatus(gp) );
439  double bulkModulus = status->giveBulkModulus();
440  double shearModulus = status->giveShearModulus();
441  double q = status->giveQ();
442  double qRight = q;
443  double qLeft = q;
444  double tempQ = .5 * ( qLeft + qRight );
445  double fq;
446  double fx, dfx;
447  for ( int i = 0; i < newtonIter; i++ ) {
448  fx = i1 - 3 *bulkModulus *functionH(q, qLeft) - qLeft;
449  dfx = -3 *bulkModulus *functionHDQ(qLeft) - 1;
450  qLeft -= fx / dfx;
451  if ( fabs(fx / dfx / q0) < newtonTol ) {
452  break;
453  }
454  }
455 
456  for ( int i = 0; i < newtonIter; i++ ) {
457  fq = fTempR2(tempQ, q, i1, rho, bulkModulus, shearModulus);
458  if ( fabs( ( qRight - qLeft ) / qRight ) < newtonTol ) {
459  status->letTempQBe(tempQ);
460  return;
461  }
462 
463  if ( fq > 0 ) {
464  qRight = tempQ;
465  } else {
466  qLeft = tempQ;
467  }
468 
469  tempQ = .5 * ( qLeft + qRight );
470  }
471 
472  OOFEM_ERROR("bisection method did not converge");
473 }
474 
475 void
476 DustMaterial :: computeQFromPlastVolEps(double &answer, double q, double deltaVolumetricPlasticStrain)
477 {
478  if ( q >= 0. ) {
479  answer = 0.;
480  return;
481  }
482 
483  double fx, dfx;
484  for ( int i = 0; i <= newtonIter; i++ ) {
485  fx = functionH(q, answer) - deltaVolumetricPlasticStrain;
486  dfx = functionHDQ(answer);
487  answer -= fx / dfx;
488  if ( fabs(fx / dfx / answer) < newtonTol ) {
489  if ( answer > 0 ) {
490  answer = 0.;
491  }
492 
493  return;
494  }
495  }
496 
497  OOFEM_LOG_DEBUG(" dVolEpsPl: %e\n", deltaVolumetricPlasticStrain);
498  OOFEM_ERROR("Newton's method did not converge");
499 }
500 
501 void
503  MatResponseMode mode,
504  GaussPoint *gp,
505  TimeStep *tStep)
506 {
507  DustMaterialStatus *status = static_cast< DustMaterialStatus * >( giveStatus(gp) );
508  double ym0 = LEMaterial->giveYoungsModulus();
509  double ym = status->giveYoungsModulus();
510  double coeff = status->giveVolumetricPlasticStrain() < 0 ? ym / ym0 : 1.0;
511  if ( mode == ElasticStiffness ) {
512  LEMaterial->give3dMaterialStiffnessMatrix(answer, mode, gp, tStep);
513  } else if ( mode == SecantStiffness || mode == TangentStiffness ) {
514  LEMaterial->give3dMaterialStiffnessMatrix(answer, mode, gp, tStep);
515  answer.times(coeff);
516  } else {
517  OOFEM_ERROR("Unsupported MatResponseMode");
518  }
519 }
520 
521 int
523 {
524  DustMaterialStatus *status = static_cast< DustMaterialStatus * >( giveStatus(gp) );
525  if ( type == IST_PlasticStrainTensor ) {
526  status->letPlasticStrainBe(value);
527  return 1;
528  } else if ( type == IST_StressCapPos ) {
529  status->letQBe( value.at(1) );
530  return 1;
531  } else {
532  return StructuralMaterial :: setIPValue(value, gp, type);
533  }
534 }
535 
536 int
538  GaussPoint *gp,
539  InternalStateType type,
540  TimeStep *tStep)
541 {
542  const DustMaterialStatus *status = static_cast< DustMaterialStatus * >( giveStatus(gp) );
543  if ( type == IST_PlasticStrainTensor ) {
544  answer = status->givePlasticStrain();
545  return 1;
546  } else if ( type == IST_PrincipalPlasticStrainTensor ) {
548  return 1;
549  } else if ( type == IST_VolumetricPlasticStrain ) {
550  answer.resize(1);
551  answer.at(1) = status->giveVolumetricPlasticStrain();
552  return 1;
553  } else if ( type == IST_StressCapPos ) {
554  answer.resize(1);
555  answer.at(1) = status->giveQ();
556  return 1;
557  } else {
558  return StructuralMaterial :: giveIPValue(answer, gp, type, tStep);
559  }
560 
561  return 0;
562 }
563 
566 {
567  return new DustMaterialStatus( 1, StructuralMaterial :: giveDomain(), gp, this->giveQ0() );
568 }
569 
570 double
572 {
573  return alpha - lambda *exp(beta *i1) - theta * i1;
574 }
575 
576 double
578 {
579  return -lambda *beta *exp(beta *i1) - theta;
580 }
581 
582 double
584 {
585  return -lambda *beta *beta *exp(beta *i1);
586 }
587 
588 double
589 DustMaterial :: functionFc(double rho, double i1, double q)
590 {
591  return sqrt( rho * rho + 1 / rEll / rEll * ( q - i1 ) * ( q - i1 ) );
592 }
593 
594 double
595 DustMaterial :: yieldFunction1(double rho, double i1)
596 {
597  return rho - functionFe(i1);
598 }
599 
600 double
601 DustMaterial :: yieldFunction2(double rho, double i1, double q)
602 {
603  return functionFc(rho, i1, q) - functionFe(q);
604 }
605 
606 double
608 {
609  return i1 - ft;
610 }
611 
612 double
614 {
615  return q - rEll * ( alpha - lambda * exp(beta * q) - theta * q );
616 }
617 
618 double
620 {
621  return 1 - rEll * ( -lambda * beta * exp(beta * q) - theta );
622 }
623 
624 void
625 DustMaterial :: solveQ0(double &answer)
626 {
627  double fx, dfx;
628  for ( int i = 0; i < newtonIter; i++ ) {
629  fx = -x0 + answer - rEll * ( alpha - lambda * exp(beta * answer) - theta * answer );
630  dfx = 1 - rEll * ( -beta * lambda * exp(beta * answer) - theta );
631  answer -= fx / dfx;
632  if ( fabs(fx / dfx / answer) < newtonTol ) {
633  if ( answer >= 0 ) {
634  OOFEM_ERROR("internal parameter q has to be negative");
635  }
636 
637  return;
638  }
639  }
640 
641  OOFEM_ERROR("Newton's method did not converge");
642 }
643 
644 void
645 DustMaterial :: computeAndSetBulkAndShearModuli(double &bulkModulus, double &shearModulus, GaussPoint *gp)
646 {
647  DustMaterialStatus *status = static_cast< DustMaterialStatus * >( giveStatus(gp) );
648  double ym = LEMaterial->giveYoungsModulus();
649  double nu = LEMaterial->givePoissonsRatio();
650  double volumetricPlasticStrain = status->giveVolumetricPlasticStrain();
651  if ( volumetricPlasticStrain < 0. ) {
652  ym -= mStiff * volumetricPlasticStrain;
653  }
654 
657  status->setBulkModulus(bulkModulus);
658  status->setShearModulus(shearModulus);
659  status->setYoungsModulus(ym);
660 }
661 
662 void
663 DustMaterial :: computePlastStrainDirM1(FloatArray &answer, const FloatArray &stressDeviator, double rho, double i1, double q)
664 {
665  answer.beScaled(1./rho, stressDeviator);
666 
667  double temp = ( lambda * beta * exp(beta * i1) + theta ) * ( i1 - q ) / ( ft - q );
668  answer.at(1) += temp;
669  answer.at(2) += temp;
670  answer.at(3) += temp;
671 }
672 
673 void
674 DustMaterial :: computePlastStrainDirM2(FloatArray &answer, const FloatArray &stressDeviator, double rho, double i1, double q)
675 {
676  double fc = functionFc(rho, i1, q);
677  answer.beScaled(1./fc, stressDeviator);
678 
679  double temp = ( q - i1 ) / ( rEll * rEll * fc );
680  answer.at(1) -= temp;
681  answer.at(2) -= temp;
682  answer.at(3) -= temp;
683 }
684 
685 void
686 DustMaterial :: computePlastStrainDirM3(FloatArray &answer, const FloatArray &stressDeviator, double rho, double i1, double q)
687 {
688  double feft = functionFe(ft);
689  answer.beScaled(1./feft, stressDeviator);
690 
691  double dfeft = functionFeDI1(ft);
692  double temp = 1 - ( 1 + dfeft ) * rho / feft;
693  answer.at(1) += temp;
694  answer.at(2) += temp;
695  answer.at(3) += temp;
696 }
697 
698 double
699 DustMaterial :: functionH(double q, double tempQ)
700 {
701  double xq = functionX(q);
702  double xtq = functionX(tempQ);
703  switch ( hardeningType ) {
704  case 1:
705  return wHard * ( exp(dHard * xtq) - exp(dHard * xq) );
706 
707  default: // 0
708  return dHard * wHard * ( xtq / ( 1 - dHard * xtq ) - xq / ( 1 - dHard * xq ) );
709  }
710 }
711 
712 double
714 {
715  double xtq = functionX(tempQ);
716  double dxtq = functionXDQ(tempQ);
717  switch ( hardeningType ) {
718  case 1:
719  return wHard *dHard *exp(dHard *xtq) * dHard * dxtq;
720 
721  default: // 0
722  return dHard * wHard * ( dxtq * ( 1 - dHard * xtq ) - xtq * ( -dHard * dxtq ) ) / ( 1 - dHard * xtq ) / ( 1 - dHard * xtq );
723  }
724 }
725 
726 double
727 DustMaterial :: functionI1(double q, double tempQ, double i1, double bulkModulus)
728 {
729  return i1 - 3 *bulkModulus *functionH(q, tempQ);
730 }
731 
732 double
733 DustMaterial :: functionI1DQ(double tempQ, double bulkModulus)
734 {
735  return -3 *bulkModulus *functionHDQ(tempQ);
736 }
737 
738 double
739 DustMaterial :: computeDeltaGamma2(double tempQ, double q, double i1, double bulkModulus)
740 {
741  double vfH = functionH(q, tempQ);
742  return rEll *rEll *functionFe(tempQ) * vfH / ( 3 * ( i1 - 3 * bulkModulus * vfH - tempQ ) );
743 }
744 
745 double
746 DustMaterial :: computeDeltaGamma2DQ(double tempQ, double q, double i1, double bulkModulus)
747 {
748  double vfH = functionH(q, tempQ);
749  double vdfH = functionHDQ(tempQ);
750  double vfEq = functionFe(tempQ);
751  double vdfEq = functionFeDI1(tempQ);
752  double frac1 = rEll * rEll * vfEq * vfH;
753  double dfrac1 = rEll * rEll * ( vdfEq * vfH + vfEq * vdfH );
754  double frac2 = 3 * ( i1 - 3 * bulkModulus * vfH - tempQ );
755  double dfrac2 = 3 * ( -3 * bulkModulus * vdfH - 1 );
756  return ( dfrac1 * frac2 - frac1 * dfrac2 ) / frac2 / frac2;
757 }
758 
759 double
760 DustMaterial :: fTempR2(double tempQ, double q, double i1, double rho, double bulkModulus, double shearModulus)
761 {
762  double vfEq = functionFe(tempQ);
763  double dgq = computeDeltaGamma2(tempQ, q, i1, bulkModulus);
764  double frac = ( vfEq + 2 * shearModulus * dgq );
765  double a = rho * vfEq / frac;
766  frac = ( rEll * rEll * vfEq + 9 * bulkModulus * dgq );
767  double b = ( tempQ - i1 ) * rEll * vfEq / frac;
768  return a * a + b * b - vfEq * vfEq;
769 }
770 } // end namespace oofem
double functionFe(double i1)
Auxiliary equation Fe (7.8)
Definition: dustmat.C:571
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.
double newtonTol
Tollerance for iterative methods.
Definition: dustmat.h:264
static void computePrincipalValues(FloatArray &answer, const FloatArray &s, stressStrainPrincMode mode)
Common functions for convenience.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
Definition: floatarray.C:258
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
Definition: structuralms.h:137
void letQBe(double v)
Assign the value of variable q.
Definition: dustmat.h:178
void computePlastStrainDirM1(FloatArray &answer, const FloatArray &stressDeviator, double rho, double i1, double q)
Computes direction of plastic yielding m1, equation 7.17.
Definition: dustmat.C:663
virtual ~DustMaterialStatus()
Destructor.
Definition: dustmat.C:64
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
#define _IFT_DustMaterial_rEll
Definition: dustmat.h:54
Class and object Domain.
Definition: domain.h:115
void letTempStateFlagBe(int v)
Assign the temp value of the state flag.
Definition: dustmat.h:167
#define _IFT_DustMaterial_mStiff
Definition: dustmat.h:53
For computing principal strains from engineering strains.
double giveYoungsModulus()
Get the value of actual Young&#39;s modulus of the status.
Definition: dustmat.h:209
#define _IFT_DustMaterial_theta
Definition: dustmat.h:50
double wHard
Parameter determining hardening law (parameter W in original publication)
Definition: dustmat.h:260
double computeDeltaGamma2DQ(double tempQ, double q, double i1, double bulkModulus)
Computed derivative by tempQ of equation 7.39.
Definition: dustmat.C:746
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: dustmat.C:169
static double computeSecondCoordinate(const FloatArray &s)
FloatArray tempStrainVector
Temporary strain vector in reduced form (to find balanced state)
Definition: structuralms.h:75
double functionI1(double q, double tempQ, double i1, double bulkModulus)
Auxiliary equation I1 (7.32)
Definition: dustmat.C:727
#define _IFT_DustMaterial_newtonTol
Definition: dustmat.h:56
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.
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
double functionFc(double rho, double i1, double q)
Auxiliary equation Fc (7.9)
Definition: dustmat.C:589
DustMaterialStatus(int n, Domain *d, GaussPoint *gp, double q0)
Constructor.
Definition: dustmat.C:52
This class implements a structural material status information.
Definition: structuralms.h:65
void letTempQBe(double v)
Assign the temp value of variable q.
Definition: dustmat.h:162
FloatArray stressVector
Equilibrated stress vector in reduced form.
Definition: structuralms.h:71
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: dustmat.C:125
int hardeningType
Parameter determining hardening type.
Definition: dustmat.h:252
void performF2return(double i1, double rho, GaussPoint *gp)
Performs stress return of case of yield function F2, computes new value of tempQ and sets it to statu...
Definition: dustmat.C:436
#define _IFT_DustMaterial_newtonIter
Definition: dustmat.h:57
void computeAndSetBulkAndShearModuli(double &bulkModulus, double &shearModulus, GaussPoint *gp)
Computes and sets all elastic moduli, with possible stiffening.
Definition: dustmat.C:645
double functionX(double q)
Auxiliary equation X (7.11)
Definition: dustmat.C:613
IsotropicLinearElasticMaterial * LEMaterial
Pointer for linear elastic material.
Definition: dustmat.h:237
double functionHDQ(double tempQ)
Derivative by tempQ of auxiliary equation H (7.33 or 7.34)
Definition: dustmat.C:713
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
Definition: dustmat.C:565
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Definition: structuralms.C:73
#define OOFEM_LOG_DEBUG(...)
Definition: logger.h:128
MatResponseMode
Describes the character of characteristic material matrix.
const FloatArray & givePlasticStrain() const
Get the full plastic strain vector from the material status.
Definition: dustmat.h:120
void letPlasticStrainBe(const FloatArray &v)
Assign the value of plastic strain.
Definition: dustmat.h:173
double functionI1DQ(double tempQ, double bulkModulus)
Derivative by tempQ of auxiliary equation I1 (7.32)
Definition: dustmat.C:733
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
static double computeBulkModulusFromYoungAndPoisson(double young, double nu)
Computes bulk modulus from given Young&#39;s modulus and Poisson&#39;s ratio.
virtual ~DustMaterial()
Destructor.
Definition: dustmat.C:163
void performStressReturn(GaussPoint *gp, const FloatArray &strain)
Perform stress return and update all internal variables.
Definition: dustmat.C:282
void computePlastStrainDirM3(FloatArray &answer, const FloatArray &stressDeviator, double rho, double i1, double q)
Computes direction of plastic yielding m2, equation 7.18.
Definition: dustmat.C:686
double givePoissonsRatio()
Returns Poisson&#39;s ratio.
#define _IFT_DustMaterial_beta
Definition: dustmat.h:48
FloatArray tempPlasticStrain
Definition: dustmat.h:83
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: dustmat.C:68
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
Definition: floatarray.C:146
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 ...
Definition: dustmat.C:502
double giveTempQ() const
Get the temp value of the hardening variable q from the material status.
Definition: dustmat.h:146
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
#define _IFT_DustMaterial_lambda
Definition: dustmat.h:49
double functionXDQ(double q)
Derivative by q of auxiliary equation X (7.11)
Definition: dustmat.C:619
double computeDeltaGamma2(double tempQ, double q, double i1, double bulkModulus)
Computed value of plastic multiplier for F2 yield function, equation 7.39.
Definition: dustmat.C:739
This class implements an isotropic linear elastic material in a finite element problem.
double x0
Parameter determining shape of yield surface (param X0 in original publication)
Definition: dustmat.h:256
virtual void giveRealStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &strainVector, TimeStep *tStep)
Default implementation relies on giveRealStressVector for second Piola-Kirchoff stress.
Definition: dustmat.C:256
double yieldFunction3(double i1)
Yield function 3 (tension dominant), equation 7.7.
Definition: dustmat.C:607
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
Definition: dustmat.C:537
#define _IFT_DustMaterial_hardeningType
Definition: dustmat.h:52
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
double functionFeDI1DI1(double i1)
Second derivative by i1 of auxiliary equation (7.8)
Definition: dustmat.C:583
double theta
Parameter determining shape of yield surface.
Definition: dustmat.h:246
DustMaterial(int n, Domain *d)
Constructor.
Definition: dustmat.C:158
void times(double f)
Multiplies receiver by factor f.
Definition: floatmatrix.C:1594
#define _IFT_DustMaterial_x0
Definition: dustmat.h:55
virtual int setIPValue(const FloatArray &value, GaussPoint *gp, InternalStateType type)
Sets the value of a certain variable at a given integration point to the given value.
void giveStressDependentPartOfStrainVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode)
double alpha
Parameter determining shape of yield surface.
Definition: dustmat.h:240
double fTempR2(double tempQ, double q, double i1, double rho, double bulkModulus, double shearModulus)
Equation 7.38.
Definition: dustmat.C:760
int giveStateFlag() const
Get the state flag from the material status.
Definition: dustmat.h:135
void letTempPlasticStrainBe(const FloatArray &v)
Assign the temp value of plastic strain.
Definition: dustmat.h:157
#define _IFT_DustMaterial_dHard
Definition: dustmat.h:59
This class implements material status for dust material model.
Definition: dustmat.h:68
double giveVolumetricPlasticStrain() const
Get the full plastic strain vector from the material status.
Definition: dustmat.h:125
double q0
Parameter determining shape of yield surface.
Definition: dustmat.h:258
double functionH(double q, double tempQ)
Auxiliary equation H (7.33 or 7.34)
Definition: dustmat.C:699
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: dustmat.C:78
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: structuralms.C:157
void performF1return(double i1, double rho, GaussPoint *gp)
Performs stress return of case of yield function F1, computes new value of tempQ and sets it to statu...
Definition: dustmat.C:390
double giveBulkModulus()
Get the value of actual bulk modulus of the status.
Definition: dustmat.h:199
Abstract base class representing a material status information.
Definition: matstatus.h:84
double giveQ() const
Get the value of hardening variable q from the material status.
Definition: dustmat.h:130
double functionFeDI1(double i1)
Derivative by i1 of auxiliary equation (7.8)
Definition: dustmat.C:577
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
FloatArray strainVector
Equilibrated strain vector in reduced form.
Definition: structuralms.h:69
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
void computePlastStrainDirM2(FloatArray &answer, const FloatArray &stressDeviator, double rho, double i1, double q)
Computes direction of plastic yielding m2, equation 7.19.
Definition: dustmat.C:674
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: dustmat.C:139
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
Definition: structuralms.h:135
double giveQ0() const
Definition: dustmat.h:483
double dHard
Parameter determining hardening law (parameter D in original publication)
Definition: dustmat.h:262
Class representing the general Input Record.
Definition: inputrecord.h:101
#define _IFT_DustMaterial_alpha
Definition: dustmat.h:47
double yieldFunction2(double rho, double i1, double q)
Yield function 2 (compression dominant), equation 7.6.
Definition: dustmat.C:601
void setYoungsModulus(double v)
Assign the value of actual Young&#39;s modulus of the status.
Definition: dustmat.h:194
double giveShearModulus()
Get the value of actual shear modulus of the status.
Definition: dustmat.h:204
void times(double s)
Multiplies receiver with scalar.
Definition: floatarray.C:818
static double computeDeviatoricVolumetricSplit(FloatArray &dev, const FloatArray &s)
Computes split of receiver into deviatoric and volumetric part.
double mStiff
Parameter increasing stiffness (parameter M in original publication)
Definition: dustmat.h:254
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
double beta
Parameter determining shape of yield surface.
Definition: dustmat.h:242
void solveQ0(double &answer)
Solves q0 according to given parameters, equation 7.12.
Definition: dustmat.C:625
Abstract base class for all "structural" constitutive models.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: structuralms.C:108
void setShearModulus(double v)
Assign the value of actual shear modulus of the status.
Definition: dustmat.h:189
Domain * giveDomain() const
Definition: femcmpnn.h:100
void computeQFromPlastVolEps(double &answer, double q, double deltaVolumetricPlasticStrain)
Computes tempQ from volumetric plastic strain increment, equation 7.44.
Definition: dustmat.C:476
REGISTER_Material(DummyMaterial)
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
double lambda
Parameter determining shape of yield surface.
Definition: dustmat.h:244
const FloatArray & giveTempStressVector() const
Returns the const pointer to receiver&#39;s temporary stress vector.
Definition: structuralms.h:117
double yieldFunction1(double rho, double i1)
Yield function 1 (shear dominant), equation 7.5.
Definition: dustmat.C:595
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 _IFT_DustMaterial_ft
Definition: dustmat.h:51
virtual void initTempStatus(GaussPoint *gp)
Initializes temporary variables stored in integration point status at the beginning of new time step...
Definition: material.C:267
#define _IFT_DustMaterial_wHard
Definition: dustmat.h:58
double giveYoungsModulus()
Returns Young&#39;s modulus.
FloatArray tempStressVector
Temporary stress vector in reduced form (increments are used mainly in nonlinear analysis) ...
Definition: structuralms.h:73
virtual int setIPValue(const FloatArray &value, GaussPoint *gp, InternalStateType type)
Sets the value of a certain variable at a given integration point to the given value.
Definition: dustmat.C:522
Class representing integration point in finite element program.
Definition: gausspoint.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
int stateFlag
Indicates the state (i.e. elastic, yielding, unloading) of the Gauss point.
Definition: dustmat.h:97
Class representing solution step.
Definition: timestep.h:80
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Definition: dustmat.C:88
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
static double computeShearModulusFromYoungAndPoisson(double young, double nu)
Computes shear modulus from given Young&#39;s modulus and Poisson&#39;s ratio.
double ft
Parameter determining shape of yield surface (param T in original publication)
Definition: dustmat.h:248
int newtonIter
Maximum number of iterations for iterative methods.
Definition: dustmat.h:266
FloatArray plasticStrain
Plastic strain.
Definition: dustmat.h:82
double q
Hardening parameter q.
Definition: dustmat.h:86
double rEll
Parameter determining shape of yield surface (param R in original publication)
Definition: dustmat.h:250
void setBulkModulus(double v)
Assign the value of actual bulk modulus of the status.
Definition: dustmat.h:184
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631

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