OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
rheoChM.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 - 2015 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 "mathfem.h"
36 #include "rheoChM.h"
37 #include "material.h"
39 //#include "Materials/latticelinearelastic.h"
40 #include "floatarray.h"
41 #include "floatmatrix.h"
42 #include "gausspoint.h"
43 #include "engngm.h"
44 #include "../sm/CrossSections/structuralcrosssection.h"
45 #include "contextioerr.h"
46 
47 namespace oofem {
49  EparVal(), charTimes(), discreteTimeScale()
50 {
51  nUnits = 0;
52  relMatAge = 0.0;
53  linearElasticMaterial = NULL;
54  EparValTime = -1.0;
56 }
57 
58 
60 {
61  if ( linearElasticMaterial ) {
62  delete linearElasticMaterial;
63  }
64 }
65 
66 
67 int
69 //
70 // returns whether the receiver supports the given mode
71 //
72 {
73  return mode == _3dMat || mode == _PlaneStress ||
74  mode == _PlaneStrain || mode == _1dMat ||
75  mode == _PlateLayer || mode == _2dBeamLayer ||
76  mode == _2dLattice || mode == _3dLattice;
77 }
78 
79 
80 void
82  GaussPoint *gp,
83  const FloatArray &totalStrain,
84  TimeStep *tStep)
85 //
86 // returns the total stress vector (in full or reduced form - form parameter)
87 // of the receiver according to
88 // the previous level of stress and the current
89 // strain increment at time tStep.
90 //
91 {
92  FloatArray stressIncrement, stressVector, strainIncrement, reducedStrain;
93  FloatMatrix Binv;
94  double Emodulus;
95  RheoChainMaterialStatus *status = static_cast< RheoChainMaterialStatus * >( this->giveStatus(gp) );
96 
97  // initialize the temporary material status and the Gauss point
98  this->initTempStatus(gp);
99 
100  if ( !this->isActivated(tStep) ) {
101  FloatArray zeros;
103  zeros.zero();
104  status->letTempStrainVectorBe(zeros);
105  status->letTempStressVectorBe(zeros);
106  answer = zeros;
107  return;
108  }
109 
110  // subtract the part of strain which does not depend on the stress increment from the final strain
111  // note: it is somewhat confusing to say "stress-dependent" part of strain
112  // because here we subtract not only the part of strain that does not depend
113  // on stress (e.g., thermal and shrinkage strain) but also the creep strain,
114  // which depends on the previous stress history but not on the stress increment
115  //
116  this->giveStressDependentPartOfStrainVector(reducedStrain, gp, totalStrain,
117  tStep, VM_Incremental);
118  // subtract the initial strain to get the "net" strain increment,
119  // which is related to the stress increment
120  strainIncrement.beDifferenceOf( reducedStrain, status->giveStrainVector() );
121 
122  // get the initial stress, or set it to zero if not available (first step)
123  //if ( status->giveStressVector().giveSize() ) {
124  // stressVector = status->giveStressVector();
125  if ( status->giveViscoelasticStressVector().giveSize() ) {
126  stressVector = status->giveViscoelasticStressVector();
127  } else {
128  stressVector.resize( strainIncrement.giveSize() );
129  stressVector.zero();
130  }
131 
132  if ( tStep->giveIntrinsicTime() < this->castingTime && preCastingTimeMat > 0 ) {
133 
135  sMat->giveStiffnessMatrix(Binv, ElasticStiffness, gp, tStep);
136 
137  } else {
138  // evaluate the incremental modulus
139  Emodulus = this->giveEModulus(gp, tStep);
140  // construct the unit stiffness matrix (depends on Poisson's ratio)
141  this->giveUnitStiffnessMatrix(Binv, gp, tStep);
142  // multiply the "net" strain increment by unit stiffness and by the incremental modulus
143  Binv.times(Emodulus);
144 
145  }
146 
147  stressIncrement.beProductOf(Binv, strainIncrement);
148  // stressIncrement.times(Emodulus);
149 
150  // add the stress increment to the inital stress
151  stressVector.add(stressIncrement);
152 
153  // store the final strain and stress in the status
154  status->letTempStrainVectorBe(totalStrain);
155  status->letTempStressVectorBe(stressVector);
156 
157  // update the shrinkage strain if needed
158  if ( this->hasIncrementalShrinkageFormulation() ) {
159  FloatArray shv;
160  this->giveShrinkageStrainVector(shv, gp, tStep, VM_Total);
161  status->setShrinkageStrainVector(shv);
162  }
163 
164  answer = stressVector;
165 }
166 
167 
168 void
170  GaussPoint *gp, TimeStep *tStep)
171 //
172 // returns a FloatArray(6) of initial strain vector
173 // eps_0 = {exx_0, eyy_0, ezz_0, gyz_0, gxz_0, gxy_0}^T
174 // caused by unit temperature in direction of
175 // gp (element) local axes
176 //
177 {
178  MaterialMode mMode = gp->giveMaterialMode();
179 
180  answer.resize(6);
181  answer.zero();
182 
183  if ( mMode == _2dLattice || mMode == _3dLattice ) {
184  answer.at(1) = ( this->talpha );
185  } else {
186  answer.at(1) = ( this->talpha );
187  answer.at(2) = ( this->talpha );
188  answer.at(3) = ( this->talpha );
189  }
190 }
191 
192 void
194  const FloatArray &tSteps,
195  double t0, double tr,
196  GaussPoint *gp, TimeStep *tStep)
197 {
198  int size, nsteps, si;
199  double taui, tauk, Jtrt0, totalDeltaSigma;
200  double sig0;
201  double sum;
202 
203  size = tSteps.giveSize();
204  nsteps = size;
205  FloatArray deltaSigma(size);
206  answer.resize(size);
207  answer.zero();
208 
209  Jtrt0 = this->computeCreepFunction(t0 + tSteps.at(1), t0, gp, tStep);
210  sig0 = 1. / Jtrt0;
211  answer.at(1) = sig0;
212  si = 2;
213 
214  totalDeltaSigma = 0.;
215  for ( int k = si; k <= nsteps; k++ ) {
216  sum = 0.;
217  for ( int i = si; i <= k - 1; i++ ) {
218  if ( i == 1 ) {
219  // ??? it seems that tr plays no role because si=2 and the case
220  // i=1 or k=1 can never occur
221  taui = 0.5 * ( t0 + tSteps.at(i) + tr );
222  } else {
223  taui = t0 + 0.5 * ( tSteps.at(i) + tSteps.at(i - 1) );
224  }
225 
226  sum += deltaSigma.at(i) * this->computeCreepFunction(t0 + tSteps.at(k), taui, gp, tStep);
227  }
228 
229  if ( k == 1 ) {
230  // ??? it seems that tr plays no role because si=2 and the case
231  // i=1 or k=1 can never occur
232  tauk = 0.5 * ( t0 + tSteps.at(k) + tr );
233  } else {
234  tauk = t0 + 0.5 * ( tSteps.at(k) + tSteps.at(k - 1) );
235  }
236 
237  deltaSigma.at(k) = ( sig0 * ( this->computeCreepFunction(t0 + tSteps.at(k), t0, gp, tStep) - Jtrt0 )
238  - sum ) / this->computeCreepFunction(t0 + tSteps.at(k), tauk, gp, tStep);
239 
240  totalDeltaSigma += deltaSigma.at(k);
241  answer.at(k) = sig0 - totalDeltaSigma;
242  }
243 }
244 
245 
246 void
247 RheoChainMaterial :: generateLogTimeScale(FloatArray &answer, double from, double to, int nsteps)
248 {
249  answer.resize(nsteps);
250  answer.zero();
251 
252  double help = log(to / from) / nsteps;
253  for ( int i = 1; i <= nsteps; i++ ) {
254  answer.at(i) = exp(i * help) * from;
255  }
256 }
257 
258 
259 const FloatArray &
261 {
262  return discreteTimeScale;
263 }
264 
265 
266 void
268  GaussPoint *gp,
269  TimeStep *tStep)
270 {
271  /*
272  * Returns the stiffness matrix of an isotropic linear elastic material
273  * with the given Poisson ratio (assumed to be unaffected by creep)
274  * and a unit value of Young's modulus.
275  *
276  * We call crossSection, because we need Binv matrix also for modes
277  * defined at the crosssection level.
278  * (Hidden stresses are stored in MatStatus level, but they are
279  * defined by stressStrain mode in gp, which may be of a type suported
280  * at the crosssection level).
281  */
282  this->giveLinearElasticMaterial()->giveStiffnessMatrix(answer, ElasticStiffness, gp, tStep);
283 }
284 
285 void
287  GaussPoint *gp,
288  TimeStep *tStep)
289 /*
290  * Returns the compliance matrix of an isotropic linear elastic material
291  * with the given Poisson ratio (assumed to be unaffected by creep)
292  * and a unit value of Young's modulus.
293  */
294 {
295  FloatMatrix tangent;
296  this->giveLinearElasticMaterial()->giveStiffnessMatrix(tangent, ElasticStiffness, gp, tStep);
297  answer.beInverseOf(tangent);
298 }
299 
300 
301 
302 double
304 {
305  /* returns the modulus of unit number iChain,
306  * previously computed by updateEparModuli() function
307  */
308  return EparVal.at(iChain);
309 }
310 
311 
312 void
314 {
315  /*
316  * Computes moduli of individual units in the chain that provide
317  * the best approximation of the relaxation or creep function,
318  * depending on whether a Maxwell or Kelvin chain is used.
319  *
320  * INPUTS:
321  *
322  * tStep - age of material when load is applied ???
323  *
324  * DESCRIPTION:
325  * We store the computed values because they will be used by other material points in subsequent
326  * calculations. Their computation is very costly.
327  * For a given active time step, there should be requests only for Epar values at time
328  * (currentTime+prevTime)*0.5. The previous values are not needed.
329  *
330  */
331  // compute new values and store them in a temporary array for further use
332  if ( fabs(tPrime - EparValTime) > TIME_DIFF ) {
333  if ( tPrime < 0 ) {
334  this->computeCharCoefficients(EparVal, 1.e-3, gp, tStep);
335  } else {
336  this->computeCharCoefficients(EparVal, tPrime, gp, tStep);
337  }
338  EparValTime = tPrime;
339  }
340 }
341 
342 
343 void
345  GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
346 //
347 // computes the strain due to temperature and shrinkage effects
348 // (it is called "true" because the "stress-independent strain"
349 // will also contain the effect of creep)
350 //
351 {
352  FloatArray e0;
353 
354  // shrinkage strain
355  this->giveShrinkageStrainVector(answer, gp, tStep, mode);
356 
357  // thermally induced strain
359  answer.add(e0);
360 
361  if ( e0.giveSize() ) {
362 #ifdef keep_track_of_strains
363  RheoChainMaterialStatus *status = static_cast< RheoChainMaterialStatus * >( this->giveStatus(gp) );
364  status->setTempThermalStrain( status->giveThermalStrain() + e0.at(1) );
365 #endif
366  }
367 }
368 
369 
370 void
372  GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
373 //
374 // computes the strain due to temperature, shrinkage and creep effects
375 // (it is the strain which would occur at the end of the step if the stress
376 // during the step was held constant, so it is not really the part of strain
377 // independent of stress, but independent of the stress increment)
378 //
379 // takes into account the form of the load vector assumed by engngModel (Incremental or Total Load form)
380 //
381 {
382  FloatArray e0;
383 
384  // strain due to temperature changes and shrinkage
385  this->computeTrueStressIndependentStrainVector(answer, gp, tStep, mode);
386  // strain due to creep
387  if ( tStep->giveIntrinsicTime() >= this->castingTime ) {
388  this->giveEigenStrainVector(e0, gp, tStep, mode);
389  if ( e0.giveSize() ) {
390  answer.add(e0);
391  }
392  }
393 }
394 
395 
396 double
398 {
399  return charTimes.at(i);
400 }
401 
402 void
404 {
405  /*
406  * This function generates discrete characteristic times
407  * according to rules which guarantee a good approximation
408  * of the relaxation or creep function by the Dirichlet series
409  *
410  * Default value of the first relaxation time Tau(1) is chosen to be equal to 0.1 day.
411  * The last relaxation time Tau(n) is chosen as 1.0e30
412  * (to approximate very long processes).
413  * The second largest time Tau(n-1) is chosen as 0.75 tmax
414  * where tmax is the lifetime of structure or the end of the time of interest.
415  * Times Tau(2) .. Tau(n-2) are defined by uniform division to n-2 steps in the
416  * log scale. It is necessary to check the condition stepMultiplier <= 10, where Tau(k) = stepMultiplier Tau(k-1)
417  *
418  *
419  */
420 
421  int size, nsteps;
422  double endTime, Taun1, Tau1, help;
423 
424  double stepMultiplier = 10.;
425 
426  endTime = this->giveEndOfTimeOfInterest() + relMatAge;
427  Taun1 = 0.75 * endTime;
428 
429  if ( this->begOfTimeOfInterest == -1 ) {
430  this->begOfTimeOfInterest = 0.1; //default value
431  }
432 
433  Tau1 = begOfTimeOfInterest;
434 
435  if ( Tau1 <= 0 ) {
436  OOFEM_ERROR("begOfTimeOfInterest must be a positive number");
437  }
438 
439  nsteps = ( int ) ( ( log(Taun1) - log(Tau1) ) / log(stepMultiplier) + 1. );
440  if ( nsteps < 8 ) {
441  nsteps = 8;
442  }
443 
444  this->nUnits = size = nsteps + 2;
445 
446  this->charTimes.resize(size);
447  this->charTimes.zero();
448 
449  charTimes.at(1) = Tau1;
450  charTimes.at(size) = 1.0e10;
451  help = ( log(Taun1) - log(Tau1) ) / ( double ) nsteps;
452  for ( int i = 1; i <= nsteps; i++ ) {
453  charTimes.at(i + 1) = exp(log(Tau1) + help * i);
454  }
455 }
456 
457 
458 void
460  MatResponseMode mode,
461  GaussPoint *gp,
462  TimeStep *tStep)
463 {
464  //
465  // Returns the incremental material stiffness matrix of the receiver
466  // PH: the "giveEModulus must be called before any method on elastic material
467  // otherwise the status would refer to the elastic material and not to the
468  // viscoelastic one
469  // in my opinion ElasticStiffness should return incremental stiffness and not unit stiffness
470  // for this purpose use giveUnitStiffnessMatrix
471  //
472 
473  this->giveStatus(gp); // Ensures correct status creation
474  if ( tStep->giveIntrinsicTime() < this->castingTime && preCastingTimeMat > 0 ) {
476  sMat->give3dMaterialStiffnessMatrix(answer, mode, gp, tStep);
477  } else {
478  double incrStiffness = this->giveEModulus(gp, tStep);
479  this->giveLinearElasticMaterial()->give3dMaterialStiffnessMatrix(answer, mode, gp, tStep);
480  answer.times(incrStiffness);
481  }
482 }
483 
484 
485 void
487  MatResponseMode mode,
488  GaussPoint *gp,
489  TimeStep *tStep)
490 {
491  this->giveStatus(gp); // Ensures correct status creation
492  if ( tStep->giveIntrinsicTime() < this->castingTime && preCastingTimeMat > 0 ) {
494  sMat->givePlaneStressStiffMtrx(answer, mode, gp, tStep);
495  } else {
496  double incrStiffness = this->giveEModulus(gp, tStep);
497  this->giveLinearElasticMaterial()->givePlaneStressStiffMtrx(answer, mode, gp, tStep);
498  answer.times(incrStiffness);
499  }
500 }
501 
502 void
504  MatResponseMode mode,
505  GaussPoint *gp,
506  TimeStep *tStep)
507 {
508  this->giveStatus(gp); // Ensures correct status creation
509  if ( tStep->giveIntrinsicTime() < this->castingTime && preCastingTimeMat > 0 ) {
511  sMat->givePlaneStrainStiffMtrx(answer, mode, gp, tStep);
512  } else {
513  double incrStiffness = this->giveEModulus(gp, tStep);
514  this->giveLinearElasticMaterial()->givePlaneStrainStiffMtrx(answer, mode, gp, tStep);
515  answer.times(incrStiffness);
516  }
517 }
518 
519 
520 void
522  MatResponseMode mode,
523  GaussPoint *gp,
524  TimeStep *tStep)
525 {
526  this->giveStatus(gp); // Ensures correct status creation
527  if ( tStep->giveIntrinsicTime() < this->castingTime && preCastingTimeMat > 0 ) {
529  sMat->give1dStressStiffMtrx(answer, mode, gp, tStep);
530  } else {
531  double incrStiffness = this->giveEModulus(gp, tStep);
532  this->giveLinearElasticMaterial()->give1dStressStiffMtrx(answer, mode, gp, tStep);
533  answer.times(incrStiffness);
534  }
535 }
536 
537 void
539  MatResponseMode mode,
540  GaussPoint *gp,
541  TimeStep *tStep)
542 {
543 
544  this->giveStatus(gp); // Ensures correct status creation
545  if ( tStep->giveIntrinsicTime() < this->castingTime && preCastingTimeMat > 0 ) {
547  sMat->give2dLatticeStiffMtrx(answer, mode, gp, tStep);
548  } else {
549  double incrStiffness = this->giveEModulus(gp, tStep);
550  this->giveLinearElasticMaterial()->give2dLatticeStiffMtrx(answer, mode, gp, tStep);
551  answer.times(incrStiffness);
552  }
553 }
554 
555 
556 void
558  MatResponseMode mode,
559  GaussPoint *gp,
560  TimeStep *tStep)
561 {
562  this->giveStatus(gp); // Ensures correct status creation
563  if ( tStep->giveIntrinsicTime() < this->castingTime && preCastingTimeMat > 0 ) {
565  sMat->give3dLatticeStiffMtrx(answer, mode, gp, tStep);
566  } else {
567  double incrStiffness = this->giveEModulus(gp, tStep);
568  this->giveLinearElasticMaterial()->give3dLatticeStiffMtrx(answer, mode, gp, tStep);
569  answer.times(incrStiffness);
570  }
571 }
572 
573 
574 
577 {
578  return new RheoChainMaterialStatus(1, this->giveDomain(), gp, nUnits);
579 }
580 
581 
584 {
585  IRResultType result; // Required by IR_GIVE_FIELD macro
586 
588  if ( result != IRRT_OK ) return result;
589 
590  this->talpha = 0.;
592 
593  // "slave" material for time < castingTime
595 
597  lattice = true;
598  this->alphaOne = 1.;
599  this->alphaTwo = 1.;
602  } else {
603  lattice = false;
605  }
606 
608  this->begOfTimeOfInterest = -1.0;
610  this->endOfTimeOfInterest = -1.0;
612  IR_GIVE_FIELD(ir, timeFactor, _IFT_RheoChainMaterial_timefactor); // solution time/timeFactor should give time in days
613 
614  // sets up nUnits variable and characteristic times array (retardation/relaxation times)
615  this->computeCharTimes();
616 
617  // sets up discrete times
618  double endTime = this->giveEndOfTimeOfInterest();
620 
622  //ph !!! why was it put here?
623  //this->updateEparModuli(0.); // stiffnesses are time independent (evaluated at time t = 0.)
624 
625  return IRRT_OK;
626 }
627 
630 {
631  if ( linearElasticMaterial == NULL ) {
632  if ( this->lattice ) {
633  /* linearElasticMaterial = new LatticeLinearElastic(this->giveNumber(),
634  this->giveDomain(),
635  1.0, this->alphaOne, this->alphaTwo);*/
636  } else {
638  this->giveDomain(),
639  1.0, this->nu);
640  }
641  }
642 
643  return linearElasticMaterial;
644 }
645 
646 double
648 {
649  if ( this->endOfTimeOfInterest > 0.0 ) {
650  return this->endOfTimeOfInterest;
651  } else {
653  }
654 
655  return this->endOfTimeOfInterest;
656 }
657 
660 //
661 // saves full status for this material, also invokes saving
662 // for sub-objects of this
663 {
664  contextIOResultType iores;
665 
666  if ( ( iores = Material :: saveIPContext(stream, mode, gp) ) != CIO_OK ) {
667  THROW_CIOERR(iores);
668  }
669 
670  if ( ( iores = giveLinearElasticMaterial()->saveIPContext(stream, mode, gp) ) != CIO_OK ) {
671  THROW_CIOERR(iores);
672  }
673 
674  return CIO_OK;
675 }
676 
677 
680 //
681 // reads full status for this material, also invokes reading
682 // of sub-objects of this
683 //
684 {
685  contextIOResultType iores;
686 
687  if ( ( iores = Material :: restoreIPContext(stream, mode, gp) ) != CIO_OK ) {
688  THROW_CIOERR(iores);
689  }
690 
691  // invoke possible restoring of statuses for submaterials
692  if ( ( iores = giveLinearElasticMaterial()->restoreIPContext(stream, mode, gp) ) != CIO_OK ) {
693  THROW_CIOERR(iores);
694  }
695 
696  return CIO_OK;
697 }
698 
699 
700 int
702 {
703  if ( type == IST_ThermalStrainTensor ) {
704  RheoChainMaterialStatus *status = static_cast< RheoChainMaterialStatus * >( this->giveStatus(gp) );
705  answer.resize(6);
706  answer.zero();
707  answer.at(1) = answer.at(2) = answer.at(3) = status->giveThermalStrain();
708  return 1;
709  } else {
710  return StructuralMaterial :: giveIPValue(answer, gp, type, tStep);
711  }
712 
713  return 1; // to make the compiler happy
714 }
715 
716 /****************************************************************************************/
717 
719  GaussPoint *g, int nunits) :
720  StructuralMaterialStatus(n, d, g),
721  nUnits(nunits),
722  hiddenVars(nUnits),
723  tempHiddenVars(nUnits),
724  shrinkageStrain()
725 {
726 
727 
728 #ifdef keep_track_of_strains
729  thermalStrain = 0.;
730  tempThermalStrain = 0.;
731 #endif
732 }
733 
734 
736 
737 
738 void
740 {
741  // Sets the i:th hidden variables vector to valueArray.
742 #ifdef DEBUG
743  if ( i > nUnits ) {
744  OOFEM_ERROR("unit number exceeds the specified limit");
745  }
746 #endif
747  this->tempHiddenVars [ i - 1 ] = valueArray;
748 }
749 
750 void
752 {
753  // printing of hidden variables
754 
756 
757  fprintf(file, "{hidden variables: ");
758  for ( int i = 0; i < nUnits; i++ ) {
759  fprintf(file, "{ ");
760  for ( auto &val : hiddenVars[i] ) {
761  fprintf( file, "%f ", val );
762  }
763 
764  fprintf(file, "} ");
765  }
766 
767  if ( shrinkageStrain.isNotEmpty() ) {
768  fprintf(file, "shrinkageStrain: {");
769  for ( auto &val : shrinkageStrain ) {
770  fprintf( file, "%f ", val );
771  }
772 
773  fprintf(file, "} ");
774  }
775 
776  fprintf(file, "}\n");
777 }
778 
779 
780 void
782 {
784 
785  for ( int i = 0; i < nUnits; i++ ) {
786  this->hiddenVars [ i ] = this->tempHiddenVars [ i ];
787  }
788 
789 #ifdef keep_track_of_strains
791  tempThermalStrain = 0.;
792 #endif
793 }
794 
795 void
797 {
799 }
800 
803 //
804 // saves full information stored in this Status
805 //
806 {
807  contextIOResultType iores;
808 
809  if ( ( iores = StructuralMaterialStatus :: saveContext(stream, mode, obj) ) != CIO_OK ) {
810  THROW_CIOERR(iores);
811  }
812 
813  // write raw data
814  for ( int i = 0; i < nUnits; i++ ) {
815  if ( ( iores = hiddenVars [ i ].storeYourself(stream) ) != CIO_OK ) {
816  THROW_CIOERR(iores);
817  }
818  }
819 
820  if ( ( iores = shrinkageStrain.storeYourself(stream) ) != CIO_OK ) {
821  THROW_CIOERR(iores);
822  }
823 
824  return CIO_OK;
825 }
826 
827 
830 //
831 // restore the state variables from a stream
832 //
833 {
834  contextIOResultType iores;
835 
836  if ( ( iores = StructuralMaterialStatus :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
837  THROW_CIOERR(iores);
838  }
839 
840  // read raw data
841  for ( int i = 0; i < nUnits; i++ ) {
842  if ( ( iores = hiddenVars [ i ].restoreYourself(stream) ) != CIO_OK ) {
843  THROW_CIOERR(iores);
844  }
845  }
846 
847  if ( ( iores = shrinkageStrain.restoreYourself(stream) ) != CIO_OK ) {
848  THROW_CIOERR(iores);
849  }
850 
851  return CIO_OK;
852 }
853 } // end namespace oofem
static int giveSizeOfVoigtSymVector(MaterialMode mmode)
Returns the size of symmetric part of a reduced stress/strain vector according to given mode...
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.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
double relMatAge
Physical age of the material at simulation time = 0.
Definition: rheoChM.h:138
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
Definition: structuralms.h:137
virtual void give1dStressStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d stiffness matrix of receiver.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
virtual bool isActivated(TimeStep *tStep)
Definition: rheoChM.h:292
double giveCharTime(int) const
Access to the characteristic time of a given unit.
Definition: rheoChM.C:397
Class and object Domain.
Definition: domain.h:115
double nu
Poisson&#39;s ratio (assumed to be constant, unaffected by creep).
Definition: rheoChM.h:142
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 ...
Definition: rheoChM.C:459
std::vector< FloatArray > tempHiddenVars
Definition: rheoChM.h:78
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
virtual ~RheoChainMaterialStatus()
Definition: rheoChM.C:735
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: rheoChM.C:781
virtual contextIOResultType saveIPContext(DataStream &stream, ContextMode mode, GaussPoint *gp)
Stores integration point state to output stream.
Definition: material.C:173
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Definition: rheoChM.C:751
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
contextIOResultType storeYourself(DataStream &stream) const
Definition: floatarray.C:872
double giveThermalStrain(void)
Definition: rheoChM.h:117
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
#define _IFT_RheoChainMaterial_endoftimeofinterest
Definition: rheoChM.h:58
virtual void give1dStressStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d stiffness matrix of receiver.
Definition: rheoChM.C:521
void computeTrueStressIndependentStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
Computes, for the given integration point, the strain vector induced by stress-independent internal p...
Definition: rheoChM.C:344
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual void givePlaneStrainStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane strain stiffness matrix of receiver.
virtual int hasIncrementalShrinkageFormulation()
If only incremental shrinkage strain formulation is provided, then total shrinkage strain must be tra...
Definition: rheoChM.h:306
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
LinearElasticMaterial * giveLinearElasticMaterial()
Access to the underlying linear elastic material with unit Young&#39;s modulus.
Definition: rheoChM.C:629
virtual void giveShrinkageStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
Computes, for the given integration point, the strain vector induced by stress-independent shrinkage...
Definition: rheoChM.h:267
This class implements a structural material status information.
Definition: structuralms.h:65
double begOfTimeOfInterest
Time from which the model should give a good approximation. Optional field. Default value is 0...
Definition: rheoChM.h:149
virtual void giveRealStressVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Computes the real stress vector for given total strain and integration point.
Definition: rheoChM.C:81
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: rheoChM.C:802
This class implements associated Material Status to RheoChainMaterial.
Definition: rheoChM.h:71
FloatArray EparVal
Partial moduli of individual units.
Definition: rheoChM.h:155
int preCastingTimeMat
Stiffness at time less than casting time - optional parameter, negative by default.
Definition: rheoChM.h:172
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: rheoChM.C:829
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Definition: domain.C:433
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
void setTempThermalStrain(double src)
Definition: rheoChM.h:115
#define MNC_NPOINTS
Definition: rheoChM.h:65
virtual double computeCreepFunction(double t, double t_prime, GaussPoint *gp, TimeStep *tStep)=0
Evaluation of the creep compliance function at time t when loading is acting from time t_prime...
virtual contextIOResultType restoreIPContext(DataStream &stream, ContextMode mode, GaussPoint *gp)
Reads integration point state to output stream.
Definition: material.C:204
#define _IFT_RheoChainMaterial_timefactor
Definition: rheoChM.h:59
virtual contextIOResultType restoreIPContext(DataStream &stream, ContextMode mode, GaussPoint *gp)
Reads integration point state to output stream.
Definition: rheoChM.C:679
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
MatResponseMode
Describes the character of characteristic material matrix.
const FloatArray & giveDiscreteTimes()
Definition: rheoChM.C:260
#define _IFT_RheoChainMaterial_alphaOne
Definition: rheoChM.h:53
virtual void give2dLatticeStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d lattice stiffness matrix of receiver.
Definition: rheoChM.C:538
virtual void giveThermalDilatationVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
Returns a vector of coefficients of thermal dilatation in direction of each material principal (local...
Definition: rheoChM.C:169
double giveEndOfTimeOfInterest()
Access to the time up to which the response should be accurate.
Definition: rheoChM.C:647
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
This class is a abstract base class for all linear elastic material models in a finite element proble...
double giveEparModulus(int iChain)
Access to partial modulus of a given unit.
Definition: rheoChM.C:303
FloatArray charTimes
Characteristic times of individual units (relaxation or retardation times).
Definition: rheoChM.h:158
void letTempHiddenVarsVectorBe(int i, FloatArray &valueArray)
Definition: rheoChM.C:739
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
Definition: floatarray.C:341
virtual contextIOResultType saveIPContext(DataStream &stream, ContextMode mode, GaussPoint *gp)
Stores integration point state to output stream.
Definition: rheoChM.C:659
virtual int hasMaterialModeCapability(MaterialMode mode)
Tests if material supports material mode.
Definition: rheoChM.C:68
void giveUnitStiffnessMatrix(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
Evaluation of elastic stiffness matrix for unit Young&#39;s modulus.
Definition: rheoChM.C:267
virtual void give3dLatticeStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 3d lattice stiffness matrix of receiver.
double timeFactor
Scaling factor transforming the simulation time units into days (gives the number of simulation time ...
Definition: rheoChM.h:167
RheoChainMaterialStatus(int n, Domain *d, GaussPoint *g, int nunits)
Definition: rheoChM.C:718
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual ~RheoChainMaterial()
Definition: rheoChM.C:59
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the stiffness matrix for giveRealStressVector of receiver in given integration point...
double alphaOne
Parameters for the lattice model.
Definition: rheoChM.h:144
double endOfTimeOfInterest
Time (age???) up to which the model should give a good approximation.
Definition: rheoChM.h:151
virtual double giveEModulus(GaussPoint *gp, TimeStep *tStep)=0
Evaluation of the incremental modulus.
Material * giveMaterial(int n)
Service for accessing particular domain material model.
Definition: domain.C:281
This class implements an isotropic linear elastic material in a finite element problem.
void giveUnitComplianceMatrix(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
Evaluation of elastic compliance matrix for unit Young&#39;s modulus.
Definition: rheoChM.C:286
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
Definition: rheoChM.C:576
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 ...
void times(double f)
Multiplies receiver by factor f.
Definition: floatmatrix.C:1594
contextIOResultType restoreYourself(DataStream &stream)
Definition: floatarray.C:895
FloatArray shrinkageStrain
Total shrinkage strain (needed only when the shrinkage evolution is described in the incremental form...
Definition: rheoChM.h:84
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
void computeDiscreteRelaxationFunction(FloatArray &answer, const FloatArray &tSteps, double t0, double tr, GaussPoint *gp, TimeStep *tSte)
Evaluation of the relaxation function at given times.
Definition: rheoChM.C:193
RheoChainMaterial(int n, Domain *d)
Definition: rheoChM.C:48
#define _IFT_RheoChainMaterial_talpha
Definition: rheoChM.h:60
#define _IFT_RheoChainMaterial_n
Definition: rheoChM.h:52
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
Definition: timestep.h:148
std::vector< FloatArray > hiddenVars
Hidden (internal) variables, the meaning of which depends on the type of chain.
Definition: rheoChM.h:77
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: structuralms.C:157
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
Definition: rheoChM.C:701
virtual double giveEndOfTimeOfInterest()
Returns end of time interest (time corresponding to end of time integration).
Definition: engngm.h:752
virtual void givePlaneStressStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane stress stiffness matrix of receiver.
Definition: rheoChM.C:486
#define _IFT_RheoChainMaterial_preCastingTimeMat
Definition: rheoChM.h:61
Abstract base class representing a material status information.
Definition: matstatus.h:84
virtual void updateEparModuli(double tPrime, GaussPoint *gp, TimeStep *tStep)
Update of partial moduli of individual chain units.
Definition: rheoChM.C:313
virtual void give3dLatticeStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 3d lattice stiffness matrix of receiver.
Definition: rheoChM.C:557
Class representing vector of real numbers.
Definition: floatarray.h:82
#define _IFT_RheoChainMaterial_begoftimeofinterest
Definition: rheoChM.h:57
#define _IFT_RheoChainMaterial_relmatage
Definition: rheoChM.h:56
virtual void givePlaneStrainStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane strain stiffness matrix of receiver.
Definition: rheoChM.C:503
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
virtual void computeStressIndependentStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
Computes reduced strain vector in given integration point, generated by internal processes in materia...
Definition: rheoChM.C:371
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual void give2dLatticeStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d lattice stiffness matrix of receiver.
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
Definition: structuralms.h:135
Class representing the general Input Record.
Definition: inputrecord.h:101
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual void computeCharTimes()
Evaluation of characteristic times.
Definition: rheoChM.C:403
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: rheoChM.C:796
#define TIME_DIFF
Definition: rheoChM.h:66
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: rheoChM.C:583
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
virtual void computeCharCoefficients(FloatArray &answer, double tPrime, GaussPoint *gp, TimeStep *tStep)=0
Evaluation of the moduli of individual units.
Domain * giveDomain() const
Definition: femcmpnn.h:100
FloatArray discreteTimeScale
Times at which the errors are evaluated if the least-square method is used.
Definition: rheoChM.h:160
double talpha
thermal dilatation coeff.
Definition: rheoChM.h:134
double castingTime
Casting time.
Definition: material.h:113
#define _IFT_RheoChainMaterial_alphaTwo
Definition: rheoChM.h:54
#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 saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: structuralms.C:133
virtual const FloatArray & giveViscoelasticStressVector() const
Definition: rheoChM.h:97
the oofem namespace is to define a context or scope in which all oofem names are defined.
bool isNotEmpty() const
Returns true if receiver is not empty.
Definition: floatarray.h:220
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
virtual void initTempStatus(GaussPoint *gp)
Initializes temporary variables stored in integration point status at the beginning of new time step...
Definition: material.C:267
int giveNumber() const
Definition: femcmpnn.h:107
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
Definition: floatmatrix.C:835
virtual void givePlaneStressStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane stress stiffness matrix of receiver.
const FloatArray & giveStrainVector() const
Returns the const pointer to receiver&#39;s strain vector.
Definition: structuralms.h:105
int nUnits
Number of (Maxwell or Kelvin) units in the rheologic chain.
Definition: rheoChM.h:136
void setShrinkageStrainVector(FloatArray src)
Definition: rheoChM.h:105
virtual void giveEigenStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
Computes, for the given integration point, the strain vector induced by the stress history (typically...
Definition: rheoChM.h:282
LinearElasticMaterial * linearElasticMaterial
Associated linearElasticMaterial, with E = 1.
Definition: rheoChM.h:153
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
double EparValTime
Time for which the partial moduli of individual units have been evaluated.
Definition: rheoChM.h:146
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
#define _IFT_RheoChainMaterial_lattice
Definition: rheoChM.h:55
virtual void computeStressIndependentStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
Computes reduced strain vector in given integration point, generated by internal processes in materia...
int nUnits
Number of units in the chain.
Definition: rheoChM.h:75
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631
static void generateLogTimeScale(FloatArray &answer, double from, double to, int nsteps)
Generates discrete times starting from time "from" to time "to" uniformly distributed in log time sca...
Definition: rheoChM.C:247

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