45 namespace NekMeshUtils
48 void TetGenInterface::InitialMesh(map<int, NodeSharedPtr> tgidton,
58 surface.firstnumber = 0;
59 surface.numberofpoints = tgidton.size();
60 surface.pointlist =
new REAL[surface.numberofpoints * 3];
63 for (it = tgidton.begin(); it != tgidton.end(); it++)
67 surface.pointlist[it->first * 3 + 0] = loc[0];
68 surface.pointlist[it->first * 3 + 1] = loc[1];
69 surface.pointlist[it->first * 3 + 2] = loc[2];
72 surface.numberoffacets = tri.size();
73 surface.facetlist =
new tetgenio::facet[surface.numberoffacets];
74 surface.facetmarkerlist =
new int[surface.numberoffacets];
76 for (
int i = 0; i < tri.size(); i++)
78 f = &surface.facetlist[i];
79 f->numberofpolygons = 1;
80 f->polygonlist =
new tetgenio::polygon[f->numberofpolygons];
83 p = &f->polygonlist[0];
84 p->numberofvertices = 3;
85 p->vertexlist =
new int[p->numberofvertices];
86 p->vertexlist[0] = tri[i][0];
87 p->vertexlist[1] = tri[i][1];
88 p->vertexlist[2] = tri[i][2];
89 surface.facetmarkerlist[i] = 0;
92 tetrahedralize(
"pYzqQ", &surface, &output);
95 void TetGenInterface::GetNewPoints(
int num,
98 for (
int i = num; i < output.numberofpoints; i++)
101 loc[0] = output.pointlist[i * 3 + 0];
102 loc[1] = output.pointlist[i * 3 + 1];
103 loc[2] = output.pointlist[i * 3 + 2];
112 input.numberofpointmtrs = 1;
114 input.pointmtrlist =
new REAL[input.numberofpoints];
116 for (
int i = 0; i < input.numberofpoints; i++)
118 input.pointmtrlist[i] = delta[i];
121 tetrahedralize(
"pYrmzqQO2/7o/120", &input, &output);
124 vector<Array<OneD, int> > TetGenInterface::Extract()
126 vector<Array<OneD, int> > tets;
127 for (
int i = 0; i < output.numberoftetrahedra; i++)
130 tet[0] = output.tetrahedronlist[i * 4 + 0];
131 tet[1] = output.tetrahedronlist[i * 4 + 1];
132 tet[2] = output.tetrahedronlist[i * 4 + 2];
133 tet[3] = output.tetrahedronlist[i * 4 + 3];
139 void TetGenInterface::freetet()
141 surface.deinitialize();
142 input.deinitialize();
143 output.deinitialize();
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
void RefineMesh(Mesh *LocMesh)