OOFEM 3.0
Loading...
Searching...
No Matches
trabbonegrad3d.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
36#include "trabbonegrad3d.h"
37#include "gausspoint.h"
38#include "floatmatrix.h"
39#include "floatarray.h"
40#include "mathfem.h"
41#include "error.h"
42#include "classfactory.h"
43
44
45namespace oofem {
47
48TrabBoneGrad3D :: TrabBoneGrad3D(int n, Domain *d) : TrabBone3D(n, d), GradientDamageMaterialExtensionInterface(d)
49{
50}
51
52bool
53TrabBoneGrad3D :: hasMaterialModeCapability(MaterialMode mode) const
54{
55 return mode == _3dMat;
56}
57void
58TrabBoneGrad3D :: giveStiffnessMatrix(FloatMatrix &answer,
59 MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
60//
61// Returns characteristic material stiffness matrix of the receiver
62//
63{
64 OOFEM_ERROR("Shouldn't be called");
65}
66
67void
68TrabBoneGrad3D :: giveGradientDamageStiffnessMatrix_uu(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
69{
70 MaterialMode mMode = gp->giveMaterialMode();
71 switch ( mMode ) {
72 case _3dMat:
73 answer = give3dMaterialStiffnessMatrix(mode, gp, tStep);
74 break;
75 default:
76 OOFEM_ERROR( "givePDGradMatrix_uu : unknown mode (%s)", __MaterialModeToString(mMode) );
77 }
78}
79
80void
81TrabBoneGrad3D :: giveGradientDamageStiffnessMatrix_du(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
82{
83 MaterialMode mMode = gp->giveMaterialMode();
84 switch ( mMode ) {
85 case _3dMat:
86 give3dKappaMatrix(answer, mode, gp, tStep);
87 break;
88 default:
89 OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
90 }
91}
92
93void
94TrabBoneGrad3D :: giveGradientDamageStiffnessMatrix_ud(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
95{
96 MaterialMode mMode = gp->giveMaterialMode();
97 switch ( mMode ) {
98 case _3dMat:
99 give3dGprime(answer, mode, gp, tStep);
100 break;
101 default:
102 OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
103 }
104}
105
106
107void
108TrabBoneGrad3D :: giveGradientDamageStiffnessMatrix_dd_BB(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
109{
110 MaterialMode mMode = gp->giveMaterialMode();
111 switch ( mMode ) {
112 case _3dMat:
113 giveInternalLength(answer, mode, gp, tStep);
114 break;
115 default:
116 OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
117 }
118}
119
120void
121TrabBoneGrad3D :: giveNonlocalInternalForces_N_factor(double &answer, double nlDamageDrivingVariable, GaussPoint *gp, TimeStep *tStep)
122{
123 answer = nlDamageDrivingVariable;
124}
125
126void
127TrabBoneGrad3D :: giveNonlocalInternalForces_B_factor(FloatArray &answer, const FloatArray &nlDamageDrivingVariable_grad, GaussPoint *gp, TimeStep *tStep)
128{
129 answer = nlDamageDrivingVariable_grad;
131}
132
133
134void
135TrabBoneGrad3D :: computeLocalDamageDrivingVariable(double &answer, GaussPoint *gp, TimeStep *tStep)
136{
137 auto status = static_cast< TrabBoneGrad3DStatus * >( this->giveStatus(gp) );
138 answer = status->giveTempKappa();
139}
140
141
143TrabBoneGrad3D :: give3dMaterialStiffnessMatrix(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
144{
145 auto status = static_cast< TrabBoneGrad3DStatus * >( this->giveStatus(gp) );
146 FloatMatrixF<6,6> answer;
147 if ( mode == ElasticStiffness ) {
148 auto compliance = this->constructAnisoComplTensor();
149 auto elasticity = inv(compliance);
150 answer = elasticity;
151 } else if ( mode == SecantStiffness ) {
152 if ( printflag ) {
153 printf("secant\n");
154 }
155
156 auto compliance = this->constructAnisoComplTensor();
157 auto elasticity = inv(compliance);
158 auto tempDam = status->giveTempDam();
159 answer = elasticity * (1.0 - tempDam);
160 } else if ( mode == TangentStiffness ) {
161 double kappa = status->giveKappa();
162 double tempKappa = status->giveTempKappa();
163 double tempDam = status->giveTempDam();
164 if ( tempKappa > kappa ) {
165 // plastic loading
166 // Imports
167 auto &tempEffectiveStress = status->giveTempEffectiveStress();
168 auto &plasFlowDirec = status->givePlasFlowDirec();
169 auto &SSaTensor = status->giveSSaTensor();
170 auto beta = status->giveBeta();
171 // Construction of the dyadic product tensor
172 auto prodTensor = Tdot(SSaTensor, plasFlowDirec);
173 // Construction of the tangent stiffness second term
174 auto tempTensor2 = dot(SSaTensor, plasFlowDirec);
175 auto secondTerm = dyad(tempTensor2, prodTensor) * (-( 1.0 - tempDam ) / beta);
176 // Construction of the tangent stiffness
177 auto tangentMatrix = SSaTensor * (1.0 - tempDam) + secondTerm;
178 if ( tempDam > status->giveDam() ) {
179 double nlKappa = status->giveNonlocalCumulatedStrain();
180 double kappa = mParam * nlKappa + ( 1. - mParam ) * tempKappa;
181 double gPrime = TrabBone3D :: computeDamageParamPrime(kappa);
182 // Construction of the tangent stiffness third term
183 auto thirdTerm = dyad(tempEffectiveStress, prodTensor) * gPrime * ( ( 1. - mParam ) / beta );
184 tangentMatrix += thirdTerm;
185 }
186
187 answer = tangentMatrix;
188 } else {
189 // elastic behavior with damage
190 // Construction of the secant stiffness
191 auto compliance = this->constructAnisoComplTensor();
192 auto elasticity = inv(compliance);
193 answer = elasticity * (1.0 - tempDam);
194 }
195 }
196
197 double g = status->giveDensG();
198 if ( g <= 0 ) {
199 double factor = gammaL0 * pow(rho, rL) + gammaP0 *pow(rho, rP) * ( tDens - 1 ) * pow(g, tDens - 2);
200 answer += I6_I6 * factor;
201 }
202 return answer;
203}
204
205
206
207
208void
209TrabBoneGrad3D :: give3dKappaMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
210{
211 answer.resize(1, 6);
212 answer.zero();
213 if ( mode == TangentStiffness ) {
214 auto status = static_cast< TrabBoneGrad3DStatus * >( this->giveStatus(gp) );
215
216 double kappa = status->giveKappa();
217 double tempKappa = status->giveTempKappa();
218 double dKappa = tempKappa - kappa;
219
220 if ( dKappa > 0.0 ) {
221 auto &plasFlowDirec = status->givePlasFlowDirec();
222 auto &SSaTensor = status->giveSSaTensor();
223 double beta = status->giveBeta();
224 auto prodTensor = Tdot(SSaTensor, plasFlowDirec);
225 for ( int i = 1; i <= 6; i++ ) {
226 answer.at(1, i) = prodTensor.at(i);
227 }
228
229 answer.times(1. / beta);
230 }
231 }
232}
233
234
235
236void
237TrabBoneGrad3D :: give3dGprime(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
238{
239 answer.resize(6, 1);
240 answer.zero();
241 if ( mode == TangentStiffness ) {
242 auto status = static_cast< TrabBoneGrad3DStatus * >( this->giveStatus(gp) );
243 double tempKappa = status->giveTempKappa();
244 double damage = status->giveDam();
245 double nlKappa = status->giveNonlocalCumulatedStrain();
246 double kappa = mParam * nlKappa + ( 1. - mParam ) * tempKappa;
247 double tempDamage = TrabBone3D :: computeDamageParam(kappa);
248
249 if ( ( tempDamage - damage ) > 0 ) {
250 auto &tempEffStress = status->giveTempEffectiveStress();
251 for ( int i = 1; i <= 6; i++ ) {
252 answer.at(i, 1) = tempEffStress.at(i);
253 }
254
255 double kappa = mParam * nlKappa + ( 1. - mParam ) * tempKappa;
256 double gPrime = TrabBone3D :: computeDamageParamPrime(kappa);
257 answer.times(gPrime * mParam);
258 }
259 }
260}
261
262void
263TrabBoneGrad3D :: giveInternalLength(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
264{
265 answer.resize(1, 1);
266 answer.at(1, 1) = L;
267}
268
269void
270TrabBoneGrad3D :: giveRealStressVectorGradientDamage(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalCumulatedStrain, TimeStep *tStep)
271{
272 auto status = static_cast< TrabBoneGrad3DStatus * >( this->giveStatus(gp) );
273
274 this->initTempStatus(gp);
275
276 TrabBone3D :: performPlasticityReturn(gp, totalStrain, tStep);
277
278 double tempDamage = computeDamage(gp, tStep);
279 auto tempEffStress = status->giveTempEffectiveStress();
280 answer1 = (1 - tempDamage) * tempEffStress;
281 answer2 = status->giveTempKappa();
282
283 if ( densCrit != 0 ) {
284 answer1.add(computeDensificationStress(gp, totalStrain, tStep));
285 }
286
287 status->letTempStrainVectorBe(totalStrain);
288 status->setNonlocalCumulatedStrain(nonlocalCumulatedStrain);
289
290 status->setTempDam(tempDamage);
291 status->setTempEffectiveStress(tempEffStress);
292 status->letTempStressVectorBe(answer1);
293}
294
295
296double
297TrabBoneGrad3D :: computeCumPlastStrain(GaussPoint *gp, TimeStep *tStep) const
298{
299 auto status = static_cast< TrabBoneGrad3DStatus * >( this->giveStatus(gp) );
300 double localCumPlastStrain = status->giveTempKappa();
301 double nlCumPlastStrain = status->giveNonlocalCumulatedStrain();
302 return mParam * nlCumPlastStrain + ( 1 - mParam ) * localCumPlastStrain;
303}
304
305
306void
307TrabBoneGrad3D :: initializeFrom(InputRecord &ir)
308{
309 TrabBone3D :: initializeFrom(ir);
310
312 if ( L < 0.0 ) {
313 L = 0.0;
314 }
315
316 mParam = 2.;
318}
319
320
321TrabBoneGrad3DStatus :: TrabBoneGrad3DStatus(GaussPoint *g) :
323{}
324
325
326void
327TrabBoneGrad3DStatus :: printOutputAt(FILE *file, TimeStep *tStep) const
328{
329 TrabBone3DStatus :: printOutputAt(file, tStep);
330}
331
332
333void
334TrabBoneGrad3DStatus :: initTempStatus()
335{
336 TrabBone3DStatus :: initTempStatus();
337}
338
339
340void
341TrabBoneGrad3DStatus :: updateYourself(TimeStep *tStep)
342{
343 StructuralMaterialStatus :: updateYourself(tStep);
344 this->kappa = this->tempKappa;
345 this->dam = this->tempDam;
346 this->tsed = this->tempTSED;
347 this->plasDef = this->tempPlasDef;
348 //TrabBone3DStatus :: updateYourself(tStep);
349}
350} // end namespace oofem
#define REGISTER_Material(class)
void add(const FloatArray &src)
Definition floatarray.C:218
void times(double s)
Definition floatarray.C:834
void times(double f)
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
void zero()
Zeroes all coefficient of receiver.
double at(std::size_t i, std::size_t j) const
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition gausspoint.h:190
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
virtual void initTempStatus(GaussPoint *gp) const
Definition material.C:221
FloatArrayF< 6 > plasDef
Definition trabbone3d.h:111
FloatArrayF< 6 > tempPlasDef
Definition trabbone3d.h:111
double giveTempKappa() const
Definition trabbone3d.h:126
TrabBone3DStatus(GaussPoint *g)
Definition trabbone3d.C:979
double giveKappa() const
Definition trabbone3d.h:125
FloatMatrixF< 6, 6 > constructAnisoComplTensor() const
Construct anisotropic compliance tensor.
Definition trabbone3d.C:580
TrabBone3D(int n, Domain *d)
Definition trabbone3d.C:50
double gammaL0
Densificator properties.
Definition trabbone3d.h:188
double computeDamage(GaussPoint *gp, TimeStep *tStep) const
Definition trabbone3d.C:510
FloatArrayF< 6 > computeDensificationStress(GaussPoint *gp, const FloatArrayF< 6 > &totalStrain, TimeStep *tStep) const
Definition trabbone3d.C:530
FloatMatrixF< 6, 6 > give3dMaterialStiffnessMatrix(MatResponseMode, GaussPoint *gp, TimeStep *tStep) const override
void give3dKappaMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
void give3dGprime(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
void giveInternalLength(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
FloatMatrixF< N, P > Tdot(const FloatMatrixF< M, N > &a, const FloatMatrixF< M, P > &b)
Computes .
FloatMatrixF< N, M > dyad(const FloatArrayF< N > &a, const FloatArrayF< M > &b)
Computes the dyadic product .
const FloatMatrixF< 6, 6 > I6_I6
I(x)I expressed in Voigt form.
double dot(const FloatArray &x, const FloatArray &y)
FloatMatrixF< N, N > inv(const FloatMatrixF< N, N > &mat, double zeropiv=1e-24)
Computes the inverse.
#define _IFT_TrabBoneGrad3D_m
#define _IFT_TrabBoneGrad3D_L

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