OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
simpleinterfacemat.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 "simpleinterfacemat.h"
36 #include "../sm/Elements/structuralelement.h"
37 #include "gausspoint.h"
38 #include "floatmatrix.h"
39 #include "floatarray.h"
40 #include "mathfem.h"
41 #include "contextioerr.h"
42 #include "classfactory.h"
43 #include "dynamicinputrecord.h"
44 
45 namespace oofem {
46 REGISTER_Material(SimpleInterfaceMaterial);
47 
49 
50 
52 
53 
54 void
56 {
57  SimpleInterfaceMaterialStatus *status = static_cast< SimpleInterfaceMaterialStatus * >( this->giveStatus(gp) );
58  bool shearYieldingFlag = false;
59  FloatArray shearJump(2), shearTraction;
60  FloatArray tempShearStressShift = status->giveShearStressShift();
61  double normalStrain = jump.at(1);
62  double normalStress, maxShearStress, dp;
63  double shift = -this->kn * this->stiffCoeff * normalClearance;
64 
65  if ( normalStrain + normalClearance <= 0. ) {
66  normalStress = this->kn * ( normalStrain + normalClearance ) + shift; //in compression and after the clearance gap closed
67  maxShearStress = fabs(normalStress) * this->frictCoeff;
68  } else {
69  normalStress = this->kn * this->stiffCoeff * ( normalStrain + normalClearance ) + shift;
70  maxShearStress = 0.;
71  }
72 
73 
74  shearJump.at(1) = jump.at(2);
75  shearJump.at(2) = jump.at(3);
76  shearTraction.beScaled(this->ks, shearJump);
77  shearTraction.subtract(tempShearStressShift);
78  dp = shearTraction.dotProduct(shearTraction, 2);
79  if ( dp > maxShearStress * maxShearStress ) {
80  shearYieldingFlag = true;
81  shearTraction.times( maxShearStress / sqrt(dp) );
82  }
83 
84  tempShearStressShift.beScaled(this->ks, shearJump);
85  tempShearStressShift.subtract(shearTraction);
86 
87  double lim = 1.e+50;
88  answer.resize(3);
89  answer.at(1) = max(min(normalStress, lim), -lim); //threshold on maximum/minimum
90  answer.at(2) = shearTraction.at(1);
91  answer.at(3) = shearTraction.at(2);
92 
93  // update gp
94  status->setShearYieldingFlag(shearYieldingFlag);
95  status->setTempShearStressShift(tempShearStressShift);
96  status->letTempJumpBe(jump);
97  status->letTempTractionBe(answer);
98 }
99 
100 
101 void
103 {
104  SimpleInterfaceMaterialStatus *status = static_cast< SimpleInterfaceMaterialStatus * >( this->giveStatus(gp) );
105  double normalJump = status->giveTempJump().at(1);
106 
107  answer.resize(3, 3);
108  if ( rMode == SecantStiffness || rMode == TangentStiffness ) {
109  if ( normalJump + normalClearance <= 0. ) {
110  answer.at(1, 1) = kn;
111  if ( status->giveShearYieldingFlag() )
112  answer.at(2, 2) = answer.at(3, 3) = 0;
113  else
114  answer.at(2, 2) = answer.at(3, 3) = ks;//this->kn; //in compression and after the clearance gap closed
115  } else {
116  answer.at(1, 1) = this->kn * this->stiffCoeff;
117  answer.at(2, 2) = answer.at(3, 3) = 0;
118  }
119  } else {
120  answer.at(1, 1) = kn;
121  answer.at(2, 2) = answer.at(3, 3) = this->ks;
122  }
123 }
124 
125 
126 int
128 {
129  return StructuralInterfaceMaterial :: giveIPValue(answer, gp, type, tStep);
130 }
131 
132 
135 {
136  IRResultType result; // Required by IR_GIVE_FIELD macro
137 
138  frictCoeff = 0.;
139  stiffCoeff = 0.;
140  normalClearance = 0.;
142  ks = kn;
147 
149 }
150 
151 
152 void
154 {
160 }
161 
162 
164 {
169  shearYieldingFlag = false;
170 }
171 
172 
174 { }
175 
176 
177 void
179 {
181  fprintf(file, "status { ");
182  fprintf( file, "shearStressShift (%f, %f)", this->shearStressShift.at(1), this->shearStressShift.at(2) );
183  fprintf(file, "}\n");
184 }
185 
186 
187 void
189 {
192 }
193 
194 
195 void
197 {
200 }
201 
202 
203 const FloatArray &
205 {
206  return shearStressShift;
207 }
208 
209 
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) ) {
222  //THROW_CIOERR(CIO_IOERR);
223  //}
224 
225  return CIO_OK;
226 }
227 
228 
231 {
232  contextIOResultType iores;
233 
234  // read parent class status
235  if ( ( iores = StructuralInterfaceMaterialStatus :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
236  THROW_CIOERR(iores);
237  }
238 
239  // read raw data
240  //if ( !stream.read(kappa) ) {
241  //THROW_CIOERR(CIO_IOERR);
242  //}
243 
244  return CIO_OK;
245 }
246 } // end namespace oofem
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
void setField(int item, InputFieldType id)
void subtract(const FloatArray &src)
Subtracts array src to receiver.
Definition: floatarray.C:258
This class implements associated Material Status to SimpleInterfaceMaterial.
SimpleInterfaceMaterialStatus(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
virtual ~SimpleInterfaceMaterialStatus()
Destructor.
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
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.
#define _IFT_SimpleInterfaceMaterial_kn
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
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 contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
virtual ~SimpleInterfaceMaterial()
Destructor.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
#define _IFT_SimpleInterfaceMaterial_normalClearance
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
Definition: floatarray.C:146
virtual void giveEngTraction_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, TimeStep *tStep)
SimpleInterfaceMaterial(int n, Domain *d)
Constructor.
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
Definition: floatarray.C:463
void letTempJumpBe(FloatArray v)
Assigns tempJump to given vector v.
virtual void give3dStiffnessMatrix_Eng(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
This class implements a structural interface material status information.
#define _IFT_SimpleInterfaceMaterial_ks
void setTempShearStressShift(FloatArray newShearStressShift)
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
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
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
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
#define _IFT_SimpleInterfaceMaterial_frictCoeff
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Class representing the a dynamic Input Record.
void times(double s)
Multiplies receiver with scalar.
Definition: floatarray.C:818
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
double normalClearance
Normal distance which needs to be closed when interface element should act in compression (distance i...
int min(int i, int j)
Returns smaller value from two given decimals.
Definition: mathfem.h:59
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
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_SimpleInterfaceMaterial_stiffCoeff
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:31 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011