OOFEM 3.0
Loading...
Searching...
No Matches
crack.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#include "crack.h"
35#include "classfactory.h"
38#include "gausspoint.h"
39#include "geometry.h"
40
41#include "engngm.h"
43
44namespace oofem {
46
47Crack :: Crack(int n, XfemManager *xm, Domain *aDomain) : HybridEI(n, xm, aDomain)
48{
49 mpEnrichesDofsWithIdArray = {
50 D_u, D_v, D_w
51 };
52}
53
54void Crack :: initializeFrom(InputRecord &ir)
55{
56 EnrichmentItem :: initializeFrom(ir);
57}
58
59void Crack :: AppendCohesiveZoneGaussPoint(GaussPoint *ipGP)
60{
62
63 // Check that the material status is of an allowed type.
64 if(matStat == NULL) {
66
67 if(fe2ms == NULL) {
68 OOFEM_ERROR("The material status is not of an allowed type.")
69 }
70 }
71
72// if ( matStat ) {
73 // Compute arc length position of the Gauss point
74 const FloatArray &coord = ipGP->giveGlobalCoordinates();
75 double tangDist = 0.0, arcPos = 0.0;
76 mpBasicGeometry->computeTangentialSignDist(tangDist, coord, arcPos);
77
78 // Insert at correct position
79 std :: vector< GaussPoint * > :: iterator iteratorGP = mCohesiveZoneGaussPoints.begin();
80 std :: vector< double > :: iterator iteratorPos = mCohesiveZoneArcPositions.begin();
81 for ( size_t i = 0; i < mCohesiveZoneArcPositions.size(); i++ ) {
82 if ( arcPos > mCohesiveZoneArcPositions [ i ] ) {
83 iteratorGP++;
84 iteratorPos++;
85 }
86 }
87
88 mCohesiveZoneGaussPoints.insert(iteratorGP, ipGP);
89 mCohesiveZoneArcPositions.insert(iteratorPos, arcPos);
90// } else {
91// OOFEM_ERROR("matStat == NULL.")
92// }
93}
94
95void Crack :: callGnuplotExportModule(GnuplotExportModule &iExpMod, TimeStep *tStep)
96{
97 iExpMod.outputXFEM(* this, tStep);
98}
99
100void Crack :: computeCrackIntersectionPoints(Crack &iCrack, std :: vector< FloatArray > &oIntersectionPoints, std :: vector< double > &oArcPositions)
101{
102 const double tol = 1.0e-12;
103
104 // Enrichment domain of the current crack
105 PolygonLine *polygonLine1 = dynamic_cast< PolygonLine * >( mpBasicGeometry.get() );
106
107 // Enrichment domain of the crack given as input
108 PolygonLine *polygonLine2 = dynamic_cast< PolygonLine * >( iCrack.giveGeometry() );
109
110 if ( polygonLine1 != NULL && polygonLine2 != NULL ) {
111 polygonLine2->computeIntersectionPoints(* polygonLine1, oIntersectionPoints);
112
113 for ( FloatArray pos:oIntersectionPoints ) {
114 double tangDist, arcPos;
115 polygonLine1->computeTangentialSignDist(tangDist, pos, arcPos);
116
117 if ( arcPos < -tol || arcPos > ( 1.0 + tol ) ) {
118 printf("arcPos: %e\n", arcPos);
119 OOFEM_ERROR("arcPos is outside the allowed range [0,1].")
120 }
121
122 oArcPositions.push_back(arcPos);
123 }
124 }
125}
126
127void Crack :: computeArcPoints(const std :: vector< FloatArray > &iIntersectionPoints, std :: vector< double > &oArcPositions)
128{
129 const double tol = 1.0e-12;
130
131 // Enrichment domain of the current crack
132 PolygonLine *polygonLine1 = dynamic_cast< PolygonLine * >( mpBasicGeometry.get() );
133
134 if ( polygonLine1 != NULL ) {
135 for ( FloatArray pos:iIntersectionPoints ) {
136 double tangDist, arcPos;
137 polygonLine1->computeTangentialSignDist(tangDist, pos, arcPos);
138
139 if ( arcPos < -tol || arcPos > ( 1.0 + tol ) ) {
140 printf("arcPos: %e\n", arcPos);
141 OOFEM_ERROR("arcPos is outside the allowed range [0,1].")
142 }
143
144 oArcPositions.push_back(arcPos);
145 }
146 }
147}
148
149double Crack :: computeLength()
150{
151 PolygonLine *polygonLine = dynamic_cast< PolygonLine * >( mpBasicGeometry.get() );
152
153 if ( polygonLine != NULL ) {
154 return polygonLine->computeLength();
155 }
156
157 return 0.0;
158}
159
160int Crack :: giveDofPoolSize() const
161{
162 return this->giveEnrichesDofsWithIdArray()->giveSize() * this->giveNumberOfEnrDofs() + 5;
163}
164} // end namespace oofem
#define REGISTER_EnrichmentItem(class)
std ::vector< double > mCohesiveZoneArcPositions
Definition crack.h:91
Crack(int n, XfemManager *xm, Domain *aDomain)
std ::vector< GaussPoint * > mCohesiveZoneGaussPoints
Definition crack.h:90
int giveNumberOfEnrDofs() const
const IntArray * giveEnrichesDofsWithIdArray() const
const FloatArray & giveGlobalCoordinates()
Definition gausspoint.h:159
IntegrationPointStatus * giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default)
Definition gausspoint.h:204
std ::unique_ptr< BasicGeometry > mpBasicGeometry
BasicGeometry * giveGeometry()
void outputXFEM(EnrichmentItem &iEI, TimeStep *tStep)
void computeIntersectionPoints(Element *element, std ::vector< FloatArray > &oIntersectionPoints) override
Gives intersection points between this Geometry and Element.
Definition geometry.C:1409
void computeTangentialSignDist(double &oDist, const FloatArray &iPoint, double &oMinDistArcPos) const override
Definition geometry.C:942
double computeLength() const
Definition geometry.C:1083
#define OOFEM_ERROR(...)
Definition error.h:79

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