OOFEM 3.0
Loading...
Searching...
No Matches
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 - 2025 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
39#include "node.h"
40#include "load.h"
41#include "mathfem.h"
42#include "domain.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
54namespace oofem {
55
57
58FEI3dTrQuad Tr2Shell7XFEM :: interpolation;
59
60IntArray 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};
63IntArray 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};
66IntArray 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
69Tr2Shell7XFEM :: Tr2Shell7XFEM(int n, Domain *aDomain) : Shell7BaseXFEM(n, aDomain)
70{
71 this->numberOfDofMans = 6;
72}
73
74const IntArray &
75Tr2Shell7XFEM :: giveOrderingDofTypes() const
76{
77 return this->orderingDofTypes;
78}
79
80const IntArray &
81Tr2Shell7XFEM :: giveOrderingNodes() const
82{
83 return this->orderingNodes;
84}
85const IntArray &
86Tr2Shell7XFEM :: giveOrderingEdgeNodes() const
87{
88 return this->orderingEdgeNodes;
89}
90
91
92void
93Tr2Shell7XFEM :: giveLocalNodeCoords(FloatArray &nodeLocalXiCoords, FloatArray &nodeLocalEtaCoords)
94{
95 nodeLocalXiCoords = Vec6(1., 0., 0., .5, 0., .5); // corner nodes then midnodes, uncertain of node numbering
96 nodeLocalEtaCoords = Vec6(0., 1., 0., .5, .5, 0.);
97}
98
99
100FEInterpolation* Tr2Shell7XFEM :: giveInterpolation() const { return &interpolation; }
101
102
103void
104Tr2Shell7XFEM :: computeGaussPoints()
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 ] = std::make_unique<GaussIntegrationRule>(1, this);
123 czIntegrationRulesArray [ j ]->SetUpPointsOnTriangle(nPointsTri, _3dInterface);
124 }
125
126 }
127 }
128
129
130}
131
132
133
134
135bool Tr2Shell7XFEM :: updateIntegrationRuleMultiCrack()
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 integrationRulesArray [ i ] = std::make_unique<PatchIntegrationRule>(i + 1, this, this->crackSubdivisions [ i ]);
179 integrationRulesArray [ i ]->SetUpPointsOnWedge(3, numPointsThickness, _3dMat);
180 this->numSubDivisionsArray [ i ] = this->crackSubdivisions [ i ].size();
181 createdRule = true;
182 continue;
183 }
184 }
185 }
186 }
187 }
188
189 if( !createdRule ) {
190 integrationRulesArray [ i ] = std::make_unique<LayeredIntegrationRule>(i + 1, this);
191 integrationRulesArray [ i ]->SetUpPointsOnWedge(nPointsTri, numPointsThickness, _3dMat);
192 this->numSubDivisionsArray [ i ] = 1;
193 }
194
195 }
196
197 this->layeredCS->mapLayerGpCoordsToShellCoords(integrationRulesArray);
198
199 // Cohesive zone
200 for ( int i = 1; i <= this->xMan->giveNumberOfEnrichmentItems(); i++ ) {
201 //Delamination *dei = dynamic_cast< Delamination * >( this->xMan->giveEnrichmentItem(i) );
202 int numberOfInterfaces = this->layeredCS->giveNumberOfLayers()-1;
203 czIntegrationRulesArray.resize(numberOfInterfaces);
204 for ( int j = 0; j < numberOfInterfaces; j++ ) {
205 czIntegrationRulesArray [ j ] = std::make_unique<GaussIntegrationRule>(1, this);
206 czIntegrationRulesArray [ j ]->SetUpPointsOnTriangle(nPointsTri, _3dInterface);
207 }
208 }
209
210
211 return true;
212}
213
214
215double
216Tr2Shell7XFEM :: computeArea()
217{
218
219 //FEIElementGeometryWrapper(this);
220 return this->interpolation.giveArea( FEIElementGeometryWrapper(this) );
221}
222
223void
224Tr2Shell7XFEM :: giveEdgeDofMapping(IntArray &answer, int iEdge) const
225{
226 /*
227 * provides dof mapping of local edge dofs (only nonzero are taken into account)
228 * to global element dofs
229 */
230
231 if ( iEdge == 1 ) { // edge between nodes 1-4-2
232 answer = {1, 2, 3, 8, 9, 10, 22, 23, 24, 4, 5, 6, 11, 12, 13, 25, 26, 27, 7, 14, 28};
233
234 } else if ( iEdge == 2 ) { // edge between nodes 2-5-3
235 answer = { 8, 9, 10, 15, 16, 17, 29, 30, 31, 11, 12, 13, 18, 19, 20, 32, 33, 34, 14, 21, 35};
236
237 } else if ( iEdge == 3 ) { // edge between nodes 3-6-1
238 answer = { 15, 16, 17, 1, 2, 3, 36, 37, 38, 18, 19, 20, 4, 5, 6, 39, 40, 41, 21, 7, 42};
239 } else {
240 OOFEM_ERROR("wrong edge number");
241 }
242}
243
244
245void
246Tr2Shell7XFEM :: giveSurfaceDofMapping(IntArray &answer, int iSurf) const
247{
248 answer.resize(42);
249 for( int i = 1; i <= 42; i++){
250 answer.at(i) = i;
251 }
252}
253
254
255// Integration
256
257double
258Tr2Shell7XFEM :: computeAreaAround(GaussPoint *gp, double xi)
259{
260 FloatArrayF<3> lCoords;
261 lCoords.at(1) = gp->giveNaturalCoordinate(1);
262 lCoords.at(2) = gp->giveNaturalCoordinate(2);
263 lCoords.at(3) = xi;
264 auto Gcov = this->evalInitialCovarBaseVectorsAt(lCoords);
265 auto G1 = Gcov.column(0);
266 auto G2 = Gcov.column(1);
267 auto temp = cross(G1, G2);
268 double detJ = norm(temp);
269 return detJ *gp->giveWeight();
270}
271
272
273double
274Tr2Shell7XFEM :: computeVolumeAroundLayer(GaussPoint *gp, int layer)
275{
276 const auto &lcoords = gp->giveNaturalCoordinates();
277 auto Gcov = this->evalInitialCovarBaseVectorsAt(lcoords);
278 double detJ = det(Gcov) * 0.5 * this->layeredCS->giveLayerThickness(layer);
279 return detJ *gp->giveWeight();
280}
281
282
283} // end namespace oofem
284
#define REGISTER_Element(class)
int numberOfDofMans
Number of dofmanagers.
Definition element.h:136
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
Definition element.h:157
Domain * giveDomain() const
Definition femcmpnn.h:97
double & at(std::size_t i)
double giveNaturalCoordinate(int i) const
Returns i-th natural element coordinate of receiver.
Definition gausspoint.h:136
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
Definition gausspoint.h:138
double giveWeight()
Returns integration weight of receiver.
Definition gausspoint.h:180
void resize(int n)
Definition intarray.C:73
int & at(std::size_t i)
Definition intarray.h:104
std ::vector< std ::unique_ptr< IntegrationRule > > czIntegrationRulesArray
Shell7BaseXFEM(int n, Domain *d)
std ::vector< std ::vector< Triangle > > crackSubdivisions
double evaluateHeavisideXi(double xi, ShellCrack *ei)
FloatMatrixF< 3, 3 > evalInitialCovarBaseVectorsAt(const FloatArrayF< 3 > &lCoords)
Definition shell7base.C:220
LayeredCrossSection * layeredCS
Definition shell7base.h:113
bool updateIntegrationRuleMultiCrack()
static IntArray orderingEdgeNodes
static FEI3dTrQuad interpolation
static IntArray orderingNodes
static IntArray orderingDofTypes
virtual void XfemElementInterface_partitionElement(std ::vector< Triangle > &oTriangles, const std ::vector< FloatArray > &iPoints)
Partitions the element into patches by a triangulation.
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...
#define OOFEM_ERROR(...)
Definition error.h:79
double norm(const FloatArray &x)
static FloatArray Vec6(const double &a, const double &b, const double &c, const double &d, const double &e, const double &f)
Definition floatarray.h:610
double det(const FloatMatrixF< 2, 2 > &mat)
Computes the determinant.
FloatArrayF< 3 > cross(const FloatArrayF< 3 > &x, const FloatArrayF< 3 > &y)
Computes $ x \cross y $.

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011