OOFEM 3.0
Loading...
Searching...
No Matches
expczmaterial.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 "expczmaterial.h"
36#include "gausspoint.h"
37#include "floatmatrix.h"
38#include "floatarray.h"
39#include "mathfem.h"
40#include "datastream.h"
41#include "contextioerr.h"
42
43namespace oofem {
45const double tolerance = 1.0e-12; // small number
46
47ExpCZMaterial :: ExpCZMaterial(int n, Domain *d) : StructuralInterfaceMaterial(n, d)
48{ }
49
50
51void
52ExpCZMaterial :: giveEngTraction_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, TimeStep *tStep)
53{
54 ExpCZMaterialStatus *status = static_cast< ExpCZMaterialStatus * >( this->giveStatus(gp) );
55
57 // no degradation in shear
58 // jumpVector = [normal shear1 shear2]
59 //auto [gn, gs1, gs2] = jump;
60 double gn = jump.at(1);
61 double gs1 = jump.at(2);
62 double gs2 = jump.at(3);
63 double gs = sqrt(gs1 * gs1 + gs2 * gs2);
64
65 double xin = gn / ( gn0 + tolerance );
66 double xit = gs / ( gs0 + tolerance );
67 double tn = GIc / gn0 *exp(-xin) * ( xin * exp(-xit * xit) + ( 1.0 - q ) / ( r - 1.0 ) * ( 1.0 - exp(-xit * xit) ) * ( r - xin ) );
68
69 answer = {tn, 0., 0.};
70
71 // update gp
72 status->letTempJumpBe(jump);
73 status->letTempTractionBe(answer);
74}
75
76
77void
78ExpCZMaterial :: give3dStiffnessMatrix_Eng(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
79{
80 ExpCZMaterialStatus *status = static_cast< ExpCZMaterialStatus * >( this->giveStatus(gp) );
81
82 const auto &jumpVector = status->giveTempJump();
83 // jumpVector = [normal shear1 shear2]
84 double gn = jumpVector.at(1);
85 double gs1 = jumpVector.at(2);
86 double gs2 = jumpVector.at(3);
87 double gs = sqrt(gs1 * gs1 + gs2 * gs2);
88
89 if ( rMode == TangentStiffness ) {
90 double xin = gn / ( gn0 + tolerance );
91 double xit = gs / ( gs0 + tolerance );
92 double dtndgn = GIc / gn0 / gn0 *exp(-xin) *
93 ( ( 1.0 - xin ) * exp(-xit * xit) + ( 1.0 - q ) / ( r - 1.0 ) * ( 1.0 - exp(-xit * xit) ) * ( -r + xin - 1.0 ) );
94
95 answer.resize(3, 3);
96 answer.zero();
97 answer.at(1, 1) = dtndgn;
98 } else {
99 OOFEM_ERROR("unknown MatResponseMode");
100 }
101}
102
103
104int
105ExpCZMaterial :: giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
106{
107 ExpCZMaterialStatus *status = static_cast< ExpCZMaterialStatus * >( this->giveStatus(gp) );
108 return StructuralInterfaceMaterial :: giveIPValue(answer, gp, type, tStep);
109}
110
111
112void
113ExpCZMaterial :: initializeFrom(InputRecord &ir)
114{
116
117 this->sigfs = 0.0;
119
120 GIIc = 0.0;
121
122 this->gn0 = GIc / ( this->sigfn * M_E + tolerance ); // normal jump at max stress
123 this->gs0 = GIIc / ( sqrt( 0.5 * M_E ) * this->sigfs + tolerance ); // shear jump at max stress
124
125
126 this->q = GIIc / GIc;
127 this->r = 0.0; // fix
128
129 // check validity of the material paramters
130 if ( this->GIc < 0.0 ) {
131 throw ValueInputException(ir, _IFT_ExpCZMaterial_g1c, "GIc must be positive");
132 }
133}
134
135int
136ExpCZMaterial :: checkConsistency()
137{
138 return 1;
139}
140
141void
142ExpCZMaterial :: printYourself()
143{
144 printf("Paramters for ExpCZMaterial: \n");
145
146 printf("-Strength paramters \n");
147 printf(" sigfn = %e \n", this->sigfn);
148 printf(" GIc = %e \n", this->GIc);
149 printf(" GIIc = %e \n", this->GIIc);
150 //printf("\n");
151
152 printf("-jump limits \n");
153 printf(" gn0 = %e \n", this->gn0);
154 printf(" gs0 = %e \n", this->gs0);
155
156 printf("-other parameters \n");
157 printf(" q = %e \n", this->q);
158 printf(" r = %e \n", this->r);
159}
160
161
162ExpCZMaterialStatus :: ExpCZMaterialStatus(GaussPoint *g) : StructuralInterfaceMaterialStatus(g)
163{ }
164
165
166void
167ExpCZMaterialStatus :: printOutputAt(FILE *file, TimeStep *tStep)
168{
169 StructuralInterfaceMaterialStatus :: printOutputAt(file, tStep);
170 /*
171 * fprintf(file, "status { ");
172 * if ( this->damage > 0.0 ) {
173 * fprintf(file, "kappa %f, damage %f ", this->kappa, this->damage);
174 * }
175 *
176 * fprintf(file, "}\n");
177 */
178}
179
180
181void
182ExpCZMaterialStatus :: initTempStatus()
183{
184 StructuralInterfaceMaterialStatus :: initTempStatus();
185 //this->tempKappa = this->kappa;
186 //this->tempDamage = this->damage;
187}
188
189void
190ExpCZMaterialStatus :: updateYourself(TimeStep *tStep)
191{
192 StructuralInterfaceMaterialStatus :: updateYourself(tStep);
193}
194
195#if 0
196void
197ExpCZMaterialStatus :: saveContext(DataStream &stream, ContextMode mode)
198{
199 StructuralInterfaceMaterialStatus :: saveContext(stream, mode);
200
201 if ( !stream.write(kappa) ) {
203 }
204
205 if ( !stream.write(damage) ) {
207 }
208}
209
210void
211ExpCZMaterialStatus :: restoreContext(DataStream &stream, ContextMode mode)
212{
213 StructuralInterfaceMaterialStatus :: restoreContext(stream, mode);
214
215 if ( !stream.read(kappa) ) {
217 }
218
219 if ( !stream.read(damage) ) {
221 }
222}
223#endif
224} // end namespace oofem
virtual int write(const int *data, std::size_t count)=0
Writes count integer values from array pointed by data.
double gn0
normal jump at damage initiation
double gs0
shear jump at damage initiations
double & at(std::size_t i)
double & at(Index i)
Definition floatarray.h:202
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
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
StructuralInterfaceMaterialStatus(GaussPoint *g)
Constructor. Creates new StructuralInterfaceMaterialStatus with number n, belonging to domain d and I...
const FloatArrayF< 3 > & giveTempJump() const
Returns the const pointer to receiver's temporary jump.
void letTempTractionBe(const FloatArrayF< 3 > v)
Assigns tempTraction to given vector v.
void letTempJumpBe(const FloatArrayF< 3 > v)
Assigns tempJump to given vector v.
#define THROW_CIOERR(e)
#define OOFEM_ERROR(...)
Definition error.h:79
#define _IFT_ExpCZMaterial_sigfn
#define _IFT_ExpCZMaterial_g1c
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
long ContextMode
Definition contextmode.h:43
const double tolerance
@ CIO_IOERR
General IO error.

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