7 #ifndef TETGEN_RSVS_API_H_INCLUDED
8 #define TETGEN_RSVS_API_H_INCLUDED
40 typedef std::array<std::array<double, 3>, 2>
dombounds;
60 using tetgenio::pointlist;
62 using tetgenio::numberofpointmtrs;
63 using tetgenio::pointattributelist;
64 using tetgenio::pointmarkerlist;
65 using tetgenio::pointmtrlist;
71 using tetgenio::neighborlist;
72 using tetgenio::tetrahedronattributelist;
73 using tetgenio::tetrahedronlist;
74 using tetgenio::tetrahedronvolumelist;
78 using tetgenio::facetlist;
79 using tetgenio::facetmarkerlist;
82 using tetgenio::facetconstraintlist;
83 using tetgenio::numberoffacetconstraints;
86 using tetgenio::holelist;
87 using tetgenio::regionlist;
90 using tetgenio::segmentconstraintlist;
96 using tetgenio::edge2tetlist;
97 using tetgenio::edgelist;
98 using tetgenio::edgemarkerlist;
99 using tetgenio::face2edgelist;
100 using tetgenio::face2tetlist;
101 using tetgenio::o2edgelist;
107 using tetgenio::vcelllist;
108 using tetgenio::vedgelist;
109 using tetgenio::vfacetlist;
110 using tetgenio::vpointlist;
112 using tetgenio::initialize;
115 void allocatefacet(
int fIndex);
116 void allocatefacet(
int fIndex,
int numPoly);
117 void allocatefacetpolygon(
int fIndex,
int pIndex);
118 void allocatefacetpolygon(
int fIndex,
int pIndex,
int numVerts);
120 void SpecifyTetPointMetric(
int startPnt,
int numPnt,
const std::vector<double> &mtrs);
121 void SpecifyIndividualTetPointMetric(
int startPnt,
int numPnt,
const std::vector<double> &mtrs);
122 void SpecifyTetFacetMetric(
int startPnt,
int numPnt,
int marker);
125 void displaypoints();
143 int curvatureSmoothing;
149 bool generateMeshInside;
154 void ReadJsonString(
const std::string &jsonStr);
157 this->lowerB = {0.0, 0.0, 0.0};
158 this->upperB = {1.0, 1.0, 1.0};
159 this->surfedgelengths = {0.02, 0.005};
160 this->curvatureSmoothing = 4;
161 this->edgelengths = {0.03, 1.0};
162 this->distanceTol = 0.3;
163 this->generateMeshInside =
false;
173 this->ReadJsonString(jsonStr);
177 std::vector<int> RSVSVoronoiMesh(
const std::vector<double> &vecPts,
mesh &vosMesh,
mesh &snakMesh,
188 bool generateVoroBound =
false);
197 void SU2(
const char *fileName,
const tetgenio &tetout);
203 void CloseVoronoiMesh(
mesh &meshout,
tetgen::io_safe &tetout, std::vector<int> &rayEdges,
int DEINCR,
205 template <
class T,
class V>
206 double ProjectRay(
int count,
const tetgen::dombounds &boundBox,
const T &dir,
const V &orig,
double minDist = 0.0);
207 void MeshData2Tetgenio(
const mesh &meshgeom,
tetgen::io_safe &tetin,
int facetOffset,
int pointOffset,
int pointMarker,
208 const std::vector<double> &pointMtrList,
const std::vector<double> &facetConstr,
209 int facetConstrOffset);
212 void PointCurvature2Metric(std::vector<double> &vertCurvature,
const tetgen::apiparam &inparam);
217 std::vector<bool> Points2VoroAndTetmesh(
const std::vector<double> &vecPts,
mesh &voroMesh,
mesh &tetMesh,
219 std::vector<bool> BoundaryFacesFromPoints(
const mesh &meshin,
const std::vector<int> &boundaryPts);
229 int RSVSVORO_Contain();
230 int RSVSVOROFunc(
const std::vector<double> &vecPts = {},
double distanceTol = 0.26,
231 const char *tecoutStr =
"../TESTOUT/rsvs_voro.plt");
232 int RSVSVOROFunc_contain(
int nPts = 0,
double distanceTol = 0.26,
233 const char *tecoutStr =
"../TESTOUT/rsvs_voro_contain.plt");
251 template <
class T,
class V>
262 double l = -INFINITY;
264 for (
int i = 0; i < count; ++i)
266 l = std::max(l, std::min((boundBox[0][i] - orig[i]) / dir[i], (boundBox[1][i] - orig[i]) / dir[i]));
268 return std::min(l, minDist);
270 int Test_RSVSvoro_init();
double distanceTol
Distance tolerance.
apiparam(const std::string &jsonStr)
Constructs the object from a json string.
std::vector< double > edgelengths
Controls the edgelengths at regular intervals.
std::array< double, 2 > surfedgelengths
Controls the surface edgelengths in CFD in the order: {point of lowest curvature, point of highest cu...
std::array< double, 3 > lowerB
Lower domain bound.
std::array< double, 3 > upperB
Upper domain bound.
Class for memory safe interface with tetgen.h.
Provides all the mesh tools used for the generation of 3D grids and geometries.
mesh TET2MESH(tetgen::io_safe &tetout)
Translates a tetgen output to the RSVS native mesh format.
double ProjectRay(int count, const tetgen::dombounds &boundBox, const T &dir, const V &orig, double minDist=0.0)
Project voronoi diagram rays to the bounding Box.
std::array< std::array< double, 3 >, 2 > dombounds
Type defining domain boundaries.
void GenerateInternalPoints(const mesh &meshin, int nLevels, tetgen::io_safe &tetinPts)
Generate points inside volume cells of a mesh.