OOFEM 3.0
Loading...
Searching...
No Matches
structuralinterfacematerial.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
37#include "dynamicinputrecord.h"
38#include "gausspoint.h"
39
40namespace oofem {
41StructuralInterfaceMaterial :: StructuralInterfaceMaterial(int n, Domain *d) : Material(n, d)
42{
43 this->useNumericalTangent = false;
44}
45
46
47int
48StructuralInterfaceMaterial :: giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
49{
51 if ( type == IST_InterfaceJump ) {
52 answer = status->giveJump();
53 return 1;
54 } else if ( type == IST_InterfaceTraction ) {
55 answer = status->giveTraction();
56 return 1;
57 } else if ( type == IST_InterfaceFirstPKTraction ) {
58 answer = status->giveFirstPKTraction();
59 return 1;
60 } else if ( type == IST_DeformationGradientTensor ) {
61 answer = to_voigt_form_33( status->giveF() );
62 return 1;
63 } else if ( type == IST_InterfaceNormal ) {
64 answer = status->giveNormal();
65 return 1;
66 } else if ( type == IST_DamageScalar ) {
67 answer.resize(1);
68 answer.at(1) = status->giveDamage();
69 return 1;
70 } else {
71 return Material :: giveIPValue(answer, gp, type, tStep);
72 }
73}
74
75
76void
77StructuralInterfaceMaterial :: initializeFrom(InputRecord &ir)
78{
80}
81
82
83void
84StructuralInterfaceMaterial :: giveInputRecord(DynamicInputRecord &input)
85{
86 Material :: giveInputRecord(input);
87}
88
89
91StructuralInterfaceMaterial :: give1dStiffnessMatrix_Eng(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
92{
93 auto d = give3dStiffnessMatrix_Eng(mode, gp, tStep);
94 return {d(0,0)};
95}
96
97
99StructuralInterfaceMaterial :: give2dStiffnessMatrix_Eng(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
100{
101 auto d = give3dStiffnessMatrix_Eng(mode, gp, tStep);
102 return d({0,1}, {0,1});
103#if 0
104 answer3D.printYourself("analytical tangent");
105
106 FloatMatrix answerNum;
107 give2dStiffnessMatrix_Eng_Num(answerNum, mode, gp, tStep);
108 answerNum.printYourself("numerical tangent");
109
110 FloatMatrix comp;
111 comp = answer3D;
112 comp.subtract(answerNum);
113 comp.printYourself("difference in numerical tangent to mat method");
114#endif
115}
116
118StructuralInterfaceMaterial :: give3dStiffnessMatrix_Eng(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
119{
120 // Default implementation. Will use large deformation dT/dj as stiffness
121 return give3dStiffnessMatrix_dTdj(mode, gp, tStep);
122}
123
124
126StructuralInterfaceMaterial :: give1dStiffnessMatrix_dTdj(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
127{
128 auto d = this->give3dStiffnessMatrix_dTdj_Num(gp, tStep);
129 return {d(0,0)};
130}
131
132
134StructuralInterfaceMaterial :: give2dStiffnessMatrix_dTdj(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
135{
136 auto d = this->give3dStiffnessMatrix_dTdj_Num(gp, tStep);
137 return d({0,1}, {0,1});
138}
139
141StructuralInterfaceMaterial :: give3dStiffnessMatrix_dTdj(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
142{
143 OOFEM_WARNING("Using numerical tangent");
144 return this->give3dStiffnessMatrix_dTdj_Num(gp, tStep);
145}
146
147
148double
149StructuralInterfaceMaterial :: giveFirstPKTraction_1d(double jump, double reducedF, GaussPoint *gp, TimeStep *tStep) const
150{
151 return this->giveFirstPKTraction_3d({ jump, 0., 0. }, diag<3>({reducedF, 1., 1.}), gp, tStep).at(1);
152}
153
155StructuralInterfaceMaterial :: giveFirstPKTraction_2d(const FloatArrayF<2> &jump, const FloatMatrixF<2,2> &reducedF, GaussPoint *gp, TimeStep *tStep) const
156{
158 reducedF(0,0), reducedF(1,0), 0.,
159 reducedF(0,1), reducedF(1,1), 0.,
160 0., 0., 1.
161 };
162
163 auto traction3D = this->giveFirstPKTraction_3d({ jump.at(1), jump.at(2), 0. }, F, gp, tStep);
164 return { traction3D.at(1), traction3D.at(2) };
165}
166
167double
168StructuralInterfaceMaterial :: giveEngTraction_1d(double jump, GaussPoint *gp, TimeStep *tStep) const
169{
170 auto traction3D = this->giveEngTraction_3d({ jump, 0., 0.}, gp, tStep);
171 return traction3D.at(1);
172}
173
175StructuralInterfaceMaterial :: giveEngTraction_2d(const FloatArrayF<2> &jump, GaussPoint *gp, TimeStep *tStep) const
176{
177 auto traction3D = this->giveEngTraction_3d({ jump.at(1), jump.at(2), 0. }, gp, tStep);
178 return { traction3D.at(1), traction3D.at(2) };
179}
180
182StructuralInterfaceMaterial :: giveEngTraction_3d(const FloatArrayF<3> &jump, GaussPoint *gp, TimeStep *tStep) const
183{
184 // Default implementation calls first PK version with F = I
185 return giveFirstPKTraction_3d(jump, eye<3>(), gp, tStep);
186}
187
188
189
190// Numerical tangents
192StructuralInterfaceMaterial :: give1dStiffnessMatrix_dTdj_Num(GaussPoint *gp, TimeStep *tStep) const
193{
194 // Default implementation for computation of the numerical tangent
195 // Computes the material stiffness using a central difference method
196
198 double eps = 1.0e-9;
199 double F = status->giveTempF().at(1,1);
200 double jump = status->giveTempJump().at(3);
201
202 double tPlus = this->giveFirstPKTraction_1d( jump + eps, F, gp, tStep );
203 double tMinus = this->giveFirstPKTraction_1d( jump - eps, F, gp, tStep );
204
205 this->giveFirstPKTraction_1d(jump, F, gp, tStep); // reset temp values by recomputing the stress
206 return (tPlus - tMinus) / ( 2 * eps );
207}
208
210StructuralInterfaceMaterial :: give2dStiffnessMatrix_dTdj_Num(GaussPoint *gp, TimeStep *tStep) const
211{
212 // Default implementation for computation of the numerical tangent
213 // Computes the material stiffness using a central difference method
214
216 double eps = 1.0e-9;
217 const auto &F3 = status->giveTempF();
218 FloatMatrixF<2,2> F = {F3(0,0), F3(1,0), F3(0,1), F3(1,1)};
219 FloatArrayF<2> jump = { status->giveTempJump().at(1), status->giveTempJump().at(2) };
220
221 FloatMatrixF<2,2> answer;
222 for ( int i = 1; i <= 2; i++ ) {
223 auto jumpPlus = jump;
224 auto jumpMinus = jump;
225 jumpPlus.at( i ) += eps;
226 jumpMinus.at( i ) -= eps;
227 auto TPlus = this->giveFirstPKTraction_2d(jumpPlus, F, gp, tStep);
228 auto TMinus = this->giveFirstPKTraction_2d(jumpMinus, F, gp, tStep);
229
230 auto Kcolumn = TPlus - TMinus;
231 answer.setColumn(Kcolumn, i);
232 }
233 answer *= 1.0 / ( 2 * eps );
234 this->giveFirstPKTraction_2d(jump, F, gp, tStep); // reset temp values by recomputing the stress
235 return answer;
236}
237
239StructuralInterfaceMaterial :: give3dStiffnessMatrix_dTdj_Num(GaussPoint *gp, TimeStep *tStep) const
240{
241 // Default implementation for computation of the numerical tangent
242 // Computes the material stiffness using a central difference method
244 double eps = 1.0e-9;
245 const auto &F = status->giveTempF();
246 const auto &jump = status->giveTempJump();
247
248 FloatMatrixF<3,3> answer;
249 for(int i = 1; i <= 3; i++) {
250 auto jumpPlus = jump;
251 auto jumpMinus = jump;
252 jumpPlus.at( i ) += eps;
253 jumpMinus.at( i ) -= eps;
254 auto TPlus = this->giveFirstPKTraction_3d(jumpPlus, F, gp, tStep );
255 auto TMinus = this->giveFirstPKTraction_3d(jumpMinus, F, gp, tStep );
256
257 auto Kcolumn = TPlus - TMinus;
258 answer.setColumn(Kcolumn, i);
259 }
260 answer *= 1.0 / ( 2 * eps );
261 this->giveFirstPKTraction_3d(jump, F, gp, tStep); // reset temp values by recomputing the stress
262 return answer;
263}
264
265
267StructuralInterfaceMaterial :: give1dStiffnessMatrix_Eng_Num(GaussPoint *gp, TimeStep *tStep) const
268{
269 // Default implementation for computation of the numerical tangent d(sig)/d(jump)
270 // Computes the material stiffness using a central difference method
272 double eps = 1.0e-9;
273 double jump = status->giveTempJump().at(1);
274
275 auto tPlus = this->giveEngTraction_1d(jump + eps, gp, tStep);
276 auto tMinus = this->giveEngTraction_1d(jump - eps, gp, tStep);
277
278 this->giveEngTraction_1d( jump, gp, tStep ); // reset temp values by recomputing the stress
279 return (tPlus - tMinus) / ( 2 * eps );
280}
281
283StructuralInterfaceMaterial :: give2dStiffnessMatrix_Eng_Num(GaussPoint *gp, TimeStep *tStep) const
284{
285 // Default implementation for computation of the numerical tangent d(sig)/d(jump)
286 // Computes the material stiffness using a central difference method
287
289 double eps = 1.0e-12;
290 FloatArrayF<2> jump = {status->giveTempJump().at(1), status->giveTempJump().at(2)};
291
292 FloatMatrixF<2,2> answer;
293 for(int i = 1; i <= 2; i++) {
294 auto jumpPlus = jump;
295 auto jumpMinus = jump;
296 jumpPlus.at( i ) += eps;
297 jumpMinus.at( i ) -= eps;
298 auto tPlus = this->giveEngTraction_2d(jumpPlus, gp, tStep);
299 auto tMinus = this->giveEngTraction_2d(jumpMinus, gp, tStep);
300
301 auto Kcolumn = tPlus - tMinus;
302 answer.setColumn(Kcolumn, i);
303 }
304 answer *= 1.0 / ( 2 * eps );
305 this->giveEngTraction_2d( jump, gp, tStep ); // reset temp values by recomputing the stress
306 return answer;
307}
308
310StructuralInterfaceMaterial :: give3dStiffnessMatrix_Eng_Num(GaussPoint *gp, TimeStep *tStep) const
311{
312 // Default implementation for computation of the numerical tangent d(sig)/d(jump)
313 // Computes the material stiffness using a central difference method
314
316 double eps = 1.0e-9;
317 const auto &jump = status->giveTempJump();
318
319 FloatMatrixF<3,3> answer;
320 for(int i = 1; i <= 3; i++) {
321 auto jumpPlus = jump;
322 auto jumpMinus = jump;
323 jumpPlus.at( i ) += eps;
324 jumpMinus.at( i ) -= eps;
325 auto tPlus = this->giveEngTraction_3d(jumpPlus, gp, tStep);
326 auto tMinus = this->giveEngTraction_3d(jumpMinus, gp, tStep);
327
328 auto Kcolumn = tPlus - tMinus;
329 answer.setColumn(Kcolumn, i);
330 }
331 answer *= 1.0 / ( 2 * eps );
332 this->giveEngTraction_3d(jump, gp, tStep ); // reset temp values by recomputing the stress
333 return answer;
334}
335
336} // end namespace oofem
double & at(std::size_t i)
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
void setColumn(const FloatArrayF< N > &src, std::size_t c)
double at(std::size_t i, std::size_t j) const
*Prints matrix to stdout Useful for debugging void printYourself() const
void subtract(const FloatMatrix &a)
Material(int n, Domain *d)
Definition material.C:46
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
const FloatMatrixF< 3, 3 > & giveF() const
Returns the const pointer to receiver's deformation gradient vector.
const FloatArrayF< 3 > & giveTempJump() const
Returns the const pointer to receiver's temporary jump.
const FloatArrayF< 3 > & giveJump() const
Returns the const pointer to receiver's jump.
const FloatArrayF< 3 > & giveFirstPKTraction() const
Returns the const pointer to receiver's first Piola-Kirchhoff traction vector.
const FloatMatrixF< 3, 3 > & giveTempF() const
Returns the const pointer to receiver's temporary deformation gradient vector.
const FloatArrayF< 3 > & giveNormal() const
Returns const reference to normal vector.
const FloatArrayF< 3 > & giveTraction() const
Returns the const pointer to receiver's traction vector.
virtual double giveFirstPKTraction_1d(double jump, double reducedF, GaussPoint *gp, TimeStep *tStep) const
virtual FloatArrayF< 3 > giveEngTraction_3d(const FloatArrayF< 3 > &jump, GaussPoint *gp, TimeStep *tStep) const
virtual double giveEngTraction_1d(double jump, GaussPoint *gp, TimeStep *tStep) const
virtual FloatArrayF< 3 > giveFirstPKTraction_3d(const FloatArrayF< 3 > &jump, const FloatMatrixF< 3, 3 > &F, GaussPoint *gp, TimeStep *tStep) const
FloatMatrixF< 2, 2 > give2dStiffnessMatrix_Eng_Num(GaussPoint *gp, TimeStep *tStep) const
virtual FloatMatrixF< 3, 3 > give3dStiffnessMatrix_dTdj(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
virtual FloatArrayF< 2 > giveFirstPKTraction_2d(const FloatArrayF< 2 > &jump, const FloatMatrixF< 2, 2 > &reducedF, GaussPoint *gp, TimeStep *tStep) const
FloatMatrixF< 3, 3 > give3dStiffnessMatrix_dTdj_Num(GaussPoint *gp, TimeStep *tStep) const
virtual FloatMatrixF< 3, 3 > give3dStiffnessMatrix_Eng(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
virtual FloatArrayF< 2 > giveEngTraction_2d(const FloatArrayF< 2 > &jump, GaussPoint *gp, TimeStep *tStep) const
#define OOFEM_WARNING(...)
Definition error.h:80
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
FloatArrayF< 9 > to_voigt_form_33(const FloatMatrixF< 3, 3 > &t)
FloatMatrixF< N, N > diag(const FloatArrayF< N > &v)
FloatMatrixF< N, N > eye()
Constructs an identity matrix.
#define _IFT_StructuralInterfaceMaterial_useNumericalTangent

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