OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 2013 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 
47 namespace oofem {
48  REGISTER_Material(IntMatPhaseField);
49 
51 
52 }
53 
55 
56 }
57 
58 int
60 {
61  // returns whether receiver supports given mode
62  if ( mode == _3dInterface ) {
63  return 1;
64  } else {
65  return 0;
66  }
67 }
68 
69 void
70 IntMatPhaseField :: giveEngTraction_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, const double damage, TimeStep *tStep)
71 {
72  IntMatPhaseFieldStatus *status = static_cast< IntMatPhaseFieldStatus * >( this->giveStatus(gp) );
73 
74  this->initTempStatus(gp);
75 
76  double g = compute_g(damage);
77 
78  answer.resize( jump.giveSize() );
79 
80  answer.at(1) = g * k*jump.at(1);
81  answer.at(2) = g * k*jump.at(2);
82 
83  if ( jump.at(3) > 0.0 ) { // only degradation in tension
84  answer.at(3) = g * k*jump.at(3);
85  } else {
86  answer.at(3) = k*jump.at(3);
87  }
88 
89  double drivingEnergy = 0.5*k*jump.at(1)*jump.at(1) + 0.5*k*jump.at(2)*jump.at(2);
90  if ( jump.at(3) > 0.0 ) {
91  drivingEnergy += 0.5*k*jump.at(3)*jump.at(3);
92  }
93  if ( drivingEnergy > status->giveTempDrivingEnergy() ) { // max val
94  status->letTempDrivingEnergyBe( drivingEnergy );
95  }
96 
97  status->tempDamage = damage;
98 
99  status->letTempJumpBe(jump);
100  status->letTempTractionBe(answer);
101 
102 
103 }
104 
105 void
107 {
108  IntMatPhaseFieldStatus *status = static_cast< IntMatPhaseFieldStatus * >( this->giveStatus(gp) );
109 
110  FloatArray jump;
111  jump = status->giveTempJump();
112 
113  double damage = status->giveDamage();
114  double g = compute_g(damage);
115 
116  answer.resize(3, 3);
117  answer.zero();
118 
119  answer.at(1, 1) = g*k;
120  answer.at(2, 2) = g*k;
121 
122  if ( jump.at(3) > 0.0 ) { // only degradation in tension
123  answer.at(3,3) = g * k;
124  } else {
125  answer.at(3,3) = k;
126  }
127 
128 }
129 
130 
131 void
133 {
134 
135  IntMatPhaseFieldStatus *status = static_cast< IntMatPhaseFieldStatus * >( this->giveStatus(gp) );
136 
137  FloatArray jump;
138  jump = status->giveTempJump();
139 
140  double damage = status->giveDamage();
141  double g = compute_g(damage);
142 
143  Djj.resize(3, 3);
144  Djj.zero();
145 
146  Djj.at(1, 1) = g*k;
147  Djj.at(2, 2) = g*k;
148 
149  if ( jump.at(3) > 0.0 ) { // only degradation in tension
150  Djj.at(3,3) = g * k;
151  } else {
152  Djj.at(3,3) = k;
153  }
154 
155  double gPrime = compute_gPrime(damage);
156  Djd.at(1, 1) = gPrime*k * jump.at(1);
157  Djd.at(2, 2) = gPrime*k * jump.at(1);
158  if ( jump.at(3) > 0.0 ) { // only degradation in tension
159  Djd.at(3,3) = gPrime * k * jump.at(1);
160  } else {
161  Djd.at(3,3) = 0;
162  }
163 
164 
165  // Df/Dd, f= max[ g'*(psi_s+psi_n+) ]
166  Ddj.beTranspositionOf(Djd);
167 
168  //Ddd = { g''* }
169 
170 
171 
172 
173 }
174 
175 double
177 {
178  IntMatPhaseFieldStatus *status = static_cast< IntMatPhaseFieldStatus * >( this->giveStatus(gp) );
179  double gPrime = compute_gPrime(status->giveDamage());
180 
181  return gPrime / this->Gc * status->giveTempDrivingEnergy();
182 }
183 
184 double
186 {
187  IntMatPhaseFieldStatus *status = static_cast< IntMatPhaseFieldStatus * >( this->giveStatus(gp) );
188  double gBis = compute_gBis(status->giveDamage());
189 
190  return gBis / this->Gc * status->giveTempDrivingEnergy();
191 }
192 
193 
194 
195 // double
196 // IntMatPhaseField :: computeFreeEnergy(GaussPoint *gp, TimeStep *tStep)
197 // {
198 // //StructuralMaterialStatus *matStat = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() );
199 // FloatArray strain, stress;
200 // //stress = matStat->giveTempStressVector();
201 // //strain = matStat->giveTempStrainVector();
202 // //stress = matStat->giveStressVector();
203 // //strain = matStat->giveStrainVector();
204 // return 0.5 * stress.dotProduct( strain );
205 // }
206 
207 
208 
209 double
211 {
212  // computes g = (1-d)^2 + r0
213  double r0 = 1.0e-10;
214  return (1.0 - d) * (1.0 - d) + r0;
215 }
216 
217 
218 double
220 {
221  // compute Dg/Dd = -2*(1-d)
222  return -2.0 * (1.0 - d);
223 }
224 
225 double
227 {
228  // compute DDg/DDd = 2
229  return 2.0;
230 }
231 
232 
233 
234 
235 
236 
237 
238 
241 {
242  IRResultType result; // Required by IR_GIVE_FIELD macro
243 
246 
248  return IRRT_OK;
249 }
250 
252 {
254 
256 }
257 
258 
259 
260 
262 {
263  this->tempDrivingEnergy = 0.0;
264  this->drivingEnergy = 0.0;
265  this->tempDamage = 0.0;
266 }
267 
268 
269 
270 void
272 {
273 
275 
276  this->tempDrivingEnergy = 0.0;
277  this->drivingEnergy = 0.0;
278  this->tempDamage = 0.0;
279 }
280 
281 void
283 {
284 
286  this->drivingEnergy = this->tempDrivingEnergy;
287 
288 }
289 
290 
291 
292 } /* namespace oofem */
void setField(int item, InputFieldType id)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
Class and object Domain.
Definition: domain.h:115
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
IntMatPhaseFieldStatus(int n, Domain *d, GaussPoint *g)
virtual int hasMaterialModeCapability(MaterialMode mode)
Tests if material supports material mode.
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual void give3dStiffnessMatrix_Eng(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
double tempDamage
damage variable
double compute_g(const double d)
#define _IFT_IntMatPhaseField_kn
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Development cz-model using phase field.
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
MatResponseMode
Describes the character of characteristic material matrix.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
double compute_gBis(const double d)
IntMatPhaseField(int n, Domain *d)
virtual void giveTangents(FloatMatrix &jj, FloatMatrix &jd, FloatMatrix &dj, FloatMatrix &dd, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
void letTempJumpBe(FloatArray v)
Assigns tempJump to given vector v.
double compute_gPrime(const double d)
void letTempDrivingEnergyBe(double val)
This class implements a structural interface material status information.
virtual double giveDrivingForce(GaussPoint *gp)
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
#define _IFT_IntMatPhaseField_gc
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
virtual void giveEngTraction_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, const double damage, TimeStep *tStep)
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Class representing the a dynamic Input Record.
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
Definition: floatmatrix.C:323
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
REGISTER_Material(DummyMaterial)
void letTempTractionBe(FloatArray v)
Assigns tempTraction to given vector v.
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
the oofem namespace is to define a context or scope in which all oofem names are defined.
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
const FloatArray & giveTempJump() const
Returns the const pointer to receiver&#39;s temporary jump.
virtual void initTempStatus(GaussPoint *gp)
Initializes temporary variables stored in integration point status at the beginning of new time step...
Definition: material.C:267
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
virtual double giveDrivingForcePrime(GaussPoint *gp)
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011