OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
intmatbilinearcz.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 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 "gausspoint.h"
36 #include "floatmatrix.h"
37 #include "floatarray.h"
38 #include "mathfem.h"
39 #include "datastream.h"
40 #include "contextioerr.h"
41 #include "classfactory.h"
42 #include "intmatbilinearcz.h"
43 #include "dynamicinputrecord.h"
44 
45 namespace oofem {
46 REGISTER_Material(IntMatBilinearCZ);
47 
48 
51  mDamageNew(0.), mDamageOld(0.),
52  mTractionOld(3), mTractionNew(3),
53  mJumpOld(3), mJumpNew(3),
54  mPlastMultIncNew(0.), mPlastMultIncOld(0.)
55 {
56 }
57 
58 
60 { }
61 
63 { }
64 
66 {
70 
71  jump = mJumpNew;
72 
74 
76 }
77 
78 
80 {
82 
83  MaterialStatus &tmpStat = const_cast< MaterialStatus & >(iStatus);
84  const IntMatBilinearCZStatus &structStatus = dynamic_cast< IntMatBilinearCZStatus & >(tmpStat);
85 
86  mDamageNew = structStatus.mDamageNew;
87  mDamageOld = structStatus.mDamageOld;
88  mTractionOld = structStatus.mTractionOld;
89  mTractionNew = structStatus.mTractionNew;
90  mJumpOld = structStatus.mJumpOld;
91  mJumpNew = structStatus.mJumpNew;
92 
93  mPlastMultIncNew = structStatus.mPlastMultIncNew;
94  mPlastMultIncOld = structStatus.mPlastMultIncOld;
95 }
96 
98 {
99  OOFEM_ERROR("not implemented.");
100 }
101 
102 
104  mPenaltyStiffness(0.0),
105  mGIc(0.0), mGIIc(0.0),
106  mSigmaF(0.0),
107  mMu(0.0),
108  mGamma(0.0),
109  mSemiExplicit(false)
110 { }
111 
113 { }
114 
116 {
117  return 1;
118 }
119 
121  const FloatMatrix &F, TimeStep *tStep)
122 {
123 
124  double maxDamage = 0.99999999;
125 
126  IntMatBilinearCZStatus *status = static_cast< IntMatBilinearCZStatus * >( this->giveStatus(gp) );
127 
128  status->mJumpNew = jump;
129 
130  FloatArray jumpInc;
131  jumpInc.beDifferenceOf(status->mJumpNew, status->mJumpOld);
132 
133  FloatArray tractionTrial = status->mTractionOld;
134  tractionTrial.add(mPenaltyStiffness, jumpInc);
135 
136  double TTrNormal = tractionTrial.at(3);
137  double TTrTang = sqrt( pow(tractionTrial.at(1), 2.0) + pow(tractionTrial.at(2), 2.0) );
138  double phiTr = computeYieldFunction(TTrNormal, TTrTang);
139 
140  if ( status->mDamageOld > maxDamage ) {
141  status->mDamageNew = maxDamage;
142  status->mDamageOld = maxDamage;
143  status->mPlastMultIncNew = 0.0;
144  answer.resize(3);
145  answer.zero();
146  status->mTractionNew = answer;
147 
148  status->letTempJumpBe(jump);
149  status->letTempFirstPKTractionBe(answer);
150  status->letTempTractionBe(answer);
151 
152  return;
153  }
154 
155 
156  answer = tractionTrial;
157 
158  if ( phiTr < 0.0 ) {
159  status->mDamageNew = status->mDamageOld;
160  status->mPlastMultIncNew = 0.0;
161  status->mTractionNew = answer;
162 
163 
164  status->letTempJumpBe(jump);
165  status->letTempFirstPKTractionBe(answer);
166  status->letTempTractionBe(answer);
167 
168 // answer.beScaled( ( 1.0 - status->mDamageNew ), answer );
169  answer.at(1) *= ( 1.0 - status->mDamageNew );
170  answer.at(2) *= ( 1.0 - status->mDamageNew );
171 
172  if(answer.at(3) > 0.0) {
173  answer.at(3) *= ( 1.0 - status->mDamageNew );
174  }
175 
176  return;
177  } else {
178  // Iterate to find plastic strain increment.
179  int maxIter = 50;
180  int minIter = 1;
181  double absTol = 1.0e-9; // Absolute error tolerance
182  double relTol = 1.0e-9; // Relative error tolerance
183  double eps = 1.0e-12; // Small value for perturbation when computing numerical Jacobian
184  double plastMultInc = 0.0;
185  double initialRes = 0.0;
186 
187  for ( int iter = 0; iter < maxIter; iter++ ) {
188  // Evaluate residual (i.e. yield function)
189  computeTraction(answer, tractionTrial, plastMultInc);
190 
191  double TNormal = answer.at(3);
192  double TTang = sqrt( pow(answer.at(1), 2.0) + pow(answer.at(2), 2.0) );
193  double phi = computeYieldFunction(TNormal, TTang);
194 
195  // if(iter > 20) {
196  // printf("iter: %d res: %e\n", iter, fabs(phi) );
197  // }
198 
199  if ( iter == 0 ) {
200  initialRes = fabs(phi);
201  initialRes = max(initialRes, 1.0e-12);
202  }
203 
204  if ( (iter >= minIter && fabs(phi) < absTol) || ( iter >= minIter && ( fabs(phi) / initialRes ) < relTol ) ) {
205  // Add damage evolution
206  double S = mGIc / mSigmaF;
207  status->mPlastMultIncNew = plastMultInc;
208 
209  double damageInc = status->mPlastMultIncNew / S;
210  status->mDamageNew = status->mDamageOld + damageInc;
211 
212  if ( status->mDamageNew > maxDamage ) {
213  status->mDamageNew = maxDamage;
214  }
215 
216  status->mTractionNew = answer;
217 
218  // Jim
219  status->letTempJumpBe(jump);
220  status->letTempFirstPKTractionBe(answer);
221  status->letTempTractionBe(answer);
222 
223  if(mSemiExplicit) {
224  computeTraction(answer, tractionTrial, status->mPlastMultIncOld);
225 
226 // answer.beScaled( ( 1.0 - status->mDamageOld ), answer );
227 
228  answer.at(1) *= ( 1.0 - status->mDamageOld );
229  answer.at(2) *= ( 1.0 - status->mDamageOld );
230 
231  if(answer.at(3) > 0.0) {
232  answer.at(3) *= ( 1.0 - status->mDamageOld );
233  }
234  }
235  else {
236 // answer.beScaled( ( 1.0 - status->mDamageNew ), answer );
237 
238  answer.at(1) *= ( 1.0 - status->mDamageNew );
239  answer.at(2) *= ( 1.0 - status->mDamageNew );
240 
241  if(answer.at(3) > 0.0) {
242  answer.at(3) *= ( 1.0 - status->mDamageNew );
243  }
244  }
245 
246  return;
247  }
248 
249  // Numerical Jacobian
250  FloatArray tractionPert(3);
251  computeTraction(tractionPert, tractionTrial, plastMultInc + eps);
252  double TNormalPert = tractionPert.at(3);
253  double TTangPert = sqrt( pow(tractionPert.at(1), 2.0) + pow(tractionPert.at(2), 2.0) );
254  double phiPert = computeYieldFunction(TNormalPert, TTangPert);
255 
256  double Jac = ( phiPert - phi ) / eps;
257  plastMultInc -= ( 1.0 / Jac ) * phi;
258  }
259  }
260 
261  OOFEM_ERROR("No convergence in.");
262 }
263 
265 {
266  OOFEM_WARNING("not implemented. Use numerical Jacobian instead.");
267  this->give3dStiffnessMatrix_dTdj_Num(answer, gp, tStep);
268 }
269 
270 double IntMatBilinearCZ :: computeYieldFunction(const double &iTractionNormal, const double &iTractionTang) const
271 {
272  return (
273  mSigmaF * pow(fabs(iTractionTang) / ( mGamma * mSigmaF ), 2.0)
274  + ( mSigmaF / mGamma ) * ( mGamma - 2.0 * mMu ) * pow( ( max(iTractionNormal, 0.0) ) / mSigmaF, 2.0 )
275  - ( 1.0 / mGamma ) * ( mGamma * mSigmaF - 2.0 * mMu * iTractionNormal ) );
276 }
277 
278 void IntMatBilinearCZ :: computeTraction(FloatArray &oT, const FloatArray &iTTrial, const double &iPlastMultInc) const
279 {
280  // Note that the traction vector is assumed to be decomposed into its tangential and normal part,
281  // with tangential directions (1,2) and normal direction (3).
282 
283  double gammaF = mGIIc / mGIc;
284 
285  // Tangential part
286  oT.at(1) = iTTrial.at(1) / ( 1.0 + ( 2.0 * mPenaltyStiffness * gammaF ) * iPlastMultInc / ( mGamma * mGamma * mSigmaF ) );
287  oT.at(2) = iTTrial.at(2) / ( 1.0 + ( 2.0 * mPenaltyStiffness * gammaF ) * iPlastMultInc / ( mGamma * mGamma * mSigmaF ) );
288 
289  // Normal part
290  if ( iTTrial.at(3) <= 0.0 ) { // TODO: Check if-statement
291  oT.at(3) = iTTrial.at(3);
292  } else {
293  oT.at(3) = iTTrial.at(3) / ( 1.0 + 2.0 * mPenaltyStiffness * iPlastMultInc / mSigmaF );
294  }
295 }
296 
298 {
299  IntMatBilinearCZStatus *status = static_cast< IntMatBilinearCZStatus * >( this->giveStatus(gp) );
300  if ( type == IST_DamageScalar ) {
301  answer.resize(1);
302  answer.at(1) = status->mDamageNew;
303  return 1;
304  } else {
305  return StructuralInterfaceMaterial :: giveIPValue(answer, gp, type, tStep);
306  }
307 }
308 
310 {
311  IRResultType result; // Required by IR_GIVE_FIELD macro
312 
314 
316 
317  mGIIc = mGIc; //Defaults to GIc
319 
321 
323 
325 
327  mSemiExplicit = true;
328  printf("In IntMatBilinearCZ::initializeFrom: Semi-explicit time integration activated.\n");
329  }
330 
332 }
333 
335 {
337 
339 
342 
346 }
347 
349 {
350  printf("\nInitializing IntMatBilinearCZ:\n");
351  printf("mPenaltyStiffness: %e\n", mPenaltyStiffness);
352  printf("mGIc: %e\n", mGIc);
353  printf("mGIIc: %e\n", mGIIc);
354  printf("mSigmaF: %e\n", mSigmaF);
355  printf("mMu: %e\n", mMu);
356  printf("mGamma: %e\n\n", mGamma);
357 }
358 } /* namespace oofem */
#define _IFT_IntMatBilinearCZ_sigf
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
void setField(int item, InputFieldType id)
virtual void giveFirstPKTraction_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, const FloatMatrix &F, TimeStep *tStep)
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
void give3dStiffnessMatrix_dTdj_Num(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
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
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Class and object Domain.
Definition: domain.h:115
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
int max(int i, int j)
Returns bigger value form two given decimals.
Definition: mathfem.h:71
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual void copyStateVariables(const MaterialStatus &iStatus)
Functions for MaterialStatusMapperInterface.
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
IntMatBilinearCZ(int n, Domain *d)
#define S(p)
Definition: mdm.C:481
FloatArray mJumpOld
Discontinuity.
virtual void give3dStiffnessMatrix_dTdj(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
#define _IFT_IntMatBilinearCZ_mu
virtual int checkConsistency()
Allows programmer to test some internal data, before computation begins.
MatResponseMode
Describes the character of characteristic material matrix.
double mDamageNew
damage variable
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
Definition: floatarray.C:341
#define _IFT_IntMatBilinearCZ_g1c
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
void computeTraction(FloatArray &oT, const FloatArray &iTTrial, const double &iPlastMultInc) const
virtual void printYourself()
Prints receiver state on stdout. Useful for debugging.
#define OOFEM_ERROR(...)
Definition: error.h:61
void letTempJumpBe(FloatArray v)
Assigns tempJump to given vector v.
#define _IFT_IntMatBilinearCZ_PenaltyStiffness
This class implements a structural interface material status information.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
FloatArray jump
Equilibrated jump (discontinuity)
void letTempFirstPKTractionBe(FloatArray v)
Assigns tempFirstPKTraction to given vector v.
double computeYieldFunction(const double &iTractionNormal, const double &iTractionTang) const
Abstract base class representing a material status information.
Definition: matstatus.h:84
IntMatBilinearCZStatus(int n, Domain *d, GaussPoint *g)
Class representing vector of real numbers.
Definition: floatarray.h:82
#define _IFT_IntMatBilinearCZ_g2c
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
This class implements associated Material Status for IntMatBilinearCZFagerstrom.
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Class representing the general Input Record.
Definition: inputrecord.h:101
#define _IFT_IntMatBilinearCZ_gamma
virtual void addStateVariables(const MaterialStatus &iStatus)
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
double mPenaltyStiffness
Material parameters.
Class representing the a dynamic Input Record.
FloatArray mTractionOld
Traction.
virtual void copyStateVariables(const MaterialStatus &iStatus)
Functions for MaterialStatusMapperInterface.
REGISTER_Material(DummyMaterial)
void letTempTractionBe(FloatArray v)
Assigns tempTraction to given vector v.
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
Abstract base class for all "structural" interface models.
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
#define _IFT_IntMatBilinearCZ_semiexplicit
Class representing integration point in finite element program.
Definition: gausspoint.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
double mPlastMultIncNew
Increment of plastic multiplier.
Class representing solution step.
Definition: timestep.h:80
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
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