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;
93 char *cstr =
new char[cmd.length() + 1];
94 strcpy(cstr, cmd.c_str());
96 tetrahedralize(cstr, &surface, &output);
99 void TetGenInterface::GetNewPoints(
int num,
102 for (
int i = num; i < output.numberofpoints; i++)
105 loc[0] = output.pointlist[i * 3 + 0];
106 loc[1] = output.pointlist[i * 3 + 1];
107 loc[2] = output.pointlist[i * 3 + 2];
116 input.numberofpointmtrs = 1;
118 input.pointmtrlist =
new REAL[input.numberofpoints];
120 for (
int i = 0; i < input.numberofpoints; i++)
122 input.pointmtrlist[i] = delta[i];
125 string cmd =
"pYrmzq1.1/0QO2/7";
126 char *cstr =
new char[cmd.length() + 1];
127 strcpy(cstr, cmd.c_str());
129 tetrahedralize(cstr, &input, &output);
132 vector<Array<OneD, int> > TetGenInterface::Extract()
134 vector<Array<OneD, int> > tets;
135 for (
int i = 0; i < output.numberoftetrahedra; i++)
138 tet[0] = output.tetrahedronlist[i * 4 + 0];
139 tet[1] = output.tetrahedronlist[i * 4 + 1];
140 tet[2] = output.tetrahedronlist[i * 4 + 2];
141 tet[3] = output.tetrahedronlist[i * 4 + 3];
148 void TetGenInterface::freetet()
150 surface.deinitialize();
151 input.deinitialize();
152 output.deinitialize();
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
void RefineMesh(Mesh *LocMesh)