54 mNonstandardCz(false),
68 if ( splitCracks == 1 ) {
74 if ( nonStdCz == 1 ) {
129 oAnyFronHasPropagated =
false;
133 bool eiHasPropagated =
false;
134 ei->propagateFronts(eiHasPropagated);
136 if ( eiHasPropagated ) {
137 oAnyFronHasPropagated =
true;
157 for (
int j = 1; j < i; j++ ) {
160 bool splittedCrack =
false;
166 std :: vector< FloatArray >intersectionPoints;
167 std :: vector< double >arcPositions_i, arcPositions_j;
171 const double arcLengthTol = 1.0e-6;
173 for (
int k = 0; k < int( arcPositions_i.size() ); k++ ) {
174 if ( arcPositions_i [ k ] < arcLengthTol || arcPositions_i [ k ] > ( 1.0 - arcLengthTol ) || arcPositions_j [ k ] < arcLengthTol || arcPositions_j [ k ] > ( 1.0 - arcLengthTol ) ) {
175 arcPositions_i.erase(arcPositions_i.begin() + k);
176 arcPositions_j.erase(arcPositions_j.begin() + k);
181 if ( arcPositions_i.size() > 0 ) {
182 arcPositions_i.insert(arcPositions_i.begin(), 0.0);
183 arcPositions_i.push_back(1.0);
184 arcPositions_j.insert(arcPositions_j.begin(), 0.0);
185 arcPositions_j.push_back(1.0);
187 for (
int k = 1; k < int( arcPositions_i.size() ); k++ ) {
189 if ( fabs(arcPositions_i [ k ] - arcPositions_i [ k - 1 ]) > arcLengthTol ) {
200 std :: unique_ptr< EnrichmentItem >newEI_1(newCrack);
203 newEI_1->initializeFrom(ir);
204 newEI_1->instanciateYourself(dataReader);
213 new_pl->
cropPolygon(arcPositions_i [ k - 1 ], arcPositions_i [ k ]);
218 if ( polygonLine_j == NULL ) {
219 OOFEM_ERROR(
"Failed to cast PolygonLine *polygonLine_j.")
224 if ( polygonLine_i == NULL ) {
225 OOFEM_ERROR(
"Failed to cast PolygonLine *polygonLine_i.")
254 polygonLine_j->
giveNormal(frontTangent1, arcPositions_j [ k - 1 ]);
257 polygonLine_i->
giveTangent(crackTangent1, arcPositions_i [ k - 1 ]);
258 crackTangent1.
times(-1.0);
262 if ( frontTangent1.
dotProduct(crackTangent1) < 0.0 ) {
263 frontTangent1.
times(-1.0);
267 newEI_1->setEnrichmentFrontStart(ef);
270 if ( k <
int( arcPositions_i.size() ) - 1 ) {
272 polygonLine_j->
giveNormal(frontTangent1, arcPositions_j [ k ]);
275 polygonLine_i->
giveTangent(crackTangent1, arcPositions_i [ k ]);
279 if ( frontTangent1.
dotProduct(crackTangent1) < 0.0 ) {
280 frontTangent1.
times(-1.0);
284 newEI_1->setEnrichmentFrontEnd(ef);
290 newEI_1->updateGeometry();
294 splittedCrack =
true;
300 if ( splittedCrack ) {
339 printf(
"Removing short crack with l: %e\n", l);
348 polygonLine->
clear();
384 bg_i->
giveTips(startTip_i, endTip_i) ;
391 if ( !polygonLine_i ) {
392 OOFEM_ERROR(
"Failed to cast PolygonLine *polygonLine_i.")
409 bg_j->
giveTips(startTip_j, endTip_j) ;
416 if ( !polygonLine_j ) {
417 OOFEM_ERROR(
"Failed to cast PolygonLine *polygonLine_j.")
421 if ( ps_i.
distance(ps_j) < dist_tol ) {
422 printf(
"ps_i.distance(ps_j) < dist_tol\n");
426 printf(
"Preventing merge due to parallel tips.\n");
430 for (
int k = 1; k <= n; k++) {
437 polygonLine_j->
clear();
455 if ( ps_i.
distance(pe_j) < dist_tol ) {
456 printf(
"ps_i.distance(pe_j) < dist_tol\n");
460 printf(
"Preventing merge due to parallel tips.\n");
465 for(
int k = n; k > 0; k--) {
472 polygonLine_j->
clear();
490 if ( pe_i.
distance(ps_j) < dist_tol ) {
491 printf(
"pe_i.distance(ps_j) < dist_tol\n");
494 printf(
"Preventing merge due to parallel tips.\n");
499 for(
int k = 1; k <= n; k++) {
506 polygonLine_j->
clear();
523 if ( pe_i.
distance(pe_j) < dist_tol ) {
524 printf(
"pe_i.distance(pe_j) < dist_tol\n");
527 printf(
"Preventing merge due to parallel tips.\n");
532 for(
int k = n; k > 0; k--) {
538 polygonLine_j->
clear();
const FloatArray & giveVertex(int n) const
void setEnrichmentFrontStart(EnrichmentFront *ipEnrichmentFrontStart, bool iDeleteOld=true)
virtual ~XfemStructureManager()
void removeDuplicatePoints(const double &iTolSquare)
EnrichmentFront * giveEnrichmentFrontStart()
virtual void giveInputRecord(DynamicInputRecord &input)
Class representing the implementation of a dynamic data reader for in-code use.
virtual void updateYourself(TimeStep *tStep)
Update enrichment items (level sets).
virtual void updateYourself(TimeStep *tStep)
Update enrichment items (level sets).
int giveNrVertices() const
Returns number of Geometry vertices.
void insertVertexBack(const FloatArray &iP)
TipInfo gathers useful information about a crack tip, like its position and tangent direction...
void giveNormal(FloatArray &oNormal, const double &iArcPosition) const
Class representing the abstraction for input data source.
XfemStructureManager: XFEM manager with extra functionality specific for the sm module.
void computeCrackIntersectionPoints(Crack &iCrack, std::vector< FloatArray > &oIntersectionPoints, std::vector< double > &oArcPositions)
Abstract representation of Geometry.
void setEnrichmentFrontEnd(EnrichmentFront *ipEnrichmentFrontEnd, bool iDeleteOld=true)
virtual void giveInputRecord(DynamicInputRecord &input)
virtual void propagateFronts(bool &oAnyFronHasPropagated)
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
int giveNumberOfEnrichmentItems() const
bool mSplitCracks
If cracks should be splitted at intersections as a pre-processing step.
std::vector< std::unique_ptr< EnrichmentItem > > enrichmentItemList
Enrichment item list.
virtual InputRecord * giveInputRecord(InputRecordType, int recordId)
Returns input record corresponding to given InputRecordType value and its record_id.
int numberOfEnrichmentItems
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
Class EnrichmentFront: describes the edge or tip of an XFEM enrichment.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void computeArcPoints(const std::vector< FloatArray > &iIntersectionPoints, std::vector< double > &oArcPositions)
REGISTER_XfemManager(XfemManager)
void updateNodeEnrichmentItemMap()
#define _IFT_XfemStructureManager_nonstandardCZ
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Class representing vector of real numbers.
This class manages the xfem part.
IRResultType
Type defining the return values of InputRecord reading operations.
BasicGeometry * giveGeometry()
void setTangent(FloatArray iTangent)
virtual int instanciateYourself(DataReader &dr)
bool tipsHaveOppositeDirection(EnrichmentFront *iEf1, EnrichmentFront *iEf2)
bool mNonstandardCz
If a non-standard cohesive zone formulation should be used.
void times(double s)
Multiplies receiver with scalar.
EnrichmentItem * giveEnrichmentItem(int n)
void insertVertexFront(const FloatArray &iP)
virtual bool giveTips(TipInfo &oStartTipInfo, TipInfo &oEndTipInfo) const
Returns start and end tip of the geometry, if applicable.
virtual int instanciateYourself(DataReader &dr)
const TipInfo & giveTipInfo() const
void cropPolygon(const double &iArcPosStart, const double &iArcPosEnd)
Keep only a part of the underlying geometry, characterized by iArcPosStart and iArcPosEnd.
double computeTotalCrackLength()
Compute the total length of all cracks in the domain.
Evaluates material forces.
double mMinCrackLength
Cracks shorter than this length are automatically removed.
the oofem namespace is to define a context or scope in which all oofem names are defined.
double mCrackMergeTol
Cracks with tips closer than this distance are automatically merged.
Class representing solution step.
#define _IFT_XfemStructureManager_crackMergeTol
virtual void appendInputRecords(DynamicDataReader &oDR)
EnrichmentFront * giveEnrichmentFrontEnd()
#define _IFT_XfemStructureManager_splitCracks
#define _IFT_XfemStructureManager_minCrackLength
virtual void giveTangent(FloatArray &oTangent, const double &iArcPosition) const
Computes tangential direction at given local coordinate (arcPos)