OOFEM 3.0
Loading...
Searching...
No Matches
lsmastermatgrad.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 "lsmastermatgrad.h"
37#include "gausspoint.h"
38#include "floatmatrix.h"
39#include "floatarray.h"
40#include "intarray.h"
41#include "stressvector.h"
42#include "strainvector.h"
43#include "mathfem.h"
44#include "contextioerr.h"
45#include "datastream.h"
46#include "classfactory.h"
47
48namespace oofem {
50
51// constructor
52LargeStrainMasterMaterialGrad :: LargeStrainMasterMaterialGrad(int n, Domain *d) : LargeStrainMasterMaterial(n, d), GradientDamageMaterialExtensionInterface(d)
53{
54}
55
56
57// specifies whether a given material mode is supported by this model
58bool
59LargeStrainMasterMaterialGrad :: hasMaterialModeCapability(MaterialMode mode) const
60{
61 return mode == _3dMat;
62}
63
64// creates a new material status corresponding to this class
65std::unique_ptr<MaterialStatus>
66LargeStrainMasterMaterialGrad :: CreateStatus(GaussPoint *gp) const
67{
68 return std::make_unique<LargeStrainMasterMaterialStatus>(gp, this->giveDomain(), slaveMat);
69}
70
71
72void
73LargeStrainMasterMaterialGrad :: giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
74//
75// Returns characteristic material stiffness matrix of the receiver
76//
77{
78 OOFEM_ERROR("shouldn't be called");
79}
80
81
82void
83LargeStrainMasterMaterialGrad :: giveGradientDamageStiffnessMatrix_uu(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
84{
85 MaterialMode mMode = gp->giveMaterialMode();
86 switch ( mMode ) {
87 case _3dMat:
88 answer = LargeStrainMasterMaterial :: give3dMaterialStiffnessMatrix(mode, gp, tStep);
89 break;
90 default:
91 OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
92 }
93}
94
95void
96LargeStrainMasterMaterialGrad :: giveGradientDamageStiffnessMatrix_du(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
97{
98 MaterialMode mMode = gp->giveMaterialMode();
99 switch ( mMode ) {
100 case _3dMat:
101 give3dKappaMatrix(answer, mode, gp, tStep);
102 break;
103 default:
104 OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
105 }
106}
107
108void
109LargeStrainMasterMaterialGrad :: giveGradientDamageStiffnessMatrix_ud(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
110{
111 MaterialMode mMode = gp->giveMaterialMode();
112 switch ( mMode ) {
113 case _3dMat:
114 give3dGprime(answer, mode, gp, tStep);
115 break;
116 default:
117 OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
118 }
119}
120
121
122void
123LargeStrainMasterMaterialGrad :: giveGradientDamageStiffnessMatrix_dd_BB(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
124{}
125
126
127void
128LargeStrainMasterMaterialGrad :: give3dGprime(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
129{
130 LargeStrainMasterMaterialStatus *status = static_cast< LargeStrainMasterMaterialStatus * >( this->giveStatus(gp) );
131 this->initTempStatus(gp);
132 FloatMatrix gPrime;
134 if ( graddpmat == NULL ) {
135 OOFEM_WARNING("material %d has no Structural support", slaveMat);
136 return;
137 }
138
139 graddpmat->giveGradientDamageStiffnessMatrix_ud(gPrime, mode, gp, tStep);
140 gPrime.at(4, 1) = 2. * gPrime.at(4, 1);
141 gPrime.at(5, 1) = 2. * gPrime.at(5, 1);
142 gPrime.at(6, 1) = 2. * gPrime.at(6, 1);
143 answer.beProductOf(status->givePmatrix(), gPrime);
144}
145
146
147void
148LargeStrainMasterMaterialGrad :: give3dKappaMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
149{
150 LargeStrainMasterMaterialStatus *status = static_cast< LargeStrainMasterMaterialStatus * >( this->giveStatus(gp) );
151 this->initTempStatus(gp);
152 FloatMatrix kappaMatrix;
154 if ( graddpmat == NULL ) {
155 OOFEM_WARNING("material %d has no Structural support", slaveMat);
156 return;
157 }
158
159 graddpmat->giveGradientDamageStiffnessMatrix_du(kappaMatrix, mode, gp, tStep);
160 kappaMatrix.at(1, 4) = 2. * kappaMatrix.at(1, 4);
161 kappaMatrix.at(1, 5) = 2. * kappaMatrix.at(1, 5);
162 kappaMatrix.at(1, 6) = 2. * kappaMatrix.at(1, 6);
163 answer.beProductTOf( kappaMatrix, status->givePmatrix() );
164}
165
166
167
168
169void
170LargeStrainMasterMaterialGrad :: giveNonlocalInternalForces_N_factor(double &answer, double nlDamageDrivingVariable, GaussPoint *gp, TimeStep *tStep)
171{
172 answer = nlDamageDrivingVariable;
173}
174
175void
176LargeStrainMasterMaterialGrad :: giveNonlocalInternalForces_B_factor(FloatArray &answer, const FloatArray &nlDamageDrivingVariable_grad, GaussPoint *gp, TimeStep *tStep)
177{
178 answer = nlDamageDrivingVariable_grad;
180}
181
182
183void
184LargeStrainMasterMaterialGrad :: computeLocalDamageDrivingVariable(double &answer, GaussPoint *gp, TimeStep *tStep)
185{
186 // LargeStrainMasterMaterialStatus *status = static_cast< LargeStrainMasterMaterialStatus * >( this->giveStatus(gp) );
187 // @todo: solve this
188 // answer = status->giveTempKappa();w
189 answer = 1;
190}
191
192void
193LargeStrainMasterMaterialGrad :: giveFirstPKStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &vF, double nonlocalCumulatedStrain, TimeStep *tStep)
194{
195 LargeStrainMasterMaterialStatus *status = static_cast< LargeStrainMasterMaterialStatus * >( this->giveStatus(gp) );
196 this->initTempStatus(gp);
197 MaterialMode mode = gp->giveMaterialMode();
198 if ( mode == _3dMat ) {
199 Material *mat;
200 StructuralMaterial *sMat;
201 mat = domain->giveMaterial(slaveMat);
202 sMat = dynamic_cast< StructuralMaterial * >(mat);
203 if ( sMat == NULL ) {
204 OOFEM_WARNING("material %d has no Structural support", slaveMat);
205 return;
206 }
207
209 if ( !dpmat ) {
210 OOFEM_ERROR("Material doesn't implement the required DpGrad interface!");
211 }
212
213
214 double lambda1, lambda2, lambda3, E1, E2, E3;
215 FloatArray eVals, SethHillStrainVector, stressVector, stressM;
216 FloatMatrix F, C, eVecs, SethHillStrain;
217 FloatMatrix L1, L2, T;
218 //store of deformation gradient into 3x3 matrix
219 F.beMatrixForm(vF);
220 //compute right Cauchy-Green tensor(C), its eigenvalues and eigenvectors
221 C.beTProductOf(F, F);
222 // compute eigen values and eigen vectors of C
223 C.jaco_(eVals, eVecs, 40);
224 // compute Seth - Hill's strain measure, it depends on mParameter
225 lambda1 = eVals.at(1);
226 lambda2 = eVals.at(2);
227 lambda3 = eVals.at(3);
228 if ( m == 0 ) {
229 E1 = 1. / 2. * log(lambda1);
230 E2 = 1. / 2. * log(lambda2);
231 E3 = 1. / 2. * log(lambda3);
232 } else {
233 E1 = 1. / ( 2. * m ) * ( pow(lambda1, m) - 1. );
234 E2 = 1. / ( 2. * m ) * ( pow(lambda2, m) - 1. );
235 E3 = 1. / ( 2. * m ) * ( pow(lambda3, m) - 1. );
236 }
237
238 SethHillStrain.resize(3, 3);
239 for ( int i = 1; i < 4; i++ ) {
240 for ( int j = 1; j < 4; j++ ) {
241 SethHillStrain.at(i, j) = E1 * eVecs.at(i, 1) * eVecs.at(j, 1) + E2 *eVecs.at(i, 2) * eVecs.at(j, 2) + E3 *eVecs.at(i, 3) * eVecs.at(j, 3);
242 }
243 }
244
245
246
247 SethHillStrainVector.beSymVectorFormOfStrain(SethHillStrain);
248 dpmat->giveRealStressVectorGradientDamage(stressVector, answer2, gp, SethHillStrainVector, nonlocalCumulatedStrain, tStep);
249 // this->constructTransformationMatrix(T, eVecs);
250
251 stressVector.at(4) = 2 * stressVector.at(4);
252 stressVector.at(5) = 2 * stressVector.at(5);
253 stressVector.at(6) = 2 * stressVector.at(6);
254
255
256 stressM.beProductOf(T, stressVector);
257 stressM.at(4) = 1. / 2. * stressM.at(4);
258 stressM.at(5) = 1. / 2. * stressM.at(5);
259 stressM.at(6) = 1. / 2. * stressM.at(6);
260
261 // this->constructL1L2TransformationMatrices(L1, L2, eVals, stressM, E1, E2, E3);
262
263 FloatMatrix junk, P, TL;
264 FloatArray secondPK;
265 junk.beProductOf(L1, T);
266 P.beTProductOf(T, junk);
267 //transformation of the stress to the 2PK stress and then to 1PK
268 stressVector.at(4) = 0.5 * stressVector.at(4);
269 stressVector.at(5) = 0.5 * stressVector.at(5);
270 stressVector.at(6) = 0.5 * stressVector.at(6);
271 secondPK.beProductOf(P, stressVector);
272 answer1.beProductOf(F, secondPK); // P = F*S
273 junk.zero();
274 junk.beProductOf(L2, T);
275 TL.beTProductOf(T, junk);
276
277 status->setPmatrix(P);
278 status->setTLmatrix(TL);
279 status->letTempStressVectorBe(answer1);
280 } else {
281 OOFEM_ERROR("Unknown material mode.");
282 }
283}
284
285
286void
287LargeStrainMasterMaterialGrad :: initializeFrom(InputRecord &ir)
288{
289 LargeStrainMasterMaterial :: initializeFrom(ir);
290}
291} // end namespace oofem
#define REGISTER_Material(class)
Domain * giveDomain() const
Definition femcmpnn.h:97
virtual Interface * giveInterface(InterfaceType t)
Definition femcmpnn.h:181
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
double & at(Index i)
Definition floatarray.h:202
void beSymVectorFormOfStrain(const FloatMatrix &aMatrix)
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Definition floatarray.C:689
void times(double s)
Definition floatarray.C:834
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
void beProductTOf(const FloatMatrix &a, const FloatMatrix &b)
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
bool jaco_(FloatArray &eval, FloatMatrix &v, int nf)
void zero()
Zeroes all coefficient of receiver.
void beMatrixForm(const FloatArray &aArray)
double at(std::size_t i, std::size_t j) const
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition gausspoint.h:190
virtual void giveRealStressVectorGradientDamage(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalDamageDrivningVariable, TimeStep *tStep)
gradient - based giveRealStressVector
virtual void giveGradientDamageStiffnessMatrix_du(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Left lower block.
virtual void giveGradientDamageStiffnessMatrix_ud(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Right upper block.
void give3dKappaMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Interface * giveInterface(InterfaceType t) override
void give3dGprime(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
void setPmatrix(const FloatMatrixF< 6, 6 > &values)
const FloatMatrixF< 6, 6 > & givePmatrix() const
void setTLmatrix(const FloatMatrixF< 6, 6 > &values)
double m
Specifies the strain tensor.
Definition lsmastermat.h:72
int slaveMat
'slave' material model number.
Definition lsmastermat.h:70
LargeStrainMasterMaterial(int n, Domain *d)
Definition lsmastermat.C:53
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
virtual void initTempStatus(GaussPoint *gp) const
Definition material.C:221
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
#define OOFEM_WARNING(...)
Definition error.h:80
#define OOFEM_ERROR(...)
Definition error.h:79
@ TL
Total Lagrange.
Definition fmode.h:44
@ GradientDamageMaterialExtensionInterfaceType

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