OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 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 
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 
43 namespace oofem {
45 const double tolerance = 1.0e-12; // small number
46 
48 { }
49 
50 
52 { }
53 
54 
55 void
57 {
58  ExpCZMaterialStatus *status = static_cast< ExpCZMaterialStatus * >( this->giveStatus(gp) );
59 
61  // no degradation in shear
62  // jumpVector = [normal shear1 shear2]
63  double gn = jump.at(1);
64  double gs1 = jump.at(2);
65  double gs2 = jump.at(3);
66  double gs = sqrt(gs1 * gs1 + gs2 * gs2);
67 
68  double xin = gn / ( gn0 + tolerance );
69  double xit = gs / ( gs0 + tolerance );
70  double tn = GIc / gn0 *exp(-xin) * ( xin * exp(-xit * xit) + ( 1.0 - q ) / ( r - 1.0 ) * ( 1.0 - exp(-xit * xit) ) * ( r - xin ) );
71 
72  answer.resize(3);
73  answer.at(1) = tn;
74  answer.at(2) = 0.0;
75  answer.at(3) = 0.0;
76 
77  // update gp
78  status->letTempJumpBe(jump);
79  status->letTempTractionBe(answer);
80 }
81 
82 
83 void
85 {
86  ExpCZMaterialStatus *status = static_cast< ExpCZMaterialStatus * >( this->giveStatus(gp) );
87 
88  const FloatArray &jumpVector = status->giveTempJump();
89  // jumpVector = [normal shear1 shear2]
90  double gn = jumpVector.at(1);
91  double gs1 = jumpVector.at(2);
92  double gs2 = jumpVector.at(3);
93  double gs = sqrt(gs1 * gs1 + gs2 * gs2);
94 
95  if ( rMode == TangentStiffness ) {
96  answer.resize(3, 3);
97  answer.zero();
98 
99  double xin = gn / ( gn0 + tolerance );
100  double xit = gs / ( gs0 + tolerance );
101  double dtndgn = GIc / gn0 / gn0 *exp(-xin) *
102  ( ( 1.0 - xin ) * exp(-xit * xit) + ( 1.0 - q ) / ( r - 1.0 ) * ( 1.0 - exp(-xit * xit) ) * ( -r + xin - 1.0 ) );
103 
104  answer.at(1, 1) = dtndgn;
105  } else {
106  OOFEM_ERROR("unknown MatResponseMode");
107  }
108 }
109 
110 
111 int
113 {
114  ExpCZMaterialStatus *status = static_cast< ExpCZMaterialStatus * >( this->giveStatus(gp) );
115  return StructuralInterfaceMaterial :: giveIPValue(answer, gp, type, tStep);
116 }
117 
118 
121 {
122  IRResultType result; // Required by IR_GIVE_FIELD macro
123 
125 
126  this->sigfs = 0.0;
128 
129  GIIc = 0.0;
130 
131  this->gn0 = GIc / ( this->sigfn * M_E + tolerance ); // normal jump at max stress
132  this->gs0 = GIIc / ( sqrt( 0.5 * M_E ) * this->sigfs + tolerance ); // shear jump at max stress
133 
134 
135  this->q = GIIc / GIc;
136  this->r = 0.0; // fix
137 
138  // check validity of the material paramters
139  if ( this->GIc < 0.0 ) {
140  OOFEM_WARNING("GIc is negative (%.2e)", this->GIc);
141  return IRRT_BAD_FORMAT;
142  }
143  return IRRT_OK;
144 }
145 
146 int
148 {
149  return 1;
150 }
151 
152 void
154 {
155  printf("Paramters for ExpCZMaterial: \n");
156 
157  printf("-Strength paramters \n");
158  printf(" sigfn = %e \n", this->sigfn);
159  printf(" GIc = %e \n", this->GIc);
160  printf(" GIIc = %e \n", this->GIIc);
161  //printf("\n");
162 
163  printf("-jump limits \n");
164  printf(" gn0 = %e \n", this->gn0);
165  printf(" gs0 = %e \n", this->gs0);
166 
167  printf("-other parameters \n");
168  printf(" q = %e \n", this->q);
169  printf(" r = %e \n", this->r);
170 }
171 
173 { }
174 
175 
177 { }
178 
179 
180 void
182 {
184  /*
185  * fprintf(file, "status { ");
186  * if ( this->damage > 0.0 ) {
187  * fprintf(file, "kappa %f, damage %f ", this->kappa, this->damage);
188  * }
189  *
190  * fprintf(file, "}\n");
191  */
192 }
193 
194 
195 void
197 {
199  //this->tempKappa = this->kappa;
200  //this->tempDamage = this->damage;
201 }
202 
203 void
205 {
207 }
208 
209 #if 0
212 {
213  contextIOResultType iores;
214 
215  // save parent class status
216  if ( ( iores = StructuralInterfaceMaterialStatus :: saveContext(stream, mode, obj) ) != CIO_OK ) {
217  THROW_CIOERR(iores);
218  }
219 
220  // write a raw data
221  if ( !stream.write(kappa) ) {
223  }
224 
225  if ( !stream.write(damage) ) {
227  }
228 
229  return CIO_OK;
230 }
231 
234 {
235  contextIOResultType iores;
236 
237  // read parent class status
238  if ( ( iores = StructuralInterfaceMaterialStatus :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
239  THROW_CIOERR(iores);
240  }
241 
242  // read raw data
243  if ( !stream.read(kappa) ) {
245  }
246 
247  if ( !stream.read(damage) ) {
249  }
250 
251  return CIO_OK;
252 }
253 #endif
254 } // end namespace oofem
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
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 ~ExpCZMaterial()
Destructor.
Definition: expczmaterial.C:51
virtual void printYourself()
Prints receiver state on stdout. Useful for debugging.
virtual int checkConsistency()
Allows programmer to test some internal data, before computation begins.
double gs0
shear jump at damage initiations
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
This class implements associated status to ExpCZMaterial.
Definition: expczmaterial.h:56
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
General IO error.
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
MatResponseMode
Describes the character of characteristic material matrix.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
ExpCZMaterial(int n, Domain *d)
Constructor.
Definition: expczmaterial.C:47
virtual void give3dStiffnessMatrix_Eng(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
Definition: expczmaterial.C:84
#define OOFEM_ERROR(...)
Definition: error.h:61
void letTempJumpBe(FloatArray v)
Assigns tempJump to given vector v.
This class implements a structural interface material status information.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
const double tolerance
Definition: expczmaterial.C:45
ExpCZMaterialStatus(int n, Domain *d, GaussPoint *g)
Constructor.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual ~ExpCZMaterialStatus()
Destructor.
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
double gn0
normal jump at damage initiation
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual void giveEngTraction_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, TimeStep *tStep)
Definition: expczmaterial.C:56
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 int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
#define _IFT_ExpCZMaterial_sigfn
Definition: expczmaterial.h:47
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
void letTempTractionBe(FloatArray v)
Assigns tempTraction to given vector v.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
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
const FloatArray & giveTempJump() const
Returns the const pointer to receiver&#39;s temporary jump.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
#define _IFT_ExpCZMaterial_g1c
Definition: expczmaterial.h:46
Class representing integration point in finite element program.
Definition: gausspoint.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
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:28 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011