OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 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 #include "crack.h"
35 #include "classfactory.h"
36 #include "../sm/Materials/InterfaceMaterials/structuralinterfacematerialstatus.h"
38 #include "gausspoint.h"
39 #include "geometry.h"
40 
41 #include "engngm.h"
43 
44 namespace oofem {
46 
47 Crack :: Crack(int n, XfemManager *xm, Domain *aDomain) : HybridEI(n, xm, aDomain)
48 {
49  mpEnrichesDofsWithIdArray = {
50  D_u, D_v, D_w
51  };
52 }
53 
55 {
57 }
58 
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 
96 {
97  iExpMod.outputXFEM(* this, tStep);
98 }
99 
100 void 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 
127 void 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 
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 
161 {
162  return this->giveEnrichesDofsWithIdArray()->giveSize() * this->giveNumberOfEnrDofs() + 5;
163 }
164 } // end namespace oofem
std::unique_ptr< BasicGeometry > mpBasicGeometry
Class and object Domain.
Definition: domain.h:115
void outputXFEM(EnrichmentItem &iEI, TimeStep *tStep)
XFEM output.
virtual void callGnuplotExportModule(GnuplotExportModule &iExpMod, TimeStep *tStep)
Definition: crack.C:95
virtual int giveDofPoolSize() const
Definition: crack.C:160
EnrichmentItem with hybrid geometry description in the following sense: We have a BasicGeometry to de...
Definition: hybridei.h:54
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void computeCrackIntersectionPoints(Crack &iCrack, std::vector< FloatArray > &oIntersectionPoints, std::vector< double > &oArcPositions)
Definition: crack.C:100
void AppendCohesiveZoneGaussPoint(GaussPoint *ipGP)
Definition: crack.C:59
int giveNumberOfEnrDofs() const
REGISTER_EnrichmentItem(HybridEI)
Definition: hybridei.C:46
double computeLength() const
Definition: geometry.C:1095
Crack.
Definition: crack.h:54
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual void computeTangentialSignDist(double &oDist, const FloatArray &iPoint, double &oMinDistArcPos) const
Definition: geometry.C:954
This class implements a structural interface material status information.
void computeArcPoints(const std::vector< FloatArray > &iIntersectionPoints, std::vector< double > &oArcPositions)
Definition: crack.C:127
const FloatArray & giveGlobalCoordinates()
Definition: gausspoint.h:160
const IntArray * giveEnrichesDofsWithIdArray() const
Class representing vector of real numbers.
Definition: floatarray.h:82
This class manages the xfem part.
Definition: xfemmanager.h:109
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
std::vector< GaussPoint * > mCohesiveZoneGaussPoints
Array of pointers to the Gauss points related to the cohesive zone.
Definition: crack.h:90
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
Definition: gausspoint.h:205
Class representing the general Input Record.
Definition: inputrecord.h:101
BasicGeometry * giveGeometry()
double computeLength()
Definition: crack.C:149
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: crack.C:54
int giveSize() const
Definition: intarray.h:203
virtual void computeIntersectionPoints(Element *element, std::vector< FloatArray > &oIntersectionPoints)
Gives intersection points between this Geometry and Element.
Definition: geometry.C:1427
std::vector< double > mCohesiveZoneArcPositions
Definition: crack.h:91
the oofem namespace is to define a context or scope in which all oofem names are defined.
(Under development) The Gnuplot export module enables OOFEM to export some data in a format that can ...
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80

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