OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
tr2shell7xfem.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/Shells/tr2shell7xfem.h"
36 #include "../sm/Materials/structuralms.h"
37 #include "../sm/xfem/enrichmentitems/crack.h"
38 #include "../sm/xfem/enrichmentitems/shellcrack.h"
39 #include "node.h"
40 #include "load.h"
41 #include "mathfem.h"
42 #include "domain.h"
43 #include "gaussintegrationrule.h"
44 #include "gausspoint.h"
45 #include "fei3dtrquad.h"
46 #include "boundaryload.h"
47 #include "classfactory.h"
49 #include "xfem/XFEMDebugTools.h"
50 #include <string>
51 #include <sstream>
52 
53 
54 namespace oofem {
55 
56 REGISTER_Element( Tr2Shell7XFEM );
57 
59 
60 IntArray Tr2Shell7XFEM :: orderingDofTypes = {1, 2, 3, 8, 9, 10, 15, 16, 17, 22, 23, 24, 29, 30, 31, 36, 37, 38,
61  4, 5, 6, 11, 12, 13, 18, 19, 20, 25, 26, 27, 32, 33, 34, 39, 40, 41,
62  7, 14, 21, 28, 35, 42};
63 IntArray Tr2Shell7XFEM :: orderingNodes = {1, 2, 3, 19, 20, 21, 37, 4, 5, 6, 22, 23, 24, 38, 7, 8, 9, 25, 26, 27, 39,
64  10, 11, 12, 28, 29, 30, 40, 13, 14, 15, 31, 32, 33, 41, 16, 17, 18,
65  34, 35, 36, 42};
66 IntArray Tr2Shell7XFEM :: orderingEdgeNodes = {1, 2, 3, 10, 11, 12, 19, 4, 5, 6, 13, 14, 15, 20, 7, 8, 9, 16, 17, 18, 21};
67 
68 
70 {
71  this->numberOfDofMans = 6;
72 }
73 
74 const IntArray &
76 {
77  return this->orderingDofTypes;
78 }
79 
80 const IntArray &
82 {
83  return this->orderingNodes;
84 }
85 const IntArray &
87 {
88  return this->orderingEdgeNodes;
89 }
90 
91 
92 void
93 Tr2Shell7XFEM :: giveLocalNodeCoords(FloatArray &nodeLocalXiCoords, FloatArray &nodeLocalEtaCoords)
94 {
95  nodeLocalXiCoords = {1., 0., 0., .5, 0., .5}; // corner nodes then midnodes, uncertain of node numbering
96  nodeLocalEtaCoords = {0., 1., 0., .5, .5, 0.};
97 }
98 
99 
101 
102 
103 void
105 {
106 
107  this->xMan = this->giveDomain()->giveXfemManager();
108 
109  if ( integrationRulesArray.size() == 0 ) {
110  //if( this->xMan->isElementEnriched(this) ) {
112  //}
113  }
114 
115  int nPointsTri = 6; // points in the plane
116  if ( integrationRulesArray.size() == 0 ) {
117  // Cohesive zone
118  for ( int i = 1; i <= this->xMan->giveNumberOfEnrichmentItems(); i++ ) {
119  int numberOfInterfaces = this->layeredCS->giveNumberOfLayers()-1;
120  czIntegrationRulesArray.resize( numberOfInterfaces );
121  for ( int j = 0; j < numberOfInterfaces; j++ ) {
122  czIntegrationRulesArray [ j ].reset( new GaussIntegrationRule(1, this) );
123  czIntegrationRulesArray [ j ]->SetUpPointsOnTriangle(nPointsTri, _3dInterface);
124  }
125 
126  }
127  }
128 
129 
130 }
131 
132 
133 
134 
136 {
137  int nPointsTri = 6; // points in the plane
138 
139 
140  int numberOfLayers = this->layeredCS->giveNumberOfLayers();
141  int numPointsThickness = this->layeredCS->giveNumIntegrationPointsInLayer();
142  double totalThickness = this->layeredCS->computeIntegralThick();
143  int numEI = this->xMan->giveNumberOfEnrichmentItems();
144  std :: vector< std :: vector< FloatArray > >pointPartitions;
145 
146  integrationRulesArray.resize(numberOfLayers);
147  this->crackSubdivisions.resize(numberOfLayers); // Store the subdivisions for each layer (empty otherwise)
148  this->numSubDivisionsArray.resize(numberOfLayers); // number of subdivision for each - set this to one for layers not subdivided
149 
150  bool createdRule;
151  for ( int i = 0; i < numberOfLayers; i++ ) {
152  createdRule = false;
153 
154  double zMid_i = this->layeredCS->giveLayerMidZ(i+1); // global z-coord
155  double xiMid_i = 1.0 - 2.0 * ( totalThickness - this->layeredCS->giveMidSurfaceZcoordFromBottom() - zMid_i ) / totalThickness; // local xi-coord
156 
157  if ( this->xMan->isElementEnriched(this) ) {
158 
159  for ( int eiIndex = 1; eiIndex <= numEI; eiIndex++ ) {
160  EnrichmentItem *ei = this->xMan->giveEnrichmentItem(eiIndex);
161  if ( dynamic_cast< ShellCrack*> (ei) ) {
162 
163  // Determine if the crack goes through the current layer
164  if( this->evaluateHeavisideXi(xiMid_i, static_cast< ShellCrack* >(ei)) > 0) {
165 
166  // Get the points describing each subdivision of the element
167  double startXi, endXi;
168  bool intersection = false;
169  pointPartitions.resize(0);
170  this->XfemElementInterface_prepareNodesForDelaunay(pointPartitions, startXi, endXi, eiIndex, intersection);
171 
172  if ( intersection ) {
173  for ( int j = 0; j < int( pointPartitions.size() ); j++ ) {
174  // Triangulate the subdivisions
175  this->XfemElementInterface_partitionElement(this->crackSubdivisions [ i ], pointPartitions [ j ]);
176  }
177 
178 
179  integrationRulesArray [ i ].reset( new PatchIntegrationRule(i + 1, this, this->crackSubdivisions [ i ]) );
180  int nPointsTriSubTri = 3;
181  integrationRulesArray [ i ]->SetUpPointsOnWedge(nPointsTriSubTri, numPointsThickness, _3dMat);
182  this->numSubDivisionsArray [ i ] = this->crackSubdivisions [ i ].size();
183  createdRule = true;
184  continue;
185  }
186  }
187  }
188  }
189  }
190 
191  if( !createdRule ) {
192  integrationRulesArray [ i ].reset( new LayeredIntegrationRule(i + 1, this) );
193  integrationRulesArray [ i ]->SetUpPointsOnWedge(nPointsTri, numPointsThickness, _3dMat);
194  this->numSubDivisionsArray [ i ] = 1;
195  }
196 
197  }
198 
200 
201  // Cohesive zone
202  for ( int i = 1; i <= this->xMan->giveNumberOfEnrichmentItems(); i++ ) {
203  //Delamination *dei = dynamic_cast< Delamination * >( this->xMan->giveEnrichmentItem(i) );
204  int numberOfInterfaces = this->layeredCS->giveNumberOfLayers()-1;
205  czIntegrationRulesArray.resize(numberOfInterfaces);
206  for ( int j = 0; j < numberOfInterfaces; j++ ) {
207  czIntegrationRulesArray [ j ].reset( new GaussIntegrationRule(1, this) );
208  czIntegrationRulesArray [ j ]->SetUpPointsOnTriangle(nPointsTri, _3dInterface);
209  }
210  }
211 
212 
213  return true;
214 }
215 
216 
217 double
219 {
220 
221  //FEIElementGeometryWrapper(this);
222  return this->interpolation.giveArea( FEIElementGeometryWrapper(this) );
223 }
224 
225 void
227 {
228  /*
229  * provides dof mapping of local edge dofs (only nonzero are taken into account)
230  * to global element dofs
231  */
232 
233  if ( iEdge == 1 ) { // edge between nodes 1-4-2
234  answer = {1, 2, 3, 8, 9, 10, 22, 23, 24, 4, 5, 6, 11, 12, 13, 25, 26, 27, 7, 14, 28};
235 
236  } else if ( iEdge == 2 ) { // edge between nodes 2-5-3
237  answer = { 8, 9, 10, 15, 16, 17, 29, 30, 31, 11, 12, 13, 18, 19, 20, 32, 33, 34, 14, 21, 35};
238 
239  } else if ( iEdge == 3 ) { // edge between nodes 3-6-1
240  answer = { 15, 16, 17, 1, 2, 3, 36, 37, 38, 18, 19, 20, 4, 5, 6, 39, 40, 41, 21, 7, 42};
241  } else {
242  OOFEM_ERROR("wrong edge number");
243  }
244 }
245 
246 
247 void
249 {
250  answer.resize(42);
251  for( int i = 1; i <= 42; i++){
252  answer.at(i) = i;
253  }
254 }
255 
256 
257 // Integration
258 
259 double
261 {
262  FloatArray G1, G2, temp;
263  FloatMatrix Gcov;
264  FloatArray lCoords(3);
265  lCoords.at(1) = gp->giveNaturalCoordinate(1);
266  lCoords.at(2) = gp->giveNaturalCoordinate(2);
267  lCoords.at(3) = xi;
268  this->evalInitialCovarBaseVectorsAt(lCoords, Gcov);
269  G1.beColumnOf(Gcov,1);
270  G2.beColumnOf(Gcov,2);
271  temp.beVectorProductOf(G1, G2);
272  double detJ = temp.computeNorm();
273  return detJ *gp->giveWeight();
274 }
275 
276 
277 double
279 {
280  double detJ;
281  FloatMatrix Gcov;
282  FloatArray lcoords;
283  lcoords = gp->giveNaturalCoordinates();
284  this->evalInitialCovarBaseVectorsAt(lcoords, Gcov);
285  detJ = Gcov.giveDeterminant() * 0.5 * this->layeredCS->giveLayerThickness(layer);
286  return detJ *gp->giveWeight();
287 }
288 
289 
290 
291 } // end namespace oofem
292 
double giveDeterminant() const
Returns the trace (sum of diagonal components) of the receiver.
Definition: floatmatrix.C:1408
virtual void XfemElementInterface_prepareNodesForDelaunay(std::vector< std::vector< FloatArray > > &oPointPartitions, double &oCrackStartXi, double &oCrackEndXi, int iEnrItemIndex, bool &oIntersection)
Returns an array of array of points. Each array of points defines the points of a subregion of the el...
virtual const IntArray & giveOrderingNodes() const
Definition: tr2shell7xfem.C:81
double evaluateHeavisideXi(double xi, ShellCrack *ei)
Abstract class representing entity, which is included in the FE model using one (or more) global func...
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Computes vector product (or cross product) of vectors given as parameters, , and stores the result in...
Definition: floatarray.C:415
Class and object Domain.
Definition: domain.h:115
std::vector< std::vector< Triangle > > crackSubdivisions
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
LayeredCrossSection * layeredCS
Definition: shell7base.h:107
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Tr2Shell7XFEM(int n, Domain *d)
Definition: tr2shell7xfem.C:69
void mapLayerGpCoordsToShellCoords(std::vector< std::unique_ptr< IntegrationRule > > &layerIntegrationRulesArray)
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
XfemManager * giveXfemManager()
Definition: domain.C:375
virtual void giveLocalNodeCoords(FloatArray &nodeLocalXiCoords, FloatArray &nodeLocalEtaCoords)
Definition: tr2shell7xfem.C:93
virtual const IntArray & giveOrderingEdgeNodes() const
Definition: tr2shell7xfem.C:86
void beColumnOf(const FloatMatrix &mat, int col)
Reciever will be set to a given column in a matrix.
Definition: floatarray.C:1114
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
int giveNumberOfEnrichmentItems() const
Definition: xfemmanager.h:185
double computeIntegralThick()
Returns the total thickness of all layers.
void evalInitialCovarBaseVectorsAt(const FloatArray &lCoords, FloatMatrix &Gcov)
Definition: shell7base.C:222
double giveNaturalCoordinate(int i) const
Returns i-th natural element coordinate of receiver.
Definition: gausspoint.h:136
bool updateIntegrationRuleMultiCrack()
static IntArray orderingNodes
Definition: tr2shell7xfem.h:62
#define OOFEM_ERROR(...)
Definition: error.h:61
REGISTER_Element(LSpace)
double giveLayerThickness(int layer)
virtual double giveWeight()
Returns integration weight of receiver.
Definition: gausspoint.h:181
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
void resize(int n)
Checks size of receiver towards requested bounds.
Definition: intarray.C:124
std::vector< std::unique_ptr< IntegrationRule > > czIntegrationRulesArray
virtual double computeArea()
Computes the area (zero for all but 2d geometries).
virtual FEInterpolation * giveInterpolation() const
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
static IntArray orderingEdgeNodes
Definition: tr2shell7xfem.h:63
virtual double computeAreaAround(GaussPoint *gp, double xi)
static IntArray orderingDofTypes
Definition: tr2shell7xfem.h:61
static FEI3dTrQuad interpolation
Definition: tr2shell7xfem.h:60
double giveArea(const FEICellGeometry &cellgeo) const
Definition: fei3dtrquad.C:421
virtual const IntArray & giveOrderingDofTypes() const
Definition: tr2shell7xfem.C:75
double computeNorm() const
Computes the norm (or length) of the vector.
Definition: floatarray.C:840
bool isElementEnriched(const Element *elem)
Definition: xfemmanager.C:104
virtual double computeVolumeAroundLayer(GaussPoint *mastergp, int layer)
EnrichmentItem * giveEnrichmentItem(int n)
Definition: xfemmanager.h:184
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
virtual void XfemElementInterface_partitionElement(std::vector< Triangle > &oTriangles, const std::vector< FloatArray > &iPoints)
Partitions the element into patches by a triangulation.
Domain * giveDomain() const
Definition: femcmpnn.h:100
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
int numberOfDofMans
Number of dofmanagers.
Definition: element.h:149
virtual void giveEdgeDofMapping(IntArray &answer, int iEdge) const
Assembles edge dof mapping mask, which provides mapping between edge local DOFs and "global" element ...
PatchIntegrationRule provides integration over a triangle patch.
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138
Class representing Gaussian-quadrature integration rule.
virtual void giveSurfaceDofMapping(IntArray &answer, int iSurf) const
Assembles surface dof mapping mask, which provides mapping between surface local DOFs and "global" el...

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:32 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011