OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
intmatcoulombcontact.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 "intmatcoulombcontact.h"
36 #include "gausspoint.h"
37 #include "floatmatrix.h"
38 #include "floatarray.h"
39 #include "mathfem.h"
40 #include "contextioerr.h"
41 #include "classfactory.h"
42 #include "dynamicinputrecord.h"
43 
44 namespace oofem {
45 REGISTER_Material(IntMatCoulombContact);
46 
48 
50 
51 
52 void
54 {
55  IntMatCoulombContactStatus *status = static_cast< IntMatCoulombContactStatus * >( this->giveStatus( gp ) );
56 
57  double normalJump = jump.at( 1 );
58  FloatArray shearJump = { jump.at(2), jump.at(3) };
59 
60  double normalStress = 0.0;
61  FloatArray shearStress, tempShearStressShift = status->giveShearStressShift();
62  this->computeEngTraction( normalStress, shearStress, tempShearStressShift,
63  normalJump, shearJump );
64 
65  // Set stress components in the traction vector
66  answer.resize( 3 );
67  answer.at( 1 ) = normalStress;
68  answer.at( 2 ) = shearStress.at( 1 );
69  answer.at( 3 ) = shearStress.at( 2 );
70 
71  // Update gp
72  status->setTempShearStressShift( tempShearStressShift );
73  status->letTempJumpBe( jump );
74  status->letTempTractionBe( answer );
75 }
76 
77 
78 void
80 {
81  IntMatCoulombContactStatus *status = static_cast< IntMatCoulombContactStatus * >( this->giveStatus( gp ) );
82 
83  double normalJump = jump.at( 1 );
84  FloatArray shearJump = FloatArray{ jump.at(2) };
85 
86  double normalStress = 0.0;
87  FloatArray shearStress, tempShearStressShift = status->giveShearStressShift();
88  this->computeEngTraction( normalStress, shearStress, tempShearStressShift,
89  normalJump, shearJump );
90 
91  // Set stress components in the traction vector
92  answer.resize( 2 );
93  answer.at( 1 ) = normalStress;
94  answer.at( 2 ) = shearStress.at( 1 );
95 
96  // Update gp
97  status->setTempShearStressShift( tempShearStressShift );
98  status->letTempJumpBe( jump );
99  status->letTempTractionBe( answer );
100 }
101 
102 
103 void
105 {
106  // Returns the (engineering) traction vector (normal stress only) in 1d based on the
107  // spatial jump. The shear stress is not relevant in this case.
108 
109  IntMatCoulombContactStatus *status = static_cast< IntMatCoulombContactStatus * >( this->giveStatus( gp ) );
110 
111  double normalJump = jump.at( 1 );
112  FloatArray shearJump(0);
113 
114  double normalStress = 0.0;
115  FloatArray shearStress, tempShearStressShift(0);
116  this->computeEngTraction( normalStress, shearStress, tempShearStressShift,
117  normalJump, shearJump );
118 
119  // Set stress components in the traction vector
120  answer.resize( 1 );
121  answer.at( 1 ) = normalStress;
122 
123  // Update gp
124  status->letTempJumpBe( jump );
125  status->letTempTractionBe( answer );
126 }
127 
128 
129 void
130 IntMatCoulombContact :: computeEngTraction(double &normalStress, FloatArray &shearStress,
131  FloatArray &tempShearStressShift, double normalJump, const FloatArray &shearJump )
132 {
133 
134  double maxShearStress = 0.0;
135  double shift = -this->kn * this->stiffCoeff * normalClearance;
136 
137  if ( normalJump + normalClearance <= 0. ) {
138  normalStress = this->kn * ( normalJump + normalClearance ) + shift; //in compression and after the clearance gap closed
139  maxShearStress = fabs( normalStress ) * this->frictCoeff;
140  } else {
141  normalStress = this->kn * this->stiffCoeff * ( normalJump + normalClearance ) + shift;
142  maxShearStress = 0.;
143  }
144 
145  if ( shearJump.giveSize() != 0 ) {
146 
147  shearStress = this->kn * shearJump - tempShearStressShift;
148  double dp = shearStress.computeNorm();
149  double eps = 1.0e-15; // small number
150  if ( dp > maxShearStress ) {
151  shearStress.times( maxShearStress / ( dp + eps ) );
152  }
153  tempShearStressShift = this->kn * shearJump - shearStress;
154 
155  } else { // 1d -> no shear stresses
156  return;
157  }
158 }
159 
160 
161 void
163  MatResponseMode rMode,
164  GaussPoint *gp, TimeStep *tStep, int numSpaceDim)
165 //
166 // Returns characteristic material stiffness matrix of the receiver
167 //
168 {
169 
170  IntMatCoulombContactStatus *status = static_cast< IntMatCoulombContactStatus * > ( this->giveStatus(gp) );
171  const FloatArray &jump = status->giveTempJump();
172 
173  double normalJump = jump.at( 1 );//in status, normal is always the first component
174 
175  answer.resize( numSpaceDim, numSpaceDim );
176  answer.beUnitMatrix();
177  if ( rMode == SecantStiffness || rMode == TangentStiffness ) {
178  if ( normalJump + normalClearance <= 0 ) {
179  answer.times( this->kn ); //in compression and after the clearance gap closed
180  } else {
181  answer.times( this->kn * this->stiffCoeff );
182  }
183  } else {
184  answer.times( this->kn );
185  }
186 
187 }
188 
189 
192 {
193  IRResultType result; // Required by IR_GIVE_FIELD macro
194 
195  frictCoeff = 0.;
196  stiffCoeff = 0.;
197  normalClearance = 0.;
202 
204 }
205 
206 
207 void
209 {
215 }
216 
217 
219 {
220  int size = d->giveNumberOfSpatialDimensions() - 1;
221  shearStressShift.resize(size);
225 }
226 
227 
229 { }
230 
231 
232 void
234 {
236  fprintf(file, "status { ");
237  if(this->shearStressShift.giveSize() == 2) {
238  fprintf( file, "shearStressShift (%f, %f)", this->shearStressShift.at( 1 ), this->shearStressShift.at( 2 ) );
239  } else if(this->shearStressShift.giveSize() == 1) {
240  fprintf( file, "shearStressShift (%f)", this->shearStressShift.at( 1 ) );
241  }
242  fprintf(file, "}\n");
243 }
244 
245 
246 void
248 {
251 }
252 
253 
254 void
256 {
259 }
260 
261 
264 {
265  return shearStressShift;
266 }
267 
268 
271 {
272  contextIOResultType iores;
273 
274  // save parent class status
275  if(( iores = StructuralInterfaceMaterialStatus::saveContext( stream, mode, obj ) ) != CIO_OK) {
276  THROW_CIOERR(iores);
277  }
278 
279  // write a raw data
280  //if ( !stream.write(kappa) ) {
281  //THROW_CIOERR(CIO_IOERR);
282  //}
283 
284  return CIO_OK;
285 }
286 
287 
290 {
291  contextIOResultType iores;
292 
293  // read parent class status
294  if(( iores = StructuralInterfaceMaterialStatus::restoreContext( stream, mode, obj ) ) != CIO_OK) {
295  THROW_CIOERR(iores);
296  }
297 
298  // read raw data
299  //if ( !stream.read(kappa) ) {
300  //THROW_CIOERR(CIO_IOERR);
301  //}
302 
303  return CIO_OK;
304 }
305 } // end namespace oofem
void setField(int item, InputFieldType id)
IntMatCoulombContactStatus(int n, Domain *d, GaussPoint *g)
Constructor.
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
double normalClearance
Normal distance which needs to be closed when interface element should act in compression (distance i...
void computeEngTraction(double &normalStress, FloatArray &shearStress, FloatArray &tempShearStressShift, double normalJump, const FloatArray &shearJump)
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
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 printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
virtual ~IntMatCoulombContact()
Destructor.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
Definition: domain.C:1067
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 ~IntMatCoulombContactStatus()
Destructor.
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual void giveEngTraction_2d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, TimeStep *tStep)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
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.
#define _IFT_IntMatCoulombContact_frictCoeff
This class implements associated Material Status to IntMatCoulombContact.
void letTempJumpBe(FloatArray v)
Assigns tempJump to given vector v.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
void times(double f)
Multiplies receiver by factor f.
Definition: floatmatrix.C:1594
This class implements a structural interface material status information.
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
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 computeNorm() const
Computes the norm (or length) of the vector.
Definition: floatarray.C:840
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
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual void giveEngTraction_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, TimeStep *tStep)
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
#define _IFT_IntMatCoulombContact_normalClearance
Class representing the a dynamic Input Record.
void times(double s)
Multiplies receiver with scalar.
Definition: floatarray.C:818
virtual void giveEngTraction_1d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, TimeStep *tStep)
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
void giveGeneralStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep, int numSpaceDim)
void beUnitMatrix()
Sets receiver to unity matrix.
Definition: floatmatrix.C:1332
#define _IFT_IntMatCoulombContact_stiffCoeff
#define _IFT_IntMatCoulombContact_kn
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
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
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...
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
IntMatCoulombContact(int n, Domain *d)
Constructor.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
void setTempShearStressShift(FloatArray newShearStressShift)
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