OOFEM 3.0
Loading...
Searching...
No Matches
latticeviscoelastic.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 program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2 of the License, or
23 * (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
28 * GNU General Public License for more details.
29 *
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33 */
34
35#include "latticeviscoelastic.h"
36#include "gausspoint.h"
37#include "floatarray.h"
38#include "datastream.h"
39#include "contextioerr.h"
40#include "classfactory.h"
41
42namespace oofem {
44
47
48
49void
51{
53
54 IR_GIVE_FIELD(ir, viscoMat, _IFT_LatticeViscoelastic_viscoMat); // number of slave material
55
56 RheoChainMaterial *rheoMat = static_cast< RheoChainMaterial * >( domain->giveMaterial(this->viscoMat) );
57
58 // fix to work at arbitrary time units!
59 double E28 = 1. / rheoMat->computeCreepFunction(28.01, 28., NULL, NULL); // modulus of elasticity evaluated at 28 days, duration of loading 15 min
60 this->eNormalMean = E28; // swap elastic modulus/stiffness
61}
62
63
64std::unique_ptr<MaterialStatus>
66{
67 return std::make_unique<LatticeViscoelasticStatus>(gp);
68}
69
70
73 GaussPoint *gp,
74 TimeStep *tStep)
75{
76 auto status = static_cast< LatticeViscoelasticStatus * >( this->giveStatus(gp) );
77
78 RheoChainMaterial *rheoMat = static_cast< RheoChainMaterial * >( domain->giveMaterial(this->viscoMat) );
79
80 FloatArray viscoStress;
81 FloatArray partialStrain;
82
83 GaussPoint *rChGP = status->giveSlaveGaussPointVisco();
84 double Eincr = rheoMat->giveEModulus(rChGP, tStep);
85 this->eNormalMean = Eincr;
86
87 FloatArrayF< 6 >reducedStrainForViscoMat;
88 FloatArrayF< 6 >quasiTotalStrain;
89
90 FloatArray indepStrain;
91
92 FloatArrayF< 6 >tempStress;
93 reducedStrainForViscoMat = totalStrain;
94
95 indepStrain = this->computeStressIndependentStrainVector(gp, tStep, VM_Total);
96
97 if ( indepStrain.giveSize() > 0 ) {
98 reducedStrainForViscoMat -= FloatArrayF< 6 >(indepStrain);
99 }
100
101
102 rheoMat->giveRealStressVector(viscoStress, rChGP, reducedStrainForViscoMat, tStep);
103 tempStress = FloatArrayF< 6 >(viscoStress);
104
105
106 status->letTempLatticeStrainBe(totalStrain);
107 status->letTempLatticeStressBe(tempStress);
108
109 return tempStress;
110}
111
114
115{
116 LatticeViscoelasticStatus *status = static_cast< LatticeViscoelasticStatus * >( this->giveStatus(gp) );
117 GaussPoint *slaveGp;
118
119 // get status of the slave viscoelastic material
120 slaveGp = status->giveSlaveGaussPointVisco();
121 // get viscoelastic material
122 RheoChainMaterial *rheoMat = static_cast< RheoChainMaterial * >( domain->giveMaterial(this->viscoMat) );
123
124 auto answer = LatticeLinearElastic::give3dLatticeStiffnessMatrix(ElasticStiffness, gp, tStep);
125
126 double Eincr = rheoMat->giveEModulus(slaveGp, tStep);
127
128 answer *= ( Eincr / this->eNormalMean );
129
130 return answer;
131}
132
135{
136 LatticeViscoelasticStatus *status = static_cast< LatticeViscoelasticStatus * >( this->giveStatus(gp) );
137 GaussPoint *slaveGp;
138
139 // get status of the slave viscoelastic material
140 slaveGp = status->giveSlaveGaussPointVisco();
141 // get viscoelastic material
142 RheoChainMaterial *rheoMat = static_cast< RheoChainMaterial * >( domain->giveMaterial(this->viscoMat) );
143
144 auto answer = LatticeLinearElastic::give2dLatticeStiffnessMatrix(ElasticStiffness, gp, tStep);
145
146 double Eincr = rheoMat->giveEModulus(slaveGp, tStep);
147 answer *= ( Eincr / this->eNormalMean );
148
149 return answer;
150}
151
152
153int
155 GaussPoint *gp,
157 TimeStep *tStep)
158{
159 if ( ( type == IST_DryingShrinkageTensor ) ||
160 ( type == IST_AutogenousShrinkageTensor ) ||
161 ( type == IST_TotalShrinkageTensor ) ||
162 ( type == IST_CreepStrainTensor ) ||
163 ( type == IST_DryingShrinkageTensor ) ||
164 ( type == IST_ThermalStrainTensor ) ) {
165 LatticeViscoelasticStatus *status = static_cast< LatticeViscoelasticStatus * >( this->giveStatus(gp) );
166 RheoChainMaterial *rheoMat = static_cast< RheoChainMaterial * >( domain->giveMaterial(this->viscoMat) );
167 return rheoMat->giveIPValue(answer, status->giveSlaveGaussPointVisco(), type, tStep);
168 }
169
170 return LatticeLinearElastic::giveIPValue(answer, gp, type, tStep);
171}
172
173
174
176{
177 RheoChainMaterial *rheoMat = static_cast< RheoChainMaterial * >( domain->giveMaterial(this->viscoMat) );
178
179
180 if ( rheoMat->giveAlphaOne() != this->alphaOne ) {
181 OOFEM_ERROR("a1 must be set to the same value in both master and viscoelastic slave materials");
182 }
183
184 if ( rheoMat->giveAlphaTwo() != this->alphaTwo ) {
185 OOFEM_ERROR("a2 must be set to the same value in both master and viscoelastic slave materials");
186 }
187
188
190}
191
192
193
194
195
198 slaveGpVisco( std::make_unique< GaussPoint >( gp->giveIntegrationRule(), 0, gp->giveNaturalCoordinates(), 0., gp->giveMaterialMode() ) )
199 // slaveGpVisco(std::make_unique<GaussPoint>( gp->giveIntegrationRule(), 0, gp->giveNaturalCoordinates(), 0., gp->giveMaterialMode()) )
200
201
202{}
203
204void
206//
207// initializes temp variables according to variables form previous equlibrium state.
208// builds new crackMap
209//
210{
212
214 rheoStatus->initTempStatus();
215}
216
217void
219{
220 // MaterialStatus *mS = this->giveViscoelasticMatStatus();
221
223 fprintf(file, "\nViscoelastic material:");
224
225 //this->slaveGpVisco->giveMaterialStatus()->printOutputAt(file, tStep);
227
228 fprintf(file, "\n");
229}
230
231void
233//
234// updates variables (nonTemp variables describing situation at previous equilibrium state)
235// after a new equilibrium state has been reached
236// temporary variables are having values corresponding to newly reached equilibrium.
237//
238{
239 // this->slaveGpVisco->giveMaterialStatus()->updateYourself(tStep);
241
243}
244
245void
247//
248// saves full information stored in this Status
249// no temp variables stored
250//
251{
252 // save parent class status
254
255 // this->slaveGpVisco->giveMaterialStatus()->saveContext(stream, mode);
257}
258
259void
261//
262// restores full information stored in stream to this Status
263//
264{
266
267 // this->slaveGpVisco->giveMaterialStatus()->restoreContext(stream, mode);
269}
270} // end namespace oofem
#define REGISTER_Material(class)
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
virtual int checkConsistency()
Definition femcmpnn.C:89
Index giveSize() const
Returns the size of receiver.
Definition floatarray.h:261
IntegrationPointStatus * giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default)
Definition gausspoint.h:204
virtual void printOutputAt(FILE *file, TimeStep *tStep) const
Print receiver's output to given stream.
virtual void restoreContext(DataStream &stream, ContextMode mode)
GaussPoint * gp
Associated integration point.
virtual void saveContext(DataStream &stream, ContextMode mode)
virtual void updateYourself(TimeStep *)
FloatMatrixF< 3, 3 > give2dLatticeStiffnessMatrix(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const override
void initializeFrom(InputRecord &ir) override
double eNormalMean
Normal modulus.
MaterialStatus * giveStatus(GaussPoint *gp) const override
FloatMatrixF< 6, 6 > give3dLatticeStiffnessMatrix(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const override
void saveContext(DataStream &stream, ContextMode mode) override
void updateYourself(TimeStep *) override
void restoreContext(DataStream &stream, ContextMode mode) override
void printOutputAt(FILE *file, TimeStep *tStep) const override
Print receiver's output to given stream.
LatticeViscoelasticStatus(GaussPoint *g)
Constructor.
void updateYourself(TimeStep *) override
void restoreContext(DataStream &stream, ContextMode mode) override
void printOutputAt(FILE *file, TimeStep *tStep) const override
Prints the receiver state to given stream.
void saveContext(DataStream &stream, ContextMode mode) override
std ::unique_ptr< GaussPoint > slaveGpVisco
GaussPoint * giveSlaveGaussPointVisco() const
FloatMatrixF< 6, 6 > give3dLatticeStiffnessMatrix(MatResponseMode rmode, GaussPoint *gp, TimeStep *atTime) const override
int viscoMat
'slave' material model number.
void initializeFrom(InputRecord &ir) override
LatticeViscoelastic(int n, Domain *d)
Constructor.
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *atTime) override
FloatMatrixF< 3, 3 > give2dLatticeStiffnessMatrix(MatResponseMode rmode, GaussPoint *gp, TimeStep *atTime) const override
int checkConsistency(void) override
FloatArrayF< 6 > giveLatticeStress3d(const FloatArrayF< 6 > &totalStrain, GaussPoint *gp, TimeStep *tStep) override
std::unique_ptr< MaterialStatus > CreateStatus(GaussPoint *gp) const override
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Definition material.C:138
void initTempStatus() override
Definition rheoChM.C:742
virtual double giveEModulus(GaussPoint *gp, TimeStep *tStep) const =0
Evaluation of the incremental modulus.
double giveAlphaTwo() const
Definition rheoChM.h:312
void giveRealStressVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep) const override
Definition rheoChM.C:72
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.
double giveAlphaOne() const
Definition rheoChM.h:311
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override
Definition rheoChM.C:657
virtual FloatArray computeStressIndependentStrainVector(GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define _IFT_LatticeViscoelastic_viscoMat
long ContextMode
Definition contextmode.h:43

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