8#ifndef model_CrackMeshGenerator_cpp_
9#define model_CrackMeshGenerator_cpp_
21 if(spec.nodes.rows()!=spec.burgers.rows())
23 throw std::runtime_error(
"nodes.rows()="+std::to_string(spec.nodes.rows())+
" NOT EQUAL TO burgers.rows()="+std::to_string(spec.burgers.rows()));
26 const bool success=generateSingle(mg,spec.nodes,spec.burgers,spec.triangles);
30bool CrackMeshGenerator::generateSingle(
MicrostructureGenerator& mg,
const Eigen::Matrix<double,Eigen::Dynamic,3>& nodes,
const Eigen::Matrix<double,Eigen::Dynamic,3>& burgers,
const Eigen::Matrix<int,Eigen::Dynamic,3>& triangles)
33 if(nodes.rows()>2 && triangles.rows()>0)
36 std::vector<VectorDimD> nodesV;
37 std::vector<VectorDimD> burgersV;
38 std::vector<VectorDimI> trianglesV;
40 for(
int k=0;
k<nodes.rows();++
k)
42 nodesV.emplace_back(nodes.row(
k));
43 burgersV.emplace_back(burgers.row(
k));
46 for(
int k=0;
k<triangles.rows();++
k)
48 trianglesV.emplace_back(triangles.row(
k));
CrackMeshGenerator(const CrackMeshIndividualSpecification &, MicrostructureGenerator &mg)
bool insertCrackMesh(const std::vector< VectorDimD > &nodes, const std::vector< VectorDimD > &burgers, const std::vector< VectorDimI > &triangles)
static std::string defaultColor
static std::string magentaBoldColor
enum insertvertexresult success