OOFEM 3.0
Loading...
Searching...
No Matches
intmatphasefield.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
36#include "intmatphasefield.h"
37
38#include "gausspoint.h"
39#include "floatmatrix.h"
40#include "floatarray.h"
41#include "mathfem.h"
42#include "datastream.h"
43#include "contextioerr.h"
44#include "classfactory.h"
45#include "dynamicinputrecord.h"
46
47namespace oofem {
49
51
52
53bool
54IntMatPhaseField :: hasMaterialModeCapability(MaterialMode mode) const
55{
56 // returns whether receiver supports given mode
57 return mode == _3dInterface;
58}
59
61IntMatPhaseField :: giveEngTraction_3d(const FloatArrayF<3> &jump, double damage, GaussPoint *gp, TimeStep *tStep) const
62{
63 IntMatPhaseFieldStatus *status = static_cast< IntMatPhaseFieldStatus * >( this->giveStatus(gp) );
64
65 //status->initTempStatus();
66
67 double g = compute_g(damage);
68
69 FloatArrayF<3> answer;
70 answer.at(1) = g * k*jump.at(1);
71 answer.at(2) = g * k*jump.at(2);
72
73 if ( jump.at(3) > 0.0 ) { // only degradation in tension
74 answer.at(3) = g * k*jump.at(3);
75 } else {
76 answer.at(3) = k*jump.at(3);
77 }
78
79 double drivingEnergy = 0.5*k*jump.at(1)*jump.at(1) + 0.5*k*jump.at(2)*jump.at(2);
80 if ( jump.at(3) > 0.0 ) {
81 drivingEnergy += 0.5*k*jump.at(3)*jump.at(3);
82 }
83 if ( drivingEnergy > status->giveTempDrivingEnergy() ) { // max val
84 status->letTempDrivingEnergyBe( drivingEnergy );
85 }
86
87 status->tempDamage = damage;
88
89 status->letTempJumpBe(jump);
90 status->letTempTractionBe(answer);
91
92 return answer;
93}
94
96IntMatPhaseField :: give3dStiffnessMatrix_Eng(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
97{
98 IntMatPhaseFieldStatus *status = static_cast< IntMatPhaseFieldStatus * >( this->giveStatus(gp) );
99
100 const auto &jump = status->giveTempJump();
101
102 double damage = status->giveDamage();
103 double g = compute_g(damage);
104
105 FloatMatrixF<3,3> answer;
106 answer.at(1, 1) = g*k;
107 answer.at(2, 2) = g*k;
108
109 if ( jump.at(3) > 0.0 ) { // only degradation in tension
110 answer.at(3,3) = g * k;
111 } else {
112 answer.at(3,3) = k;
113 }
114 return answer;
115}
116
117
118void
119IntMatPhaseField :: giveTangents(FloatMatrix &Djj, FloatMatrix &Djd, FloatMatrix &Ddj, FloatMatrix &Ddd, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
120{
121 IntMatPhaseFieldStatus *status = static_cast< IntMatPhaseFieldStatus * >( this->giveStatus(gp) );
122
123 const auto &jump = status->giveTempJump();
124
125 double damage = status->giveDamage();
126 double g = compute_g(damage);
127
128 Djj.resize(3, 3);
129 Djj.zero();
130 Djj.at(1, 1) = g*k;
131 Djj.at(2, 2) = g*k;
132
133 if ( jump.at(3) > 0.0 ) { // only degradation in tension
134 Djj.at(3,3) = g * k;
135 } else {
136 Djj.at(3,3) = k;
137 }
138
139 double gPrime = compute_gPrime(damage);
140 Djd.at(1, 1) = gPrime*k * jump.at(1);
141 Djd.at(2, 2) = gPrime*k * jump.at(1);
142 if ( jump.at(3) > 0.0 ) { // only degradation in tension
143 Djd.at(3,3) = gPrime * k * jump.at(1);
144 } else {
145 Djd.at(3,3) = 0;
146 }
147
148 // Df/Dd, f= max[ g'*(psi_s+psi_n+) ]
149 Ddj.beTranspositionOf(Djd);
150 //Ddd = { g''* }
151}
152
153double
154IntMatPhaseField :: giveDrivingForce(GaussPoint *gp) const
155{
156 IntMatPhaseFieldStatus *status = static_cast< IntMatPhaseFieldStatus * >( this->giveStatus(gp) );
157 double gPrime = compute_gPrime(status->giveDamage());
158
159 return gPrime / this->Gc * status->giveTempDrivingEnergy();
160}
161
162double
163IntMatPhaseField :: giveDrivingForcePrime(GaussPoint *gp) const
164{
165 IntMatPhaseFieldStatus *status = static_cast< IntMatPhaseFieldStatus * >( this->giveStatus(gp) );
166 double gBis = compute_gBis(status->giveDamage());
167
168 return gBis / this->Gc * status->giveTempDrivingEnergy();
169}
170
171
172
173// double
174// IntMatPhaseField :: computeFreeEnergy(GaussPoint *gp, TimeStep *tStep)
175// {
176// //StructuralMaterialStatus *matStat = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() );
177// FloatArray strain, stress;
178// //stress = matStat->giveTempStressVector();
179// //strain = matStat->giveTempStrainVector();
180// //stress = matStat->giveStressVector();
181// //strain = matStat->giveStrainVector();
182// return 0.5 * stress.dotProduct( strain );
183// }
184
185
186
187double
188IntMatPhaseField :: compute_g(double d) const
189{
190 // computes g = (1-d)^2 + r0
191 double r0 = 1.0e-10;
192 return (1.0 - d) * (1.0 - d) + r0;
193}
194
195
196double
197IntMatPhaseField :: compute_gPrime(double d) const
198{
199 // compute Dg/Dd = -2*(1-d)
200 return -2.0 * (1.0 - d);
201}
202
203double
204IntMatPhaseField :: compute_gBis(double d) const
205{
206 // compute DDg/DDd = 2
207 return 2.0;
208}
209
210
211void
212IntMatPhaseField :: initializeFrom(InputRecord &ir)
213{
216
217 StructuralInterfaceMaterial :: initializeFrom(ir);
218}
219
220
221void IntMatPhaseField :: giveInputRecord(DynamicInputRecord &input)
222{
223 StructuralInterfaceMaterial :: giveInputRecord(input);
224
226}
227
228
229
230
231IntMatPhaseFieldStatus :: IntMatPhaseFieldStatus(GaussPoint *g) : StructuralInterfaceMaterialStatus(g)
232{
233}
234
235
236void
237IntMatPhaseFieldStatus :: initTempStatus()
238{
239 StructuralInterfaceMaterialStatus :: initTempStatus();
240 this->tempDrivingEnergy = 0.0;
241 this->drivingEnergy = 0.0;
242 this->tempDamage = 0.0;
243}
244
245
246void
247IntMatPhaseFieldStatus :: updateYourself(TimeStep *atTime)
248{
249 StructuralInterfaceMaterialStatus :: updateYourself(atTime);
250 this->drivingEnergy = this->tempDrivingEnergy;
251}
252
253
254} /* namespace oofem */
#define REGISTER_Material(class)
void setField(int item, InputFieldType id)
double & at(std::size_t i)
double at(std::size_t i, std::size_t j) const
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
void beTranspositionOf(const FloatMatrix &src)
void zero()
Zeroes all coefficient of receiver.
double at(std::size_t i, std::size_t j) const
void letTempDrivingEnergyBe(double val)
double tempDamage
damage variable
double giveDamage() const override
double compute_gBis(double d) const
double compute_g(double d) const
IntMatPhaseField(int n, Domain *d)
double compute_gPrime(double d) const
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
StructuralInterfaceMaterialPhF(int n, Domain *d)
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 IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define _IFT_IntMatPhaseField_kn
#define _IFT_IntMatPhaseField_gc

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