Chi-Tech
chi_meshface.h
Go to the documentation of this file.
1#ifndef _chi_meshface_h
2#define _chi_meshface_h
3
4//######################################################### Struct
5/**Data structure for a triangular face.*/
7{
8 int v_index[3];
9 int n_index[3];
10 int vt_index[3];
11 int e_index[3][4];
12
16
18
20 {
21 for (int k=0;k<3;k++)
22 {
23 v_index[k]=-1;
24 n_index[k]=-1;
25 vt_index[k]=-1;
26 e_index[k][0]=-1;
27 e_index[k][1]=-1;
28 e_index[k][2]=-1;
29 e_index[k][3]=-1;
30 invalidated = false;
31 }
32 }
33
34 void SetIndices(int a, int b, int c)
35 {
36 v_index[0] = a;
37 v_index[1] = b;
38 v_index[2] = c;
39
40 e_index[0][0] = a; e_index[0][1] = b;
41 e_index[1][0] = b; e_index[1][1] = c;
42 e_index[2][0] = c; e_index[2][1] = a;
43 }
44
45 Face& operator=(const Face& that)
46 {
47 for (int k=0;k<3;k++)
48 {
49 v_index[k] =that.v_index[k] ;
50 n_index[k] =that.n_index[k] ;
51 vt_index[k]=that.vt_index[k];
52 e_index[k][0]=that.e_index[k][0];
53 e_index[k][1]=that.e_index[k][1];
54 e_index[k][2]=that.e_index[k][2];
55 e_index[k][3]=that.e_index[k][3];
56 }
60 return *this;
61 }
62
63};
64
65#define NEIGHBOR 0
66
67//######################################################### Struct
68/**Data structure for a polygon face.
69
70 edges\n
71 An array of 4 integers.\n
72 [0] = Vertex index of edge start.\n
73 [1] = Vertex index of edge end.\n
74 [2] = Index of the face adjoining this edge (not the current face).
75 -1 if not connected to anything,-1*boundary_index if connected
76 to a boundary.\n
77 [3] = Edge number of adjoining face. -1 if not connected
78 to anything. 0 if a boundary.\n
79 \n
80 \n
81 face_indices\n
82 [0] = Index of the adjoining cell. -1 if not connected to anything.
83 -1*boundary_index if connected to a boundary.\n
84 [1] = Face number of adjoining cell. -1 if not connected
85 to anything. 0 if a boundary.\n
86 [2] = Partition ID of adjecent cell.\n
87
88 */
90{
91 std::vector<int> v_indices;
92 std::vector<int*> edges;
94
97
99
101 {
102 invalidated = false;
103 }
104
106 {
107 for (auto edge : edges) delete [] edge;
108 }
109
110};
111
112
113#endif
chi_mesh::Normal geometric_normal
Definition: chi_meshface.h:13
chi_mesh::Vertex face_centroid
Definition: chi_meshface.h:15
void SetIndices(int a, int b, int c)
Definition: chi_meshface.h:34
int n_index[3]
Definition: chi_meshface.h:9
chi_mesh::Normal assigned_normal
Definition: chi_meshface.h:14
int v_index[3]
Definition: chi_meshface.h:8
int e_index[3][4]
Definition: chi_meshface.h:11
Face & operator=(const Face &that)
Definition: chi_meshface.h:45
std::vector< int > v_indices
Definition: chi_meshface.h:91
std::vector< int * > edges
Definition: chi_meshface.h:92
chi_mesh::Vertex face_centroid
Definition: chi_meshface.h:96
chi_mesh::Normal geometric_normal
Definition: chi_meshface.h:95