37 std::set<LineSegment>
lineSegments = geometry->getLineSegments();
40 Box2D bb = geometry->getBoundingBox();
51 throw BadMesh(
"TriangularGenerator",
"geometry object is too small to create triangular mesh");
62 for (
int i = 0; i < 2; ++i) {
64 PointMap::iterator
it;
66 std::tie(
it,
ok) =
pointmap.insert(std::make_pair(segment[i],
n));
80 std::unique_ptr<double[]>
in_points(
new double[2 * in.numberofpoints]);
84 in_points[2 * pi.second + 1] = pi.first.c1;
89 std::unique_ptr<int[]>
in_segments(
new int[2 * in.numberofsegments]);
103 trifree(out.pointattributelist);
105 trifree(out.triangleattributelist);
109 trifree(out.segmentmarkerlist);
117 std::unique_ptr<REAL[], TrifreeCaller>
out_points(out.pointlist);
118 std::unique_ptr<int[], TrifreeCaller>
out_triangles(out.trianglelist);
121 result->nodes.reserve(out.numberofpoints);
122 for (std::size_t i = 0; i < std::size_t(out.numberofpoints) * 2; i += 2)
123 result->nodes.emplace_back(out.pointlist[i], out.pointlist[i + 1]);
124 result->elementNodes.reserve(out.numberoftriangles);
125 for (std::size_t i = 0; i < std::size_t(out.numberoftriangles) * 3; i += 3)
126 result->elementNodes.push_back({std::size_t(out.trianglelist[i]), std::size_t(out.trianglelist[i + 1]),
127 std::size_t(out.trianglelist[i + 2])});
172static RegisterMeshGeneratorReader trianglegenerator_reader(
"triangular2d.triangle", readTriangleGenerator);