OOFEM 3.0
Loading...
Searching...
No Matches
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 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#include "mathfem.h"
36#include "rheoChM.h"
37#include "material.h"
40#include "floatarray.h"
41#include "floatmatrix.h"
42#include "gausspoint.h"
43#include "engngm.h"
45#include "contextioerr.h"
46
47namespace oofem {
48RheoChainMaterial :: RheoChainMaterial(int n, Domain *d) : StructuralMaterial(n, d)
49{}
50
51
52RheoChainMaterial :: ~RheoChainMaterial()
53{
56 }
57}
58
59
60bool
61RheoChainMaterial :: hasMaterialModeCapability(MaterialMode mode) const
62{
63 return mode == _3dMat || mode == _PlaneStress ||
64 mode == _PlaneStrain || mode == _1dMat ||
65 mode == _PlateLayer || mode == _2dBeamLayer ||
66 mode == _1dLattice || mode == _2dLattice ||
67 mode == _3dLattice;
68}
69
70
71void
72RheoChainMaterial :: giveRealStressVector(FloatArray &answer,
73 GaussPoint *gp,
74 const FloatArray &totalStrain,
75 TimeStep *tStep) const
76//
77// returns the total stress vector (in full or reduced form - form parameter)
78// of the receiver according to
79// the previous level of stress and the current
80// strain increment at time tStep.
81//
82{
83 FloatArray stressIncrement, stressVector, strainIncrement, reducedStrain;
84 FloatMatrix Binv;
85 double Emodulus;
86 RheoChainMaterialStatus *status = static_cast< RheoChainMaterialStatus * >( this->giveStatus(gp) );
87
88 // Initialize the temporary material status and the Gauss point
89 // Do not initialize if the the actual time is the same as before
90 // this has to be introduced when the time-stepping is variable and
91 // some time steps can be run several times
92 // It is vital to erase some temporary variables if the time is changed and
93 // the time step is still the same
94 // In order to guarantee a reasonable performance the temporary status is not
95 // initialized in subsequent iterations of the same time step
96
97 if ( status->giveCurrentTime() != tStep->giveTargetTime() ) {
98 status->setCurrentTime(tStep->giveTargetTime() );
99 this->initTempStatus(gp);
100 }
101
102 if ( !this->isActivated(tStep) ) {
104 zeros.resize(StructuralMaterial :: giveSizeOfVoigtSymVector(gp->giveMaterialMode() ) );
105 zeros.zero();
108 answer = zeros;
109 return;
110 }
111
112 // subtract the part of strain which does not depend on the stress increment from the final strain
113 // note: it is somewhat confusing to say "stress-dependent" part of strain
114 // because here we subtract not only the part of strain that does not depend
115 // on stress (e.g., thermal and shrinkage strain) but also the creep strain,
116 // which depends on the previous stress history but not on the stress increment
117 //
118 this->giveStressDependentPartOfStrainVector(reducedStrain, gp, totalStrain,
119 tStep, VM_Incremental);
120 // subtract the initial strain to get the "net" strain increment,
121 // which is related to the stress increment
122 strainIncrement.beDifferenceOf(reducedStrain, status->giveStrainVector() );
123
124 // get the initial stress, or set it to zero if not available (first step)
125 //if ( status->giveStressVector().giveSize() ) {
126 // stressVector = status->giveStressVector();
127 if ( status->giveViscoelasticStressVector().giveSize() ) {
128 stressVector = status->giveViscoelasticStressVector();
129 } else {
130 stressVector.resize(strainIncrement.giveSize() );
131 stressVector.zero();
132 }
133
134
135 if ( ( !Material :: isActivated(tStep) ) && ( preCastingTimeMat > 0 ) ) {
136 StructuralMaterial *sMat = static_cast< StructuralMaterial * >( domain->giveMaterial(preCastingTimeMat) );
137 sMat->giveStiffnessMatrix(Binv, ElasticStiffness, gp, tStep);
138 } else {
139 // evaluate the incremental modulus
140 Emodulus = this->giveEModulus(gp, tStep);
141 // construct the unit stiffness matrix (depends on Poisson's ratio)
142 this->giveUnitStiffnessMatrix(Binv, gp, tStep);
143 // multiply the "net" strain increment by unit stiffness and by the incremental modulus
144 Binv.times(Emodulus);
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 if ( Material :: isActivated(tStep) ) {
158 // update the shrinkage strain if needed
160 FloatArray shv;
161 this->giveShrinkageStrainVector(shv, gp, tStep, VM_Total);
162 status->setShrinkageStrainVector(shv);
163 }
164 }
165
166 answer = stressVector;
167}
168
169
171RheoChainMaterial :: giveThermalDilatationVector(GaussPoint *gp, TimeStep *tStep) const
172//
173// returns a FloatArray(6) of initial strain vector
174// eps_0 = {exx_0, eyy_0, ezz_0, gyz_0, gxz_0, gxy_0}^T
175// caused by unit temperature in direction of
176// gp (element) local axes
177//
178{
179 MaterialMode mMode = gp->giveMaterialMode();
180 if ( mMode == _1dLattice || mMode == _2dLattice || mMode == _3dLattice ) {
181 return {
182 this->talpha, 0., 0., 0., 0., 0.
183 };
184 } else {
185 return {
186 talpha,
187 talpha,
188 talpha,
189 0.,
190 0.,
191 0.,
192 };
193 }
194}
195
196void
197RheoChainMaterial :: computeDiscreteRelaxationFunction(FloatArray &answer,
198 const FloatArray &tSteps,
199 double t0, double tr,
200 GaussPoint *gp, TimeStep *tStep) const
201{
202 int size = tSteps.giveSize();
203 int nsteps = size;
204 FloatArray deltaSigma(size);
205 answer.resize(size);
206 answer.zero();
207
208 double Jtrt0 = this->computeCreepFunction(t0 + tSteps.at(1), t0, gp, tStep);
209 double sig0 = 1. / Jtrt0;
210 answer.at(1) = sig0;
211 int si = 2;
212
213 double totalDeltaSigma = 0.;
214 for ( int k = si; k <= nsteps; k++ ) {
215 double sum = 0.;
216 for ( int i = si; i <= k - 1; i++ ) {
217 double taui;
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 double tauk;
230 if ( k == 1 ) {
231 // ??? it seems that tr plays no role because si=2 and the case
232 // i=1 or k=1 can never occur
233 tauk = 0.5 * ( t0 + tSteps.at(k) + tr );
234 } else {
235 tauk = t0 + 0.5 * ( tSteps.at(k) + tSteps.at(k - 1) );
236 }
237
238 deltaSigma.at(k) = ( sig0 * ( this->computeCreepFunction(t0 + tSteps.at(k), t0, gp, tStep) - Jtrt0 )
239 - sum ) / this->computeCreepFunction(t0 + tSteps.at(k), tauk, gp, tStep);
240
241 totalDeltaSigma += deltaSigma.at(k);
242 answer.at(k) = sig0 - totalDeltaSigma;
243 }
244}
245
246
248RheoChainMaterial :: generateLogTimeScale(double from, double to, int nsteps)
249{
250 FloatArray answer(nsteps);
251 double help = log(to / from) / nsteps;
252 for ( int i = 1; i <= nsteps; i++ ) {
253 answer.at(i) = exp(i * help) * from;
254 }
255 return answer;
256}
257
258
259const FloatArray &
260RheoChainMaterial :: giveDiscreteTimes() const
261{
262 return discreteTimeScale;
263}
264
265
266void
267RheoChainMaterial :: giveUnitStiffnessMatrix(FloatMatrix &answer,
268 GaussPoint *gp,
269 TimeStep *tStep) const
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->linearElasticMaterial->giveStiffnessMatrix(answer, ElasticStiffness, gp, tStep);
283}
284
285void
286RheoChainMaterial :: giveUnitComplianceMatrix(FloatMatrix &answer,
287 GaussPoint *gp,
288 TimeStep *tStep) const
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->linearElasticMaterial->giveStiffnessMatrix(tangent, ElasticStiffness, gp, tStep);
297 answer.beInverseOf(tangent);
298}
299
300
301
302double
303RheoChainMaterial :: giveEparModulus(int iChain) const
304{
305 /* returns the modulus of unit number iChain,
306 * previously computed by updateEparModuli() function
307 */
308 return EparVal.at(iChain);
309}
310
311
312void
313RheoChainMaterial :: updateEparModuli(double tPrime, GaussPoint *gp, TimeStep *tStep) const
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 - this->EparValTime) > TIME_DIFF ) {
333 this->EparVal = this->computeCharCoefficients(tPrime < 0 ? 1.e-3 : tPrime, gp, tStep);
334 this->EparValTime = tPrime;
335 }
336}
337
338
339void
340RheoChainMaterial :: computeTrueStressIndependentStrainVector(FloatArray &answer,
341 GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const
342//
343// computes the strain due to temperature and shrinkage effects
344// (it is called "true" because the "stress-independent strain"
345// will also contain the effect of creep)
346//
347{
348 if ( !Material :: isActivated(tStep) ) {
349 answer.zero();
350 return;
351 }
352
353 // shrinkage strain
354 this->giveShrinkageStrainVector(answer, gp, tStep, mode);
355
356 // thermally induced strain
357 auto e0 = StructuralMaterial :: computeStressIndependentStrainVector(gp, tStep, mode);
358 answer.add(e0);
359
360 if ( e0.giveSize() ) {
361#ifdef keep_track_of_strains
362 RheoChainMaterialStatus *status = static_cast< RheoChainMaterialStatus * >( this->giveStatus(gp) );
363 status->setTempThermalStrain(status->giveThermalStrain() + e0.at(1) );
364#endif
365 }
366}
367
368
370RheoChainMaterial :: computeStressIndependentStrainVector(GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const
371//
372// computes the strain due to temperature, shrinkage and creep effects
373// (it is the strain which would occur at the end of the step if the stress
374// during the step was held constant, so it is not really the part of strain
375// independent of stress, but independent of the stress increment)
376//
377// takes into account the form of the load vector assumed by engngModel (Incremental or Total Load form)
378//
379{
380 // strain due to temperature changes and shrinkage
381 FloatArray answer;
382 this->computeTrueStressIndependentStrainVector(answer, gp, tStep, mode);
383 // strain due to creep
384 if ( Material :: isActivated(tStep) ) {
385 FloatArray e0;
386 this->giveEigenStrainVector(e0, gp, tStep, mode);
387 if ( e0.giveSize() ) {
388 answer.add(e0);
389 }
390 }
391 return answer;
392}
393
394
395double
396RheoChainMaterial :: giveCharTime(int i) const
397{
398 return charTimes.at(i);
399}
400
401void
402RheoChainMaterial :: computeCharTimes()
403{
404 /*
405 * This function generates discrete characteristic times
406 * according to rules which guarantee a good approximation
407 * of the relaxation or creep function by the Dirichlet series
408 *
409 * Default value of the first relaxation time Tau(1) is chosen to be equal to 0.1 day.
410 * The last relaxation time Tau(n) is chosen as 1.0e30
411 * (to approximate very long processes).
412 * The second largest time Tau(n-1) is chosen as 0.75 tmax
413 * where tmax is the lifetime of structure or the end of the time of interest.
414 * Times Tau(2) .. Tau(n-2) are defined by uniform division to n-2 steps in the
415 * log scale. It is necessary to check the condition stepMultiplier <= 10, where Tau(k) = stepMultiplier Tau(k-1)
416 *
417 *
418 */
419
420 int size, nsteps;
421 double endTime, Taun1, Tau1, help;
422
423 double stepMultiplier = 10.;
424
425 endTime = this->giveEndOfTimeOfInterest() + relMatAge;
426 Taun1 = 0.75 * endTime;
427
428 if ( this->begOfTimeOfInterest == -1 ) {
429 this->begOfTimeOfInterest = 0.1; //default value
430 }
431
432 Tau1 = begOfTimeOfInterest;
433
434 if ( Tau1 <= 0 ) {
435 OOFEM_ERROR("begOfTimeOfInterest must be a positive number");
436 }
437
438 nsteps = ( int ) ( ( log(Taun1) - log(Tau1) ) / log(stepMultiplier) + 1. );
439 if ( nsteps < 8 ) {
440 nsteps = 8;
441 }
442
443 this->nUnits = size = nsteps + 2;
444
445 this->charTimes.resize(size);
446 this->charTimes.zero();
447
448 charTimes.at(1) = Tau1;
449 charTimes.at(size) = 1.0e10;
450 help = ( log(Taun1) - log(Tau1) ) / ( double ) nsteps;
451 for ( int i = 1; i <= nsteps; i++ ) {
452 charTimes.at(i + 1) = exp(log(Tau1) + help * i);
453 }
454}
455
456/*
457 * void
458 * RheoChainMaterial :: giveStiffnessMatrix(FloatMatrix &answer,
459 * MatResponseMode rMode,
460 * GaussPoint *gp, TimeStep *tStep)
461 * {
462 * //
463 * // Returns the incremental material stiffness matrix of the receiver
464 * // PH: the "giveEModulus must be called before any method on elastic material
465 * // otherwise the status would refer to the elastic material and not to the
466 * // viscoelastic one
467 * // in my opinion ElasticStiffness should return incremental stiffness and not unit stiffness
468 * // for this purpose use giveUnitStiffnessMatrix
469 * //
470 * this->giveStatus(gp); // Ensures correct status creation
471 * if ( ( !Material :: isActivated(tStep) ) && ( preCastingTimeMat > 0 ) ) {
472 * auto sMat = static_cast< StructuralMaterial * >( domain->giveMaterial(preCastingTimeMat) );
473 * sMat->giveStiffnessMatrix(answer, rMode, gp, tStep);
474 * // return sMat->give3dMaterialStiffnessMatrix(mode, gp, tStep);
475 * } else {
476 * this->giveLinearElasticMaterial()->giveStiffnessMatrix(answer, rMode, gp, tStep);
477 * double incrStiffness = this->giveEModulus(gp, tStep);
478 * answer.times(incrStiffness);
479 * //return incrStiffness * this->linearElasticMaterial->give3dMaterialStiffnessMatrix(mode, gp, tStep);
480 * }
481 * }
482 */
483
484
486RheoChainMaterial :: give3dMaterialStiffnessMatrix(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
487{
488 //
489 // Returns the incremental material stiffness matrix of the receiver
490 // PH: the "giveEModulus must be called before any method on elastic material
491 // otherwise the status would refer to the elastic material and not to the
492 // viscoelastic one
493 // in my opinion ElasticStiffness should return incremental stiffness and not unit stiffness
494 // for this purpose use giveUnitStiffnessMatrix
495 //
496 this->giveStatus(gp); // Ensures correct status creation
497 if ( ( !Material :: isActivated(tStep) ) && ( preCastingTimeMat > 0 ) ) {
498 auto sMat = static_cast< StructuralMaterial * >( domain->giveMaterial(preCastingTimeMat) );
499 return sMat->give3dMaterialStiffnessMatrix(mode, gp, tStep);
500 } else {
501 double incrStiffness = this->giveEModulus(gp, tStep);
502 return incrStiffness * this->linearElasticMaterial->give3dMaterialStiffnessMatrix(mode, gp, tStep);
503 }
504}
505
506
507
509RheoChainMaterial :: givePlaneStressStiffMtrx(MatResponseMode mode,
510 GaussPoint *gp,
511 TimeStep *tStep) const
512{
513 this->giveStatus(gp); // Ensures correct status creation
514 if ( ( !Material :: isActivated(tStep) ) && ( preCastingTimeMat > 0 ) ) {
515 auto sMat = static_cast< StructuralMaterial * >( domain->giveMaterial(preCastingTimeMat) );
516 return sMat->givePlaneStressStiffMtrx(mode, gp, tStep);
517 } else {
518 double incrStiffness = this->giveEModulus(gp, tStep);
519 return incrStiffness * this->linearElasticMaterial->givePlaneStressStiffMtrx(mode, gp, tStep);
520 }
521}
522
523
524
526RheoChainMaterial :: givePlaneStrainStiffMtrx(MatResponseMode mode,
527 GaussPoint *gp,
528 TimeStep *tStep) const
529{
530 this->giveStatus(gp); // Ensures correct status creation
531 if ( ( !Material :: isActivated(tStep) ) && ( preCastingTimeMat > 0 ) ) {
532 auto sMat = static_cast< StructuralMaterial * >( domain->giveMaterial(preCastingTimeMat) );
533 return sMat->givePlaneStrainStiffMtrx(mode, gp, tStep);
534 } else {
535 double incrStiffness = this->giveEModulus(gp, tStep);
536 return incrStiffness * this->linearElasticMaterial->givePlaneStrainStiffMtrx(mode, gp, tStep);
537 }
538}
539
540
541
543RheoChainMaterial :: give1dStressStiffMtrx(MatResponseMode mode,
544 GaussPoint *gp,
545 TimeStep *tStep) const
546{
547 this->giveStatus(gp); // Ensures correct status creation
548 if ( ( !Material :: isActivated(tStep) ) && ( preCastingTimeMat > 0 ) ) {
549 auto sMat = static_cast< StructuralMaterial * >( domain->giveMaterial(preCastingTimeMat) );
550 return sMat->give1dStressStiffMtrx(mode, gp, tStep);
551 } else {
552 double incrStiffness = this->giveEModulus(gp, tStep);
553 return incrStiffness * this->linearElasticMaterial->give1dStressStiffMtrx(mode, gp, tStep);
554 }
555}
556
557std::unique_ptr<MaterialStatus>
558RheoChainMaterial :: CreateStatus(GaussPoint *gp) const
559{
560 return std::make_unique<RheoChainMaterialStatus>(gp, nUnits);
561}
562
563
564void
565RheoChainMaterial :: initializeFrom(InputRecord &ir)
566{
567 StructuralMaterial :: initializeFrom(ir);
568
569 // if the casting time is not defined, we set it to zero such that it concides
570 // with the beginning of the computational time
572 this->castingTime = 0.;
573 }
574
575 this->talpha = 0.;
577
579 lattice = true;
580 this->alphaOne = 1.;
581 this->alphaTwo = 1.;
584 } else {
585 lattice = false;
587 }
588
590 this->begOfTimeOfInterest = -1.0;
592 this->endOfTimeOfInterest = -1.0;
594 IR_GIVE_FIELD(ir, timeFactor, _IFT_RheoChainMaterial_timefactor); // solution time/timeFactor should give time in days
595
596 // sets up nUnits variable and characteristic times array (retardation/relaxation times)
597 this->computeCharTimes();
598
599 // sets up discrete times
600 double endTime = this->giveEndOfTimeOfInterest();
602
605 //ph !!! why was it put here?
606 //this->updateEparModuli(0.); // stiffnesses are time independent (evaluated at time t = 0.)
607}
608
609//LinearElasticMaterial *
611RheoChainMaterial :: giveLinearElasticMaterial()
612{
613 if ( linearElasticMaterial == NULL ) {
614 if ( this->lattice ) {
616 this->giveDomain(),
617 1.0, this->alphaOne, this->alphaTwo);
618 } else {
620 this->giveDomain(),
621 1.0, this->nu);
622 }
623 }
624
626}
627
628double
629RheoChainMaterial :: giveEndOfTimeOfInterest()
630{
631 if ( this->endOfTimeOfInterest > 0.0 ) {
632 return this->endOfTimeOfInterest;
633 } else {
634 this->endOfTimeOfInterest = this->giveDomain()->giveEngngModel()->giveEndOfTimeOfInterest() / timeFactor;
635 }
636
637 return this->endOfTimeOfInterest;
638}
639
640void
641RheoChainMaterial :: saveIPContext(DataStream &stream, ContextMode mode, GaussPoint *gp)
642{
643 Material :: saveIPContext(stream, mode, gp);
644 giveLinearElasticMaterial()->saveIPContext(stream, mode, gp);
645}
646
647void
648RheoChainMaterial :: restoreIPContext(DataStream &stream, ContextMode mode, GaussPoint *gp)
649{
650 Material :: restoreIPContext(stream, mode, gp);
651 // invoke possible restoring of statuses for submaterials
652 giveLinearElasticMaterial()->restoreIPContext(stream, mode, gp);
653}
654
655
656int
657RheoChainMaterial :: giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
658{
659 if ( type == IST_ThermalStrainTensor ) {
660 RheoChainMaterialStatus *status = static_cast< RheoChainMaterialStatus * >( this->giveStatus(gp) );
661 answer.resize(6);
662 answer.zero();
663 answer.at(1) = answer.at(2) = answer.at(3) = status->giveThermalStrain();
664 return 1;
665 } else {
666 return StructuralMaterial :: giveIPValue(answer, gp, type, tStep);
667 }
668
669 // return 1; // to make the compiler happy
670}
671
672/****************************************************************************************/
673
674RheoChainMaterialStatus :: RheoChainMaterialStatus(GaussPoint *g, int nunits) :
676 nUnits(nunits),
679{}
680
681
682void
683RheoChainMaterialStatus :: letTempHiddenVarsVectorBe(int i, FloatArray &valueArray)
684{
685 // Sets the i:th hidden variables vector to valueArray.
686#ifdef DEBUG
687 if ( i > nUnits ) {
688 OOFEM_ERROR("unit number exceeds the specified limit");
689 }
690#endif
691 this->tempHiddenVars [ i - 1 ] = valueArray;
692}
693
694void
695RheoChainMaterialStatus :: printOutputAt(FILE *file, TimeStep *tStep) const
696{
697 // printing of hidden variables
698
699 StructuralMaterialStatus :: printOutputAt(file, tStep);
700
701 fprintf(file, "{hidden variables: ");
702 for ( int i = 0; i < nUnits; i++ ) {
703 fprintf(file, "{ ");
704 for ( auto &val : hiddenVars [ i ] ) {
705 fprintf(file, "%f ", val);
706 }
707
708 fprintf(file, "} ");
709 }
710
711 if ( shrinkageStrain.isNotEmpty() ) {
712 fprintf(file, "shrinkageStrain: {");
713 for ( auto &val : shrinkageStrain ) {
714 fprintf(file, "%f ", val);
715 }
716
717 fprintf(file, "} ");
718 }
719
720 fprintf(file, "}\n");
721}
722
723
724void
725RheoChainMaterialStatus :: updateYourself(TimeStep *tStep)
726{
727 StructuralMaterialStatus :: updateYourself(tStep);
728
729 for ( int i = 0; i < nUnits; i++ ) {
730 this->hiddenVars [ i ] = this->tempHiddenVars [ i ];
731 }
732
733 currentTime = -1.e20;
734
735#ifdef keep_track_of_strains
738#endif
739}
740
741void
742RheoChainMaterialStatus :: initTempStatus()
743{
744 StructuralMaterialStatus :: initTempStatus();
745
746#ifdef keep_track_of_strains
748#endif
749}
750
751void
752RheoChainMaterialStatus :: saveContext(DataStream &stream, ContextMode mode)
753{
754 StructuralMaterialStatus :: saveContext(stream, mode);
755
757 for ( int i = 0; i < nUnits; i++ ) {
758 if ( ( iores = hiddenVars [ i ].storeYourself(stream) ) != CIO_OK ) {
759 THROW_CIOERR(iores);
760 }
761 }
762
763 if ( ( iores = shrinkageStrain.storeYourself(stream) ) != CIO_OK ) {
764 THROW_CIOERR(iores);
765 }
766}
767
768
769void
770RheoChainMaterialStatus :: restoreContext(DataStream &stream, ContextMode mode)
771{
772 StructuralMaterialStatus :: restoreContext(stream, mode);
773
775 for ( int i = 0; i < nUnits; i++ ) {
776 if ( ( iores = hiddenVars [ i ].restoreYourself(stream) ) != CIO_OK ) {
777 THROW_CIOERR(iores);
778 }
779 }
780
781 if ( ( iores = shrinkageStrain.restoreYourself(stream) ) != CIO_OK ) {
782 THROW_CIOERR(iores);
783 }
784}
785} // end namespace oofem
Domain * giveDomain() const
Definition femcmpnn.h:97
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
int giveNumber() const
Definition femcmpnn.h:104
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
Index giveSize() const
Returns the size of receiver.
Definition floatarray.h:261
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Definition floatarray.C:403
void zero()
Zeroes all coefficients of receiver.
Definition floatarray.C:683
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Definition floatarray.C:689
void add(const FloatArray &src)
Definition floatarray.C:218
void times(double f)
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
double castingTime
Definition material.h:115
int preCastingTimeMat
Material existing before casting time - optional parameter, zero by default.
Definition material.h:118
virtual void initTempStatus(GaussPoint *gp) const
Definition material.C:221
double giveCurrentTime()
Returns current time - see explanation near initTempStatus in giveRealStressVector.
Definition rheoChM.h:112
int nUnits
Number of units in the chain.
Definition rheoChM.h:74
void setCurrentTime(double src)
Stores current time.
Definition rheoChM.h:114
void setTempThermalStrain(double src)
Definition rheoChM.h:124
void setShrinkageStrainVector(FloatArray src)
Definition rheoChM.h:109
std ::vector< FloatArray > hiddenVars
Hidden (internal) variables, the meaning of which depends on the type of chain.
Definition rheoChM.h:76
std ::vector< FloatArray > tempHiddenVars
Definition rheoChM.h:77
virtual const FloatArray & giveViscoelasticStressVector() const
Definition rheoChM.h:101
double talpha
thermal dilatation coeff.
Definition rheoChM.h:143
virtual double giveEModulus(GaussPoint *gp, TimeStep *tStep) const =0
Evaluation of the incremental modulus.
double giveEndOfTimeOfInterest()
Access to the time up to which the response should be accurate.
Definition rheoChM.C:629
StructuralMaterial * linearElasticMaterial
Associated linearElasticMaterial, with E = 1.
Definition rheoChM.h:163
bool isActivated(TimeStep *tStep) const override
Extended meaning: returns true if the material is cast (target time > casting time) or the precasing ...
Definition rheoChM.h:321
int nUnits
Number of (Maxwell or Kelvin) units in the rheologic chain.
Definition rheoChM.h:145
double relMatAge
Physical age of the material at castingTime.
Definition rheoChM.h:147
void giveUnitStiffnessMatrix(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep) const
Evaluation of elastic stiffness matrix for unit Young's modulus.
Definition rheoChM.C:267
virtual void giveShrinkageStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const
Definition rheoChM.h:292
double endOfTimeOfInterest
Time (age???) up to which the model should give a good approximation.
Definition rheoChM.h:160
FloatArray EparVal
Partial moduli of individual units.
Definition rheoChM.h:166
double begOfTimeOfInterest
Time from which the model should give a good approximation. Optional field. Default value is 0....
Definition rheoChM.h:158
virtual void computeCharTimes()
Evaluation of characteristic times.
Definition rheoChM.C:402
virtual double computeCreepFunction(double t, double t_prime, GaussPoint *gp, TimeStep *tStep) const =0
Evaluation of the creep compliance function at time t when loading is acting from time t_prime.
virtual FloatArray computeCharCoefficients(double tPrime, GaussPoint *gp, TimeStep *tStep) const =0
Evaluation of the moduli of individual units.
double EparValTime
Time for which the partial moduli of individual units have been evaluated.
Definition rheoChM.h:155
virtual bool hasIncrementalShrinkageFormulation() const
Definition rheoChM.h:339
virtual void giveEigenStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const
Definition rheoChM.h:307
FloatArray discreteTimeScale
Times at which the errors are evaluated if the least-square method is used.
Definition rheoChM.h:171
StructuralMaterial * giveLinearElasticMaterial()
Access to the underlying linear elastic material with unit Young's modulus.
Definition rheoChM.C:611
double alphaOne
Parameters for the lattice model.
Definition rheoChM.h:153
void computeTrueStressIndependentStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const
Definition rheoChM.C:340
FloatArray charTimes
Characteristic times of individual units (relaxation or retardation times).
Definition rheoChM.h:169
double nu
Poisson's ratio (assumed to be constant, unaffected by creep).
Definition rheoChM.h:151
static FloatArray generateLogTimeScale(double from, double to, int nsteps)
Definition rheoChM.C:248
const FloatArray & giveStrainVector() const
Returns the const pointer to receiver's strain vector.
StructuralMaterialStatus(GaussPoint *g)
Constructor. Creates new StructuralMaterialStatus with IntegrationPoint g.
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
StructuralMaterial(int n, Domain *d)
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
void giveStressDependentPartOfStrainVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode) const
#define THROW_CIOERR(e)
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define _IFT_Material_castingtime
Definition material.h:53
long ContextMode
Definition contextmode.h:43
double sum(const FloatArray &x)
FloatArrayF< N > zeros()
For more readable code.
#define _IFT_RheoChainMaterial_endoftimeofinterest
Definition rheoChM.h:58
#define _IFT_RheoChainMaterial_talpha
Definition rheoChM.h:60
#define _IFT_RheoChainMaterial_relmatage
Definition rheoChM.h:56
#define _IFT_RheoChainMaterial_lattice
Definition rheoChM.h:55
#define _IFT_RheoChainMaterial_alphaOne
Definition rheoChM.h:53
#define _IFT_RheoChainMaterial_n
Definition rheoChM.h:52
#define _IFT_RheoChainMaterial_begoftimeofinterest
Definition rheoChM.h:57
#define _IFT_RheoChainMaterial_timefactor
Definition rheoChM.h:59
#define _IFT_RheoChainMaterial_alphaTwo
Definition rheoChM.h:54
#define TIME_DIFF
Definition rheoChM.h:65
#define MNC_NPOINTS
Definition rheoChM.h:64

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011