12 #ifndef TRIANGULATE_H_INCLUDED
13 #define TRIANGULATE_H_INCLUDED
62 static const int mesh = 1;
63 static const int snake = 2;
87 std::vector<int> acttri;
95 snake *snakeDep = NULL;
101 void CalcTriVertPosDyna(
int ii);
102 void CalcTriVertPosDyna();
103 void CalcTriVertPos(
int ii);
104 void CalcTriVertPos();
105 void SetActiveStaticTri();
107 void SetConnectivity();
108 void SetConnectivityStat(
int ii);
109 void SetConnectivityInter(
int ii);
110 void SetConnectivityDyna(
int ii);
128 std::vector<int> celltarg;
130 std::vector<double> constrinfluence;
136 bool isTriangleReady =
false;
139 std::vector<int> pointtype;
140 std::vector<int> pointind;
148 void disp()
const override;
149 int Key()
const override
153 int KeyParent()
const override
157 void ChangeIndices(
int nVert,
int nEdge,
int nSurf,
int nVolu)
override;
158 void PrepareForUse()
override{};
159 #pragma GCC diagnostic push
160 #pragma GCC diagnostic ignored "-Wunused-parameter"
161 bool isready(
bool isInMesh)
const override
163 return (isTriangleReady);
165 void SwitchIndex(
int typeInd,
int oldInd,
int newInd)
168 #pragma GCC diagnostic pop
169 void read(FILE *fid)
override;
170 void write(FILE *fid)
const override;
171 void TightenConnectivity()
override
174 void SetPointType(
int a,
int b,
int c)
184 pointtype.assign(3, 0);
185 pointind.assign(3, 0);
186 isTriangleReady =
false;
199 void disp()
const override;
200 int Key()
const override
204 int KeyParent()
const override
208 void ChangeIndices(
int nVert,
int nEdge,
int nSurf,
int nVolu)
override;
209 void ChangeIndicesSnakeMesh(
int nVert,
int nEdge,
int nSurf,
int nVolu);
210 void PrepareForUse()
override{};
211 #pragma GCC diagnostic push
212 #pragma GCC diagnostic ignored "-Wunused-parameter"
213 bool isready(
bool isInMesh)
const override
217 void SwitchIndex(
int typeInd,
int oldInd,
int newInd)
220 #pragma GCC diagnostic pop
221 void read(FILE *fid)
override;
222 void write(FILE *fid)
const override;
223 void TightenConnectivity()
override
231 std::vector<int> indvert;
232 std::vector<int> typevert;
233 std::vector<int> voluind;
234 int parentsurfmesh = 0;
237 void disp()
const override;
238 int Key()
const override
242 int KeyParent()
const override
244 return (parentsurfmesh);
246 void ChangeIndices(
int nVert,
int nEdge,
int nSurf,
int nVolu)
override;
247 void ChangeIndicesSnakeMesh(
int nVert,
int nEdge,
int nSurf,
int nVolu);
248 void PrepareForUse()
override{};
249 #pragma GCC diagnostic push
250 #pragma GCC diagnostic ignored "-Wunused-parameter"
251 bool isready(
bool isInMesh)
const override
255 void SwitchIndex(
int typeInd,
int oldInd,
int newInd)
258 #pragma GCC diagnostic pop
259 void read(FILE *fid)
override;
260 void write(FILE *fid)
const override;
261 void TightenConnectivity()
override
266 void CalculateSnakeVel(
snake &snakein);
267 void CalculateSnakeVelRand(
snake &snakein);
268 void CalculateSnakeVelUnit(
snake &snakein);
269 void CalculateSnakeVelUnitReflect(
snake &snakein);
270 void CalculateSnakeVelFast(
snake &snakein);
271 void CalculateNoNanSnakeVel(
snake &snakein,
double deltaStep = 0.01);
273 const int typeMesh,
int trivertMaxInd);
276 void TriangulateContainer(
const mesh &meshin,
triangulation &triangleRSVS,
const int typeMesh,
277 const std::vector<int> &subList = {});
282 void SnakeSurfaceCentroid_fun(
coordvec &coord,
const surf &surfin,
const mesh &meshin);
285 void Test_stepalgoRSVS(
snake &testSnake,
triangulation &RSVStri, std::vector<double> &dt, std::vector<int> &isImpact,
287 void BuildTriSurfGridSnakeIntersect(
triangulation &triangleRSVS);
290 int &returnIndex,
int &returnType,
int &nextEdge);
291 int FollowSnaxelDirection(
int actSnax,
const snake &snakeRSVS,
int &returnIndex,
int &returnType,
int &actEdge);
292 bool FollowSnaxEdgeConnection(
int actSnax,
int actSurf,
int followSnaxEdge,
const snake &snakeRSVS,
293 std::vector<bool> &isSnaxEdgeDone,
int &returnIndex);
295 void FlattenBoundaryFaces(
mesh &meshin);
299 int Test_snakeRSVS();
300 int Test_surfcentre();
301 int Test_snakeRSVS_singlevol();
302 int Test_MeshOrient();
303 int Test_RSVSalgo_singlevol(
int sparseCuttoff);
304 int Test_RSVSalgo_singlevol_fullmath();
305 int Test_RSVSalgo_singlevol_sparse();
Provide std::vector container with hashed index mapping.
Class to handle the RSVS calculation.
Handles the use and norm of a vector for which the norm and the unit value might be needed.
Class for surface object in a mesh.
void clear()
Clears the contents of the triangulation making sure we can restart the process.
Provides all the mesh tools used for the generation of 3D grids and geometries.
Namespace for general purpose tools of the RSVS project.
Provides the core restricted surface snake container.