PolyFEM
Loading...
Searching...
No Matches
Navigation3D.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "Mesh3DStorage.hpp"
4
5namespace polyfem
6{
7 namespace mesh
8 {
9 namespace Navigation3D
10 {
11 // extern double get_index_from_element_face_time;
12 // extern double switch_vertex_time;
13 // extern double switch_edge_time;
14 // extern double switch_face_time;
15 // extern double switch_element_time;
16
17 struct Index
18 {
19 int vertex;
20 int edge;
21 int face;
25 };
27 // Retrieve the index (v,e,f,h) of one vertex incident to the given face and element
29 Index get_index_from_element_face(const Mesh3DStorage &M, int hi, int lf, int lv = 0);
30 Index get_index_from_element_edge(const Mesh3DStorage &M, int hi, int v0, int v1);
31 Index get_index_from_element_tri(const Mesh3DStorage &M, int hi, int v0, int v1, int v2);
32
33 // Navigation in a surface Mesh3DStorage
35 Index switch_edge(const Mesh3DStorage &M, Index idx);
36 Index switch_face(const Mesh3DStorage &M, Index idx);
38
39 // Iterate in a Mesh3DStorage
40 inline Index next_around_2Dface(const Mesh3DStorage &M, Index idx) { return switch_edge(M, switch_vertex(M, idx)); }
41 inline Index next_around_2Dedge(const Mesh3DStorage &M, Index idx) { return switch_vertex(M, switch_face(M, idx)); }
42 inline Index next_around_2Dvertex(const Mesh3DStorage &M, Index idx) { return switch_face(M, switch_edge(M, idx)); }
43
44 inline Index next_around_3Dedge(const Mesh3DStorage &M, Index idx) { return switch_element(M, switch_face(M, idx)); }
45 // inline Index next_around_3Delement(const Mesh3DStorage &M, Index idx) { idx.element_patch++; return get_index_from_element_face(M, idx.element,idx.element_patch,idx.face_corner); }
46 } // namespace Navigation3D
47 } // namespace mesh
48} // namespace polyfem
Index next_around_3Dedge(const Mesh3DStorage &M, Index idx)
Index switch_element(const Mesh3DStorage &M, Index idx)
Index get_index_from_element_tri(const Mesh3DStorage &M, int hi, int v0, int v1, int v2)
Index switch_vertex(const Mesh3DStorage &M, Index idx)
Index get_index_from_element_face(const Mesh3DStorage &M, int hi)
Index get_index_from_element_edge(const Mesh3DStorage &M, int hi, int v0, int v1)
void prepare_mesh(Mesh3DStorage &M)
Index switch_edge(const Mesh3DStorage &M, Index idx)
Index next_around_2Dvertex(const Mesh3DStorage &M, Index idx)
Index next_around_2Dedge(const Mesh3DStorage &M, Index idx)
Index next_around_2Dface(const Mesh3DStorage &M, Index idx)
Index switch_face(const Mesh3DStorage &M, Index idx)