82 std::vector<std::unique_ptr<EnrichmentItem>> eiList;
85 std::vector<FloatArray> center_coord_inserted_cracks;
88 for(
auto &el :
mpDomain->giveElements() ) {
89 int numIR = el->giveNumberOfIntegrationRules();
90 int csNum = el->giveCrossSection()->giveNumber();
94 for(
int irInd = 0; irInd < numIR; irInd++) {
99 for(
int gpInd = 0; gpInd < numGP; gpInd++) {
147 std::vector<FloatArray> intersecPoints;
150 for (
int i = 1; i <= el->giveNumberOfDofManagers(); i++ ) {
167 if ( intersecPoints.size() == 2 ) {
168 ps = std::move(intersecPoints[0]);
169 pe = std::move(intersecPoints[1]);
175 FloatArray points =
Vec6(ps(0), ps(1), pc(0), pc(1), pe(0), pe(1));
187 bool insertionAllowed =
true;
192 insertionAllowed =
false;
199 insertionAllowed =
false;
206 insertionAllowed =
false;
210 for (
const auto &x: center_coord_inserted_cracks ) {
212 insertionAllowed =
false;
213 printf(
"Preventing insertion.\n");
218 if ( insertionAllowed ) {
220 std::unique_ptr<Crack> crack = std::make_unique<Crack>(n, xMan,
mpDomain);
224 std::unique_ptr<BasicGeometry> geom = std::make_unique<PolygonLine>();
225 geom->insertVertexBack(ps);
226 geom->insertVertexBack(pc);
227 geom->insertVertexBack(pe);
228 crack->setGeometry(std::move(geom));
231 crack->setEnrichmentFunction(std::make_unique<HeavisideFunction>(1,
mpDomain));
234 crack->setEnrichmentFrontStart(std::make_unique<EnrFrontCohesiveBranchFuncOneEl>());
236 crack->setEnrichmentFrontEnd(std::make_unique<EnrFrontCohesiveBranchFuncOneEl>());
257 auto pl = std::make_unique<PLMaterialForce>();
264 crack->setPropagationLaw(std::move(pl));
266 crack->updateDofIdPool();
268 center_coord_inserted_cracks.push_back(pc);
269 eiList.push_back( std::unique_ptr<EnrichmentItem>(std::move(crack)) );
static FloatArray Vec6(const double &a, const double &b, const double &c, const double &d, const double &e, const double &f)