67 mStrainThreshold(0.0),
68 mInitialCrackLength(0.0),
69 mIncrementLength(1.0),
70 mPropStrainThreshold(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++) {
107 for(
int gpInd = 0; gpInd < numGP; gpInd++) {
127 FloatArray crackTangent = {-crackNormal(1), crackNormal(0)};
146 std::vector<FloatArray> intersecPoints;
150 if(intersecPoints.size() == 2) {
151 ps = std::move(intersecPoints[0]);
152 pe = std::move(intersecPoints[1]);
159 FloatArray points = {ps(0), ps(1), pc(0), pc(1), pe(0), pe(1)};
165 bool insertionAllowed =
true;
170 insertionAllowed =
false;
177 insertionAllowed =
false;
184 insertionAllowed =
false;
188 for(
const auto &x: center_coord_inserted_cracks) {
190 insertionAllowed =
false;
192 printf(
"Preventing insertion.\n");
196 if(insertionAllowed) {
202 std::unique_ptr<BasicGeometry> geom = std::unique_ptr<BasicGeometry>(
new PolygonLine());
203 geom->insertVertexBack(ps);
204 geom->insertVertexBack(pc);
205 geom->insertVertexBack(pe);
206 crack->setGeometry(std::move(geom));
210 crack->setEnrichmentFunction(ef);
215 crack->setEnrichmentFrontStart(efStart);
219 crack->setEnrichmentFrontEnd(efEnd);
233 crack->setPropagationLaw(pl);
235 crack->updateDofIdPool();
237 center_coord_inserted_cracks.push_back(pc);
238 eiList.push_back( std::unique_ptr<EnrichmentItem>(std::move(crack)) );
240 printf(
"NCPrincipalStrain: Nucleating a crack. principalVals[0]: %e\n", principalVals[0] );
254 return std::move( eiList );
The base class for all spatial localizers.
EnrFrontCohesiveBranchFuncOneEl.
Class representing the implementation of a dynamic data reader for in-code use.
For computing principal strains from engineering strains.
virtual const char * giveInputRecordName() const
#define _IFT_NCPrincipalStrain_StrainThreshold
int mCrossSectionInd
Index of the cross section that the nucleation criterion applies to.
This class implements a structural material status information.
bool mCutOneEl
If the initiated crack should cut exactly one element.
virtual void appendInputRecords(DynamicDataReader &oDR)
double mPropStrainThreshold
Abstract base class for all finite elements.
virtual IRResultType initializeFrom(InputRecord *ir)
#define _IFT_NCPrincipalStrain_IncrementLength
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.
void beColumnOf(const FloatMatrix &mat, int col)
Reciever will be set to a given column in a matrix.
int giveNumberOfEnrichmentItems() const
virtual ~NCPrincipalStrain()
REGISTER_NucleationCriterion(NCPrincipalStrain)
Class EnrichmentFront: describes the edge or tip of an XFEM enrichment.
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver's associated spatial localizer.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver's temporary strain vector.
virtual IRResultType initializeFrom(InputRecord *ir)
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...
const FloatArray & giveGlobalCoordinates()
#define _IFT_NCPrincipalStrain_PropStrainThreshold
void setIncrementLength(double iIncrementLength)
Class representing vector of real numbers.
virtual std::vector< std::unique_ptr< EnrichmentItem > > nucleateEnrichmentItems()
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.
double mInitialCrackLength
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.
void setStrainThreshold(double iStrainThreshold)
#define _IFT_NCPrincipalStrain_InitialCrackLength
void setRadius(double iRadius)
std::vector< std::unique_ptr< Element > > & giveElements()
the oofem namespace is to define a context or scope in which all oofem names are defined.
EnrichmentFunction * mpEnrichmentFunc
double normalize()
Normalizes receiver.
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.
void add(const FloatArray &src)
Adds array src to receiver.