OOFEM 3.0
Loading...
Searching...
No Matches
plczdamageradius.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
41
42#include "xfem/propagationlaw.h"
43#include "xfem/tipinfo.h"
45#include "xfem/xfemmanager.h"
46#include "classfactory.h"
47#include "domain.h"
48#include "mathfem.h"
49#include "dynamicinputrecord.h"
50#include "spatiallocalizer.h"
51#include "connectivitytable.h"
52
53namespace oofem {
55
56
57void PLCZdamageRadius :: initializeFrom(InputRecord &ir)
58{
62}
63
64void PLCZdamageRadius :: giveInputRecord(DynamicInputRecord &input)
65{
66 int number = 1;
67 input.setRecordKeywordField(this->giveInputRecordName(), number);
68
72
73}
74
75bool PLCZdamageRadius :: propagateInterface(Domain &iDomain, EnrichmentFront &iEnrFront, TipPropagation &oTipProp)
76{
77 if ( !iEnrFront.propagationIsAllowed() ) {
78 printf("EnrichmentFront.propagationIsAllowed is false \n");
79 return false;
80 }
81
82 const TipInfo &iTipInfo = iEnrFront.giveTipInfo(); // includes the dofman numbers which represent the boundary of the EI.
83 //tipInfo.mTipDofManNumbers.printYourself();
84
85 // No listbased tip (or EI) present, so nothing to propagate.
86 if ( iTipInfo.mTipDofManNumbers.giveSize() == 0 ) {
87 printf("No dofmans in tip; nothing to propagate. \n");
88 return false;
89 }
90
91 // Find enriched elements (only implmented for delamination and shell7xfembase)
92
93 IntArray propagationDF;
94 int EIindex(iEnrFront.mEIindex);
95 IntArray tipDFnumbers(iTipInfo.mTipDofManNumbers); tipDFnumbers.sort();
96 EnrichmentItem *ei = iDomain.giveXfemManager()->giveEnrichmentItem(EIindex);
97
98 if ( Delamination* dei = dynamic_cast < Delamination* > ( ei ) ) {
99
100 // Find elements to propagate from (remove any elements not in delamination cross sections)
101 IntArray EIelements, tempEIelements, CSelements;
102 iDomain.giveConnectivityTable()->giveNodeNeighbourList(tempEIelements,tipDFnumbers);
103 for (int CSnum : dei->giveDelamCrossSectionNum()) {
104 CrossSection *CS = iDomain.giveCrossSection(CSnum);
105 if (this->mPropCS.contains(CS->giveNumber()) || this->mPropCS.containsOnlyZeroes() ) {
106 CSelements.followedBy(iDomain.giveSet(CS->giveSetNumber())->giveElementList());
107 }
108 }
109 CSelements.sort();
110 tempEIelements.findCommonValuesSorted(CSelements,EIelements);
111
112 for ( int iElt : EIelements ) {
113
114 bool CZdamageThresholdMet = false;
115 double maxDamage(0.0);
116 double CZdamage(0.0);
117 Element *elt = iDomain.giveElement(iElt);
118
119 if ( Shell7BaseXFEM *shellElt = dynamic_cast < Shell7BaseXFEM * > (elt) ) {
120
121 int interfaceMatNumber(shellElt->giveLayeredCS()->giveInterfaceMaterialNum(dei->giveDelamInterfaceNum()));
122
123 if (interfaceMatNumber) {
124
125 StructuralInterfaceMaterial *intMat = dynamic_cast < StructuralInterfaceMaterial * > (shellElt->giveLayeredCS()->giveInterfaceMaterial(dei->giveDelamInterfaceNum()) );
126 if (intMat == 0) {
127 OOFEM_ERROR("NULL pointer to material, interface %i",dei->giveDelamInterfaceNum());
128 }
129
130 for (GaussPoint *gp: *shellElt->czIntegrationRulesArray[ dei->giveDelamInterfaceNum() - 1 ]) {
131
132 StructuralInterfaceMaterialStatus *intMatStatus = static_cast < StructuralInterfaceMaterialStatus * >( intMat->giveStatus(gp) );
133 if (intMatStatus == 0) {
134 OOFEM_ERROR("NULL pointer to material status");
135 }
136 CZdamage = intMatStatus->giveTempDamage();
137 if (CZdamage > maxDamage) {maxDamage = CZdamage;}
138 if (CZdamage >= this->mDamageThreshold) {
139 CZdamageThresholdMet = true;
140 break;
141 }
142 }
143 //printf(" Max damage in element %i: %f \n",shellElt->giveNumber(),maxDamage);
144 } else {
145 // No interface material. Treat interface as fully damaged.
146 CZdamageThresholdMet = true;
147 CZdamage = 1.1;
148 //printf(" interface %i has no material in element %i. Interface treated as fully damaged \n",dei->giveDelamInterfaceNum(),shellElt->giveNumber());
149 }
150
151 if (CZdamageThresholdMet) {
152 for (int iDF : shellElt->giveDofManArray() ) {
153 //if ( tipDFnumbers.findSorted(iDF) ) {
154 propagationDF.insertSortedOnce(iDF);
155 //}
156 }
157// if (CZdamage < 1.1) {
158// printf(" Damage threshold (%f) met in element %i \n",CZdamage,shellElt->giveNumber());
159// }
160 }
161
162 } else {
163 OOFEM_ERROR("Propagation law CZ-damage not implemented for element type %s",elt->giveClassName() );
164 }
165 }
166
167 } else {
168 OOFEM_ERROR("Propagation law CZ-damage not implemented for enrichment type %s",ei->giveClassName() );
169 }
170
171
172 // Localise nodes within certain radius from tip nodes
174 SpatialLocalizer *localizer = iDomain.giveSpatialLocalizer();
175 //propagationDF.printYourself("propagationDofMans");
176
177 for ( int i = 1 ; i <= propagationDF.giveSize() ; i++ ) {
178
179 Node *iNode = iDomain.giveNode(propagationDF.at(i));
180 const auto &gCoords = iNode->giveCoordinates();
181
182 std :: list< int > nodeList;
183 localizer->giveAllNodesWithinBox(nodeList, gCoords, mIncrementRadius);
184 for ( int jNode : nodeList ) {
185 //printf("nodeList node %d \n",jNode);
187 }
188
189 }
190 //oTipProp.mPropagationDofManNumbers.printYourself(" The following noded will be propagated to:");
191
192 return true;
193}
194} // end namespace oofem
#define REGISTER_PropagationLaw(class)
void giveNodeNeighbourList(IntArray &answer, IntArray &nodeList)
int giveSetNumber() const
const FloatArray & giveCoordinates() const
Definition dofmanager.h:390
SpatialLocalizer * giveSpatialLocalizer()
Definition domain.C:1255
ConnectivityTable * giveConnectivityTable()
Definition domain.C:1240
Set * giveSet(int n)
Definition domain.C:366
Element * giveElement(int n)
Definition domain.C:165
Node * giveNode(int n)
Definition domain.h:398
XfemManager * giveXfemManager()
Definition domain.C:378
CrossSection * giveCrossSection(int n)
Definition domain.C:342
void setRecordKeywordField(std ::string keyword, int number)
void setField(int item, InputFieldType id)
const char * giveClassName() const override
Definition element.h:1219
const TipInfo & giveTipInfo() const
virtual bool propagationIsAllowed() const
virtual const char * giveClassName() const =0
int giveNumber() const
Definition femcmpnn.h:104
bool insertSortedOnce(int value, int allocChunk=0)
Definition intarray.C:309
void followedBy(const IntArray &b, int allocChunk=0)
Definition intarray.C:94
int findCommonValuesSorted(const IntArray &iarray, IntArray &common, int allocChunk=0) const
Definition intarray.C:332
int & at(std::size_t i)
Definition intarray.h:104
int giveSize() const
Definition intarray.h:211
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
const char * giveInputRecordName() const override
const IntArray & giveElementList()
Definition set.C:158
virtual void giveAllNodesWithinBox(nodeContainerType &nodeList, const FloatArray &coords, const double radius)=0
IntArray mTipDofManNumbers
Local number of which edge the crack enters the element (2d).
Definition tipinfo.h:36
EnrichmentItem * giveEnrichmentItem(int n)
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define _IFT_PLCZdamageRadius_PropagationCS
Cross sections (must be part of csnum) viable for propagation.
#define _IFT_PLCZdamageRadius_DamageThreshold
Damage threshold [0,1] for propagation.
#define _IFT_PLCZdamageRadius_IncRadius
Increment radius (from element nodes) per time step.
IntArray mPropagationDofManNumbers
Definition tipinfo.h:46

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