OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
structuralinterfaceelement.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 "../sm/Elements/Interfaces/structuralinterfaceelement.h"
36 #include "../sm/Materials/InterfaceMaterials/structuralinterfacematerial.h"
37 #include "../sm/Materials/InterfaceMaterials/structuralinterfacematerialstatus.h"
38 #include "../sm/CrossSections/structuralinterfacecrosssection.h"
39 #include "feinterpol.h"
40 #include "domain.h"
41 #include "material.h"
42 #include "gausspoint.h"
43 #include "gaussintegrationrule.h"
44 #include "intarray.h"
45 #include "floatarray.h"
46 #include "floatmatrix.h"
47 #include "mathfem.h"
48 
49 
50 
51 namespace oofem {
53  interpolation(NULL),
54  nlGeometry(0)
55 {
56 }
57 
58 
60 { }
61 
63  FloatArray N;
64  FEInterpolation *interp = this->giveInterpolation();
65  interp->evalN( N, lcoords, FEIElementGeometryWrapper(this) );
66 
67  answer.resize(this->giveDofManager(1)->giveCoordinates()->giveSize());
68  answer.zero();
69 
70  int numNodes = this->giveNumberOfNodes();
71  for(int i = 1; i <= numNodes/2; i++) {
72  FloatArray &nodeCoord = *(this->giveDofManager(i)->giveCoordinates());
73  answer.add(N.at(i), nodeCoord );
74  }
75 
76  return true;
77 }
78 
79 
80 void
82 {
83  // Computes the stiffness matrix of the receiver K_cohesive = int_A ( N^t * dT/dj * N ) dA
84  FloatMatrix N, D, DN;
85  bool matStiffSymmFlag = this->giveCrossSection()->isCharacteristicMtrxSymmetric(rMode);
86  answer.clear();
87 
88  FloatMatrix rotationMatGtoL;
89  for ( auto &ip: *this->giveDefaultIntegrationRulePtr() ) {
90 
91  if ( this->nlGeometry == 0 ) {
92  this->giveStiffnessMatrix_Eng(D, rMode, ip, tStep);
93  } else if ( this->nlGeometry == 1 ) {
94  this->giveStiffnessMatrix_dTdj(D, rMode, ip, tStep);
95  } else {
96  OOFEM_ERROR("nlgeometry must be 0 or 1!")
97  }
98 
99  this->computeTransformationMatrixAt(ip, rotationMatGtoL);
100  D.rotatedWith(rotationMatGtoL, 'n'); // transform stiffness to global coord system
101 
102  this->computeNmatrixAt(ip, N);
103  DN.beProductOf(D, N);
104  double dA = this->computeAreaAround(ip);
105  if ( matStiffSymmFlag ) {
106  answer.plusProductSymmUpper(N, DN, dA);
107  } else {
108  answer.plusProductUnsym(N, DN, dA);
109  }
110  }
111 
112 
113  if ( matStiffSymmFlag ) {
114  answer.symmetrized();
115  }
116 }
117 
118 
119 void
121 {
122  // Computes the spatial jump vector at the Gauss point (ip) of
123  // the receiver, at time step (tStep). jump = N*u
124  FloatMatrix N;
125  FloatArray u;
126 
127  if ( !this->isActivated(tStep) ) {
128  answer.resize(3);
129  answer.zero();
130  return;
131  }
132 
133  this->computeNmatrixAt(ip, N);
134  this->computeVectorOf(VM_Total, tStep, u);
135 
136  // subtract initial displacements, if defined
137  if ( initialDisplacements.giveSize() ) {
139  }
140 
141  answer.beProductOf(N, u);
142 }
143 
144 
145 void
147  TimeStep *tStep, int useUpdatedGpRecord)
148 {
149  // Computes internal forces
150  // if useGpRecord == 1 then data stored in ip->giveStressVector() are used
151  // instead computing stressVector through this->ComputeStressVector();
152  // this must be done after you want internal forces after element->updateYourself()
153  // has been called for the same time step.
154 
155  FloatMatrix N;
156  FloatArray u, traction, jump;
157 
158  this->computeVectorOf(VM_Total, tStep, u); //u in GCS (LCS only if defined computeGtoLRotationMatrix() )
159  // subtract initial displacements, if defined
160  if ( initialDisplacements.giveSize() ) {
162  }
163 
164  // zero answer will resize accordingly when adding first contribution
165  answer.clear();
166 
167  for ( auto &ip: *this->giveDefaultIntegrationRulePtr() ) {
168  this->computeNmatrixAt(ip, N);
169  //if ( useUpdatedGpRecord == 1 ) {
170  // StructuralInterfaceMaterialStatus *status = static_cast< StructuralInterfaceMaterialStatus * >( ip->giveMaterialStatus() );
171  // //temp
172  // FloatArray traction3d;
173  // traction3d = status->giveTraction();
174  // traction.setValues(2, traction3d.at(1), traction3d.at(3) );
175  //} else {
176  jump.beProductOf(N, u);
177  this->computeTraction(traction, ip, jump, tStep);
178  //}
179 
180  // compute internal cohesive forces as f = N^T*traction dA
181  double dA = this->computeAreaAround(ip);
182  answer.plusProduct(N, traction, dA);
183  }
184 
185 }
186 
187 
188 void
190 {
191  // Returns the traction in global coordinate system
192  FloatMatrix rotationMatGtoL, F;
193  this->computeTransformationMatrixAt(ip, rotationMatGtoL);
194 
195  FloatArray jumpRot = jump;
196  jumpRot.rotatedWith(rotationMatGtoL, 'n'); // transform jump to local coord system
197 
198  if ( this->nlGeometry == 0 ) {
199  this->giveEngTraction(traction, ip, jumpRot, tStep);
200  } else if ( this->nlGeometry == 1 ) {
202  F.beUnitMatrix();
203  F.rotatedWith(rotationMatGtoL, 'n');
204  this->giveFirstPKTraction(traction, ip, jumpRot, F, tStep);
205  }
206 
208  FloatArray normal = {rotationMatGtoL.at(2,1), rotationMatGtoL.at(2,2), 0.};
209 // printf("normal: "); normal.printYourself();
210  status->letNormalBe(normal);
211 
212  traction.rotatedWith(rotationMatGtoL, 't'); // transform traction to global coord system
213 }
214 
215 
216 void
218 {
219  // returns characteristics matrix of receiver according to mtrx
220 
221  if ( mtrx == TangentStiffnessMatrix ) {
222  this->computeStiffnessMatrix(answer, TangentStiffness, tStep);
223  } else if ( mtrx == SecantStiffnessMatrix ) {
224  this->computeStiffnessMatrix(answer, SecantStiffness, tStep);
225  } else if ( mtrx == ElasticStiffnessMatrix ) {
226  this->computeStiffnessMatrix(answer, ElasticStiffness, tStep);
227  } else {
228  OOFEM_ERROR("Unknown Type of characteristic mtrx (%s)", __CharTypeToString(mtrx) );
229  }
230 }
231 
232 
233 
234 void
236  TimeStep *tStep)
237 //
238 // returns characteristics vector of receiver according to mtrx
239 //
240 {
241  if ( ( mtrx == InternalForcesVector ) && ( mode == VM_Total ) ) {
242  this->giveInternalForcesVector(answer, tStep);
243  } else if ( ( mtrx == LastEquilibratedInternalForcesVector ) && ( mode == VM_Total ) ) {
244  /* here tstep is not relevant, we set useUpdatedGpRecord = 1
245  * and this will cause to integrate internal forces using existing (nontemp, equlibrated) stresses in
246  * statuses. Mainly used to compute reaction forces */
247  this->giveInternalForcesVector(answer, tStep, 1);
248  } else if (mtrx == ExternalForcesVector ) {
249  answer.clear();
250  } else {
251  OOFEM_ERROR("Unknown Type of characteristic mtrx (%s)", __CharTypeToString(mtrx) );
252  }
253 }
254 
255 void
257 {
259 
260  // record initial displacement if element not active
261  if ( activityTimeFunction && !isActivated(tStep) ) {
262  this->computeVectorOf(VM_Total, tStep, initialDisplacements);
263  }
264 }
265 
266 
267 void
269 {
270  // Updates the receiver at end of step.
271  FloatArray tractionG, jumpL;
272 
273  // force updating strains & stresses
274  for ( auto &iRule: integrationRulesArray ) {
275  for ( GaussPoint *gp: *iRule ) {
276  this->computeSpatialJump(jumpL, gp, tStep);
277  this->computeTraction(tractionG, gp, jumpL, tStep);
278  }
279  }
280 }
281 
282 int
284 {
285  // check if the cross section is a 'StructuralInterfaceCrossSection'
286  if ( !this->giveInterfaceCrossSection()->testCrossSectionExtension(this->giveInterfaceCrossSection()->crossSectionType) ) {
287  OOFEM_WARNING("cross section %s is not a structural interface cross section", this->giveCrossSection()->giveClassName() );
288  return 0;
289  }
291 }
292 
293 
294 int
296 {
297  return Element :: giveIPValue(answer, aIntegrationPoint, type, tStep);
298 }
299 
300 
303 {
304  return Element :: initializeFrom(ir);
305 }
306 
308 {
310 }
311 
312 
314 {
315  return static_cast< StructuralInterfaceCrossSection * >( this->giveCrossSection() );
316 }
317 
318 
319 void
321 {
322  // Default implementation uses the First PK version if available.
325  FloatMatrix F(3, 3);
326  F.beUnitMatrix();
327  this->giveFirstPKTraction(answer, gp, jump, F, tStep);
328  // T_PK2 = inv(F)* T_PK1
329 }
330 
331 
332 void
334 {
335  // Default implementation uses the First PK version if available
336  this->giveStiffnessMatrix_dTdj(answer, rMode, ip, tStep);
338 }
339 } // end namespace oofem
340 
virtual void updateInternalState(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
CrossSection * giveCrossSection()
Definition: element.C:495
virtual int testCrossSectionExtension(CrossSectExtension ext)
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
virtual bool isActivated(TimeStep *tStep)
Definition: element.C:793
void subtract(const FloatArray &src)
Subtracts array src to receiver.
Definition: floatarray.C:258
virtual void computeTransformationMatrixAt(GaussPoint *gp, FloatMatrix &answer)=0
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
Definition: element.C:1257
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
Class and object Domain.
Definition: domain.h:115
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
Definition: element.C:86
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
Definition: element.h:822
virtual void giveFirstPKTraction(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, const FloatMatrix &F, TimeStep *tStep)
virtual void computeTraction(FloatArray &traction, IntegrationPoint *ip, const FloatArray &jump, TimeStep *tStep)
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
virtual int checkConsistency()
Allows programmer to test some internal data, before computation begins.
void clear()
Clears receiver (zero size).
Definition: floatarray.h:206
virtual FloatArray * giveCoordinates()
Definition: dofmanager.h:382
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: element.C:706
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
Definition: element.C:779
Abstract base class for all finite elements.
Definition: element.h:145
StructuralInterfaceElement(int n, Domain *d)
Constructor.
virtual double computeAreaAround(GaussPoint *gp)=0
MatResponseMode
Describes the character of characteristic material matrix.
virtual void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord=0)
Returns equivalent nodal forces vectors.
void rotatedWith(FloatMatrix &r, char mode)
Returns the receiver a rotated according the change-of-base matrix r.
Definition: floatarray.C:799
FloatArray initialDisplacements
Initial displacement vector, describes the initial nodal displacements when element has been casted...
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element&#39;s local coordinates.
virtual int giveNumberOfNodes() const
Returns number of nodes of receiver.
Definition: element.h:662
virtual FEInterpolation * giveInterpolation() const
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
void plusProductUnsym(const FloatMatrix &a, const FloatMatrix &b, double dV)
Adds to the receiver the product .
Definition: floatmatrix.C:780
int activityTimeFunction
Element activity time function. If defined, nonzero value indicates active receiver, zero value inactive element.
Definition: element.h:176
virtual void computeNmatrixAt(GaussPoint *gp, FloatMatrix &answer)=0
Computes modified interpolation matrix (N) for the element which multiplied with the unknowns vector ...
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: element.C:638
#define OOFEM_ERROR(...)
Definition: error.h:61
void rotatedWith(const FloatMatrix &r, char mode= 'n')
Returns the receiver &#39;a&#39; transformed using give transformation matrix r.
Definition: floatmatrix.C:1557
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
const char * __CharTypeToString(CharType _value)
Definition: cltypes.C:339
virtual bool isCharacteristicMtrxSymmetric(MatResponseMode rMode)
Check for symmetry of stiffness matrix.
Definition: crosssection.h:172
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
This class implements a structural interface material status information.
#define N(p, q)
Definition: mdm.C:367
void plusProductSymmUpper(const FloatMatrix &a, const FloatMatrix &b, double dV)
Adds to the receiver the product .
Definition: floatmatrix.C:698
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
Base class for all structural interface cross section models.
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
virtual int checkConsistency()
Performs consistency check.
virtual void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
Computes the stiffness/tangent matrix of receiver.
virtual void giveStiffnessMatrix_dTdj(FloatMatrix &answer, MatResponseMode rMode, IntegrationPoint *ip, TimeStep *tStep)
virtual void giveStiffnessMatrix_Eng(FloatMatrix &answer, MatResponseMode rMode, IntegrationPoint *ip, TimeStep *tStep)
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 giveCharacteristicMatrix(FloatMatrix &answer, CharType, TimeStep *tStep)
Computes characteristic matrix of receiver of requested type in given time step.
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
Definition: gausspoint.h:205
CharType
Definition: chartype.h:87
Class representing the general Input Record.
Definition: inputrecord.h:101
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual void giveEngTraction(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, TimeStep *tStep)
virtual void giveCharacteristicVector(FloatArray &answer, CharType type, ValueModeType mode, TimeStep *tStep)
Computes characteristic vector of receiver of requested type in given time step.
Class representing the a dynamic Input Record.
virtual void computeSpatialJump(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
Definition: element.h:170
void beUnitMatrix()
Sets receiver to unity matrix.
Definition: floatmatrix.C:1332
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:337
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
the oofem namespace is to define a context or scope in which all oofem names are defined.
DofManager * giveDofManager(int i) const
Definition: element.C:514
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
Definition: floatmatrix.h:516
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
void symmetrized()
Initializes the lower half of the receiver according to the upper half.
Definition: floatmatrix.C:1576
int nlGeometry
Flag indicating if geometrical nonlinearities apply.
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 letNormalBe(FloatArray iN)
Assigns normal vector.
virtual const char * giveClassName() const
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
StructuralInterfaceCrossSection * giveInterfaceCrossSection()
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631
void plusProduct(const FloatMatrix &b, const FloatArray &s, double dV)
Adds the product .
Definition: floatarray.C:226

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