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;
65 std::tie(
it,
ok) =
pointmap.insert(std::make_pair(segment[i],
n));
78 std::unique_ptr<double[]>
in_points(
new double[2 * in.numberofpoints]);
82 in_points[2 * pi.second + 1] = pi.first.c1;
87 std::unique_ptr<int[]>
in_segments(
new int[2 * in.numberofsegments]);
101 trifree(out.pointattributelist);
103 trifree(out.triangleattributelist);
107 trifree(out.segmentmarkerlist);
115 std::unique_ptr<REAL[], TrifreeCaller>
out_points(out.pointlist);
116 std::unique_ptr<int[], TrifreeCaller>
out_triangles(out.trianglelist);
119 result->nodes.reserve(out.numberofpoints);
120 for (std::size_t i = 0; i < std::size_t(out.numberofpoints) * 2; i += 2)
121 result->nodes.emplace_back(out.pointlist[i], out.pointlist[i + 1]);
122 result->elementNodes.reserve(out.numberoftriangles);
123 for (std::size_t i = 0; i < std::size_t(out.numberoftriangles) * 3; i += 3)
124 result->elementNodes.push_back({std::size_t(out.trianglelist[i]), std::size_t(out.trianglelist[i + 1]),
125 std::size_t(out.trianglelist[i + 2])});
170static RegisterMeshGeneratorReader trianglegenerator_reader(
"triangular2d.triangle", readTriangleGenerator);