OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
bondceb.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 "bondceb.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 #include "classfactory.h"
43 #include "dynamicinputrecord.h"
44 
45 namespace oofem {
46 REGISTER_Material(BondCEBMaterial);
47 
49 {
50  tauf = 0.;
51  alpha = 0.4;
52 }
53 
54 
56 
57 
58 void
60 {
61  BondCEBMaterialStatus *status = static_cast< BondCEBMaterialStatus * >( this->giveStatus(gp) );
62 
63  // normal traction evaluated elastically
64  answer.resize(3);
65  answer.at(1) = kn * jump.at(1);
66 
67  // trial values of shear tractions evaluated elastically
68  double s = 0., dKappa = 0.;
69  for ( int i = 2; i <= 3; i++ ) {
70  double depsi = jump.at(i) - status->giveJump().at(i);
71  answer.at(i) = status->giveTraction().at(i) + ks * depsi;
72  s += answer.at(i) * answer.at(i);
73  dKappa += depsi*depsi;
74  }
75 
76  // norm of trial shear traction
77  s = sqrt(s);
78 
79  // cumulative slip increment
80  dKappa = sqrt(dKappa);
81 
82  // cumulative slip at the end of the step
83  double tempKappa = status->giveKappa() + dKappa;
84 
85  // maximum allowed norm of shear traction
86  double smax = evaluateBondStress(tempKappa);
87 
88  // reduce shear tractions, if needed
89  if ( s > smax ) {
90  for ( int i = 2; i <= 3; i++ ) {
91  answer.at(i) *= smax / s;
92  }
93  }
94 
95  // update gp
96  status->letTempJumpBe(jump);
97  status->letTempTractionBe(answer);
98  status->setTempKappa(tempKappa);
99 }
100 
101 
102 void
104 {
106  answer.resize(3, 3);
107  answer.zero();
108  answer.at(1, 1) = kn;
109  answer.at(2, 2) = answer.at(3, 3) = ks;
110 }
111 
112 double
114 {
115  if ( kappa <= 0. )
116  return 0.;
117  if ( kappa <= s1 )
118  return taumax * pow(kappa/s1, alpha);
119  if ( kappa <= s2 )
120  return taumax;
121  if ( kappa <= s3 )
122  return taumax - (taumax-tauf) * (kappa-s2) / (s3-s2);
123  return tauf;
124 }
125 
126 
127 int
129 {
130  BondCEBMaterialStatus *status = static_cast< BondCEBMaterialStatus * >( this->giveStatus(gp) );
131  if ( type == IST_MaxEquivalentStrainLevel ) {
132  answer.resize(1);
133  answer.at(1) = status->giveKappa();
134  return 1;
135  } else {
136  return StructuralInterfaceMaterial :: giveIPValue(answer, gp, type, tStep);
137  }
138 }
139 
142 {
143  IRResultType result; // Required by IR_GIVE_FIELD macro
144 
145  // mandatory parameters
152 
153  // optional parameters
156 
157  // dependent parameter
158  s0 = pow(pow(s1, -alpha)*taumax/ks, 1./(1.-alpha));
159  if ( s0 > s1 ) {
160  s0 = s1;
161  ks = taumax/s1;
162  OOFEM_WARNING("Parameter ks adjusted");
163  }
164 
166 }
167 
168 
169 void
171 {
173 
174  input.setField(this->kn, _IFT_BondCEBMaterial_kn);
175  input.setField(this->ks, _IFT_BondCEBMaterial_ks);
176  input.setField(this->s1, _IFT_BondCEBMaterial_s1);
177  input.setField(this->s2, _IFT_BondCEBMaterial_s2);
178  input.setField(this->s3, _IFT_BondCEBMaterial_s3);
180 }
181 
182 
183 
185 {
186  kappa = tempKappa = 0.0;
187 }
188 
189 
191 { }
192 
193 
194 void
196 {
198  fprintf(file, "status { ");
199  if ( this->kappa > 0.0 ) {
200  fprintf(file, "kappa %g ", this->kappa);
201  }
202 
203  fprintf(file, "}\n");
204 }
205 
206 
207 void
209 {
211  this->tempKappa = this->kappa;
212 }
213 
214 void
216 {
218  this->kappa = this->tempKappa;
219 }
220 
221 
224 {
225  contextIOResultType iores;
226 
227  // save parent class status
228  if ( ( iores = StructuralInterfaceMaterialStatus :: saveContext(stream, mode, obj) ) != CIO_OK ) {
229  THROW_CIOERR(iores);
230  }
231 
232  // write a raw data
233  if ( !stream.write(kappa) ) {
235  }
236 
237  return CIO_OK;
238 }
239 
242 {
243  contextIOResultType iores;
244 
245  // read parent class status
246  if ( ( iores = StructuralInterfaceMaterialStatus :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
247  THROW_CIOERR(iores);
248  }
249 
250  // read raw data
251  if ( !stream.read(kappa) ) {
253  }
254 
255  return CIO_OK;
256 }
257 } // end namespace oofem
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
double ks
Shear elastic stiffness.
Definition: bondceb.h:111
void setField(int item, InputFieldType id)
double tauf
Residual shear stress.
Definition: bondceb.h:115
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 contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: bondceb.C:241
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
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
#define _IFT_BondCEBMaterial_kn
Definition: bondceb.h:44
General IO error.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Definition: bondceb.C:195
double taumax
Shear strength.
Definition: bondceb.h:113
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
Definition: bondceb.C:128
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.
virtual ~BondCEBMaterial()
Destructor.
Definition: bondceb.C:55
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
#define _IFT_BondCEBMaterial_al
Definition: bondceb.h:49
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: bondceb.C:170
virtual void give3dStiffnessMatrix_Eng(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
Definition: bondceb.C:103
BondCEBMaterial(int n, Domain *d)
Constructor.
Definition: bondceb.C:48
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.
double tempKappa
Non-equilibrated cumulative slip.
Definition: bondceb.h:65
This class implements associated status to BondCEBInterfaceMaterial.
Definition: bondceb.h:59
#define _IFT_BondCEBMaterial_ks
Definition: bondceb.h:45
BondCEBMaterialStatus(int n, Domain *d, GaussPoint *g)
Constructor.
Definition: bondceb.C:184
void setTempKappa(double newKappa)
Sets the temporary cumulative slip to the given value.
Definition: bondceb.h:80
void letTempJumpBe(FloatArray v)
Assigns tempJump to given vector v.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: bondceb.C:215
double kappa
Cumulative slip.
Definition: bondceb.h:63
This class implements a structural interface material status information.
double alpha
Exponent.
Definition: bondceb.h:119
#define _IFT_BondCEBMaterial_s3
Definition: bondceb.h:48
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
double giveKappa()
Returns the last equilibrated cumulative slip.
Definition: bondceb.h:76
const FloatArray & giveJump() const
Returns the const pointer to receiver&#39;s jump.
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
const FloatArray & giveTraction() const
Returns the const pointer to receiver&#39;s traction vector.
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
double s0
Characteristic slip values.
Definition: bondceb.h:117
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
#define _IFT_BondCEBMaterial_tauf
Definition: bondceb.h:51
#define _IFT_BondCEBMaterial_s1
Definition: bondceb.h:46
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 void giveEngTraction_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, TimeStep *tStep)
Definition: bondceb.C:59
#define _IFT_BondCEBMaterial_taumax
Definition: bondceb.h:50
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
double kn
Normal elastic stiffness.
Definition: bondceb.h:109
#define _IFT_BondCEBMaterial_s2
Definition: bondceb.h:47
Class representing the a dynamic Input Record.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: bondceb.C:208
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
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: bondceb.C:141
virtual ~BondCEBMaterialStatus()
Destructor.
Definition: bondceb.C:190
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
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
double evaluateBondStress(const double kappa)
Definition: bondceb.C:113
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
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: bondceb.C:223
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:27 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011