OOFEM 3.0
Loading...
Searching...
No Matches
latticeslip.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 "latticeslip.h"
37#include "gausspoint.h"
38#include "floatmatrix.h"
39#include "floatarray.h"
41#include "engngm.h"
42#include "mathfem.h"
43#include "floatarrayf.h"
45#include "datastream.h"
46#include "staggeredproblem.h"
47#include "contextioerr.h"
48#include "classfactory.h"
49
50
51namespace oofem {
53
54LatticeSlip :: LatticeSlip(int n, Domain *d) : LatticeLinearElastic(n, d)
55{}
56
57
58bool
59LatticeSlip :: hasMaterialModeCapability(MaterialMode mode) const
60{
61 return ( mode == _3dLattice );
62}
63
64
65void
66LatticeSlip :: initializeFrom(InputRecord &ir)
67{
68 LatticeLinearElastic :: initializeFrom(ir);
69
70 //Parameter which relates the shear stiffness to the normal stiffness. Default is 1000. Reread this again, because the
71 alphaOne = 1000.;
73
74 //Parameter which is used for the definition of bending stiffness. Default is 1000.
75 alphaTwo = 1000.;
77
78 //Parameter which limits the stress in slip direction.
80}
81
82
83std::unique_ptr<MaterialStatus>
84LatticeSlip :: CreateStatus(GaussPoint *gp) const
85{
86 return std::make_unique<LatticeSlipStatus>(gp);
87}
88
89
91LatticeSlip :: giveLatticeStress3d(const FloatArrayF< 6 > &totalStrain, GaussPoint *gp, TimeStep *atTime)
92{
93 auto status = static_cast< LatticeSlipStatus * >( this->giveStatus(gp) );
94 status->initTempStatus();
95
96 auto tempPlasticStrain = status->givePlasticLatticeStrain();
97
98 auto stiffnessMatrix = this->give3dLatticeStiffnessMatrix(ElasticStiffness, gp, atTime);
99
100 /*First component is the slip one for which the stress should be limited using plasiticity (frictional slip between fibre and matrix). The other components are kept elastic. */
101 FloatArrayF<6> stress;
102
103 stress.at(1) = ( totalStrain.at(1) - tempPlasticStrain.at(1) ) * stiffnessMatrix.at(1, 1);
104 double f = fabs(stress.at(1) ) - tauZero;
105
106 if ( f > 0 ) {//plastic response.
107 //Reduced stress by increasing plastic strain.
108 tempPlasticStrain.at(1) = tempPlasticStrain.at(1) + sgn(stress.at(1) ) * f / stiffnessMatrix.at(1, 1);
109 stress.at(1) = ( totalStrain.at(1) - tempPlasticStrain.at(1) ) * stiffnessMatrix.at(1, 1);
110
111 status->setTempCrackFlag(1);
112 }
113
114 //Compute the final stress components
115 for ( int i = 2; i <= 6; i++ ) {
116 stress.at(i) = stiffnessMatrix.at(i, i) * totalStrain.at(i);
117 }
118
119 //Set temp values in status needed for dissipation
120 status->letTempPlasticLatticeStrainBe(tempPlasticStrain);
121 status->letTempLatticeStrainBe(totalStrain);
122 status->letTempLatticeStressBe(stress);
123
124 double tempDissipation = status->giveDissipation();
125 double tempDeltaDissipation;
126
127 tempDeltaDissipation = computeDeltaDissipation(gp, atTime);
128
129 tempDissipation += tempDeltaDissipation;
130
131 //Set all temp values
132 status->setTempDissipation(tempDissipation);
133 status->setTempDeltaDissipation(tempDeltaDissipation);
134
135 return stress;
136}
137
138
139Interface *
140LatticeSlip :: giveInterface(InterfaceType type)
141{
142 return nullptr;
143}
144
145
146LatticeSlipStatus :: LatticeSlipStatus(GaussPoint *g) : LatticeMaterialStatus(g)
147{}
148
149
150void
151LatticeSlipStatus :: initTempStatus()
152{
153 LatticeMaterialStatus :: initTempStatus();
155}
156
157
159LatticeSlip :: giveThermalDilatationVector(GaussPoint *gp, TimeStep *tStep) const
160//
161// returns a FloatArray(6) of initial strain vector
162// caused by unit temperature in direction of
163// gp (element) local axes
164//
165{
166 double alpha = this->give(tAlpha, gp);
167
168 //Option to add a eigendisplacement instead of strain
169 double length = static_cast< LatticeStructuralElement * >( gp->giveElement() )->giveLength();
170 alpha += this->cAlpha / length;
171
172 return {
173 alpha, 0., 0., 0., 0., 0.
174 };
175}
176
177void
178LatticeSlipStatus :: printOutputAt(FILE *file, TimeStep *tStep) const
179{
180 LatticeMaterialStatus :: printOutputAt(file, tStep);
181 fprintf(file, "plasticStrain %.8e, dissipation %f, deltaDissipation %f, crackFlag %d\n", this->plasticLatticeStrain.at(1), this->dissipation, this->deltaDissipation, this->crackFlag);
182}
183
184
185double
186LatticeSlip :: computeDeltaDissipation(GaussPoint *gp, TimeStep *atTime) const
187{
188 auto status = static_cast< LatticeSlipStatus * >( this->giveStatus(gp) );
189
190 const auto &plasticStrain = status->givePlasticLatticeStrain();
191 const auto &tempPlasticStrain = status->giveTempPlasticLatticeStrain();
192 const auto &tempStress = status->giveTempLatticeStress();
193
194 return tempStress.at(1) * ( tempPlasticStrain.at(1) - plasticStrain.at(1) );
195}
196
197
198void
199LatticeSlipStatus :: saveContext(DataStream &stream, ContextMode mode)
200//
201// saves full information stored in this Status
202// no temp variables stored
203//
204{
206 // save parent class status
207 LatticeMaterialStatus :: saveContext(stream, mode);
208
209 if ( ( iores = this->plasticLatticeStrain.storeYourself(stream) ) != CIO_OK ) {
210 THROW_CIOERR(iores);
211 }
212}
213
214
215void
216LatticeSlipStatus :: restoreContext(DataStream &stream, ContextMode mode)
217{
219
220 LatticeMaterialStatus :: restoreContext(stream, mode);
221
222 if ( ( iores = this->plasticLatticeStrain.restoreYourself(stream) ) != CIO_OK ) {
223 THROW_CIOERR(iores);
224 }
225}
226
227
228void
229LatticeSlipStatus :: updateYourself(TimeStep *atTime)
230{
231 LatticeMaterialStatus :: updateYourself(atTime);
233}
234
235
236
237int
238LatticeSlip :: giveIPValue(FloatArray &answer,
239 GaussPoint *gp,
241 TimeStep *atTime)
242{
243 auto status = static_cast< LatticeSlipStatus * >( this->giveStatus(gp) );
244
245 if ( type == IST_CrackStatuses ) {
246 answer.resize(1);
247 answer.zero();
248 answer.at(1) = status->giveCrackFlag();
249 return 1;
250 } else if ( type == IST_DissWork ) {
251 answer.resize(1);
252 answer.zero();
253 answer.at(1) = status->giveDissipation();
254 return 1;
255 } else if ( type == IST_DeltaDissWork ) {
256 answer.resize(1);
257 answer.zero();
258 answer.at(1) = status->giveDeltaDissipation();
259 return 1;
260 } else if ( type == IST_CharacteristicLength ) {
261 answer.resize(1);
262 answer.zero();
263 answer.at(1) = static_cast< LatticeStructuralElement * >( gp->giveElement() )->giveLength();
264 return 1;
265 } else {
266 return LatticeLinearElastic :: giveIPValue(answer, gp, type, atTime);
267 }
268}
269}
double length(const Vector &a)
Definition CSG.h:88
#define REGISTER_Material(class)
double & at(std::size_t i)
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
void zero()
Zeroes all coefficients of receiver.
Definition floatarray.C:683
Element * giveElement()
Returns corresponding element to receiver.
Definition gausspoint.h:187
double give(int aProperty, GaussPoint *gp) const override
MaterialStatus * giveStatus(GaussPoint *gp) const override
FloatMatrixF< 6, 6 > give3dLatticeStiffnessMatrix(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const override
FloatArrayF< 6 > plasticLatticeStrain
Equilibriated plastic lattice strain.
FloatArrayF< 6 > tempPlasticLatticeStrain
Non-equilibrated plastic lattice strain.
const FloatArrayF< 6 > & givePlasticLatticeStrain() const
Returns plastic lattice strain.
void initTempStatus() override
double computeDeltaDissipation(GaussPoint *gp, TimeStep *atTime) const
double alphaTwo
Ratio of torsion and normal modulus.
Definition latticeslip.h:90
double tauZero
Strength for slip component.
Definition latticeslip.h:93
double alphaOne
Ratio of shear and normal modulus.
Definition latticeslip.h:87
#define THROW_CIOERR(e)
#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_LatticeSlip_a2
Definition latticeslip.h:47
#define _IFT_LatticeSlip_a1
Definition latticeslip.h:46
#define _IFT_LatticeSlip_t0
Definition latticeslip.h:48
#define tAlpha
Definition matconst.h:67
long ContextMode
Definition contextmode.h:43
double sgn(double i)
Returns the signum of given value (if value is < 0 returns -1, otherwise returns 1).
Definition mathfem.h:104

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