66 mStressThreshold(0.0),
67 mInitialCrackLength(0.0),
69 mIncrementLength(0.0),
70 mCrackPropThreshold(0.0),
87 std::vector<std::unique_ptr<EnrichmentItem>> eiList;
90 std::vector<FloatArray> center_coord_inserted_cracks;
95 int numIR = el->giveNumberOfIntegrationRules();
97 int csNum = el->giveCrossSection()->giveNumber();
101 for(
int irInd = 0; irInd < numIR; irInd++) {
108 for(
int gpInd = 0; gpInd < numGP; gpInd++) {
136 FloatArray crackTangent = {-crackNormal(1), crackNormal(0)};
156 std::vector<FloatArray> intersecPoints;
159 for (
int i = 1; i <= el->giveNumberOfDofManagers(); i++ ) {
176 if(intersecPoints.size() == 2) {
177 ps = std::move(intersecPoints[0]);
178 pe = std::move(intersecPoints[1]);
185 FloatArray points = {ps(0), ps(1), pc(0), pc(1), pe(0), pe(1)};
197 bool insertionAllowed =
true;
202 insertionAllowed =
false;
209 insertionAllowed =
false;
216 insertionAllowed =
false;
220 for(
const auto &x: center_coord_inserted_cracks) {
222 insertionAllowed =
false;
224 printf(
"Preventing insertion.\n");
228 if(insertionAllowed) {
234 std::unique_ptr<BasicGeometry> geom = std::unique_ptr<BasicGeometry>(
new PolygonLine());
235 geom->insertVertexBack(ps);
236 geom->insertVertexBack(pc);
237 geom->insertVertexBack(pe);
238 crack->setGeometry(std::move(geom));
242 crack->setEnrichmentFunction(ef);
247 crack->setEnrichmentFrontStart(efStart);
251 crack->setEnrichmentFrontEnd(efEnd);
279 crack->setPropagationLaw(pl);
281 crack->updateDofIdPool();
283 center_coord_inserted_cracks.push_back(pc);
284 eiList.push_back( std::unique_ptr<EnrichmentItem>(std::move(crack)) );
301 return std::move( eiList );
The base class for all spatial localizers.
#define _IFT_NCPrincipalStress_IncrementLength
#define _IFT_NCPrincipalStress_MatForceRadius
EnrFrontCohesiveBranchFuncOneEl.
For computing principal stresses.
Class representing the implementation of a dynamic data reader for in-code use.
void setIncrementLength(const double &iIncrementLength)
This class implements a structural material status information.
Abstract base class for all finite elements.
static void computePrincipalValDir(FloatArray &answer, FloatMatrix &dir, const FloatArray &s, stressStrainPrincMode mode)
Computes principal values and directions of stress or strain vector.
XfemManager * giveXfemManager()
Abstract class representing global shape function Base class declares abstract interface common to al...
Abstract base class representing integration rule.
virtual IRResultType initializeFrom(InputRecord *ir)
void beColumnOf(const FloatMatrix &mat, int col)
Reciever will be set to a given column in a matrix.
int giveNumberOfEnrichmentItems() const
#define _IFT_NCPrincipalStress_StressThreshold
virtual ~NCPrincipalStress()
virtual void appendInputRecords(DynamicDataReader &oDR)
REGISTER_NucleationCriterion(NCPrincipalStrain)
#define _IFT_NCPrincipalStress_CrackPropThreshold
Class EnrichmentFront: describes the edge or tip of an XFEM enrichment.
virtual const char * giveInputRecordName() const
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver's associated spatial localizer.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual IRResultType initializeFrom(InputRecord *ir)
#define _IFT_NCPrincipalStress_InitialCrackLength
virtual Element * giveElementContainingPoint(const FloatArray &coords, const IntArray *regionList=NULL)=0
Returns the element, containing given point and belonging to one of the region in region list...
double mCrackPropThreshold
const FloatArray & giveGlobalCoordinates()
Class representing vector of real numbers.
void setCrackPropThreshold(const double &iCrackPropThreshold)
Implementation of matrix containing floating point numbers.
This class manages the xfem part.
IRResultType
Type defining the return values of InputRecord reading operations.
GaussPoint * getIntegrationPoint(int n)
Access particular integration point of receiver.
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
bool isElementEnriched(const Element *elem)
Class representing Heaviside EnrichmentFunction.
int giveNumberOfIntegrationPoints() const
Returns number of integration points of receiver.
int mCrossSectionInd
Index of the cross section that the nucleation criterion applies to.
std::vector< std::unique_ptr< Element > > & giveElements()
bool mCutOneEl
If the initiated crack should cut exactly one element.
const FloatArray & giveTempStressVector() const
Returns the const pointer to receiver's temporary stress vector.
the oofem namespace is to define a context or scope in which all oofem names are defined.
EnrichmentFunction * mpEnrichmentFunc
double normalize()
Normalizes receiver.
virtual std::vector< std::unique_ptr< EnrichmentItem > > nucleateEnrichmentItems()
void setRadius(const double &iRadius)
Class representing integration point in finite element program.
void insertInputRecord(InputRecordType type, InputRecord *record)
Main purpose of this class it the possibility to add new input records in code.
double mInitialCrackLength
void add(const FloatArray &src)
Adds array src to receiver.
Propagation law that propagates the crack in the direction of the material force. ...