1 | \documentclass[12pt]{article} |
---|
2 | \usepackage{graphicx} |
---|
3 | |
---|
4 | |
---|
5 | \begin{document} |
---|
6 | |
---|
7 | |
---|
8 | \section{Abstract view of a basic triangle} |
---|
9 | |
---|
10 | The fundamental geometric structure in the finite-volume |
---|
11 | or finite-element method is the \textbf{triangle}. |
---|
12 | Several triangles can be joined along their edges to |
---|
13 | form \textbf{meshes} thus providing the ability to discretise complex and |
---|
14 | general domains. Figure \ref{fig:mesh_example} shows a mesh composed of a |
---|
15 | number of triangles. |
---|
16 | |
---|
17 | \begin{figure} |
---|
18 | \begin{center} |
---|
19 | \includegraphics[width=0.8\textwidth]{mesh_example} |
---|
20 | \end{center} |
---|
21 | \label{fig:mesh_example} |
---|
22 | \caption{FIXME: Should be replaced by a pmesh generated mesh} |
---|
23 | \end{figure} |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | Triangles are fully described by the location of their three \textbf{vertices} |
---|
28 | always required to be given in \emph{counter-clockwise} order and they are |
---|
29 | enumerated as 0, 1, 2. |
---|
30 | Other properties are derived automatically and each triangle is given a |
---|
31 | unique non-negative integer id. The derived |
---|
32 | properties are: |
---|
33 | \begin{itemize} |
---|
34 | \item \textbf{centroid:} location of center of gravity |
---|
35 | \item \textbf{faces:} Triangle edges are called \emph{faces} in |
---|
36 | pyvolution and each is enumerated like the vertex it opposes. |
---|
37 | \item \textbf{edgelengths:} Length of each face. |
---|
38 | \item \textbf{normals:} Outward pointing normal vectors. |
---|
39 | Enumerated as faces. |
---|
40 | \item \textbf{midpoints:} Points bisecting each face. |
---|
41 | Enumerated as faces. |
---|
42 | \item \textbf{area:} The triangle area |
---|
43 | \item \textbf{radius:} The distance from the centroid to the |
---|
44 | nearest midpoint |
---|
45 | \end{itemize} |
---|
46 | |
---|
47 | |
---|
48 | In addition, each triangle has information about adjacent triangles |
---|
49 | (neighbours): |
---|
50 | |
---|
51 | \begin{itemize} |
---|
52 | \item \textbf{neighbours:} Indices of adjacent triangles if present, |
---|
53 | otherwise a negative number identifying a boundary |
---|
54 | (see Section \ref{sec:boundaries}). Neighbours are enumerated as faces. |
---|
55 | \item \textbf{neighbour\_faces:} For each face, this is the index of |
---|
56 | the closest face in the neighbour. If no neighbour is present this |
---|
57 | index is undefined. |
---|
58 | \item \textbf{number\_of\_boundaries:} Defined as $3$ less the number of |
---|
59 | adjacent triangles. |
---|
60 | \end{itemize} |
---|
61 | |
---|
62 | The conceptual structure of a triangle and it's relation to edges and |
---|
63 | adjacent triangles are shown in Figure \ref{fig:triangle}. |
---|
64 | Some quantities are omitted for simplicity. |
---|
65 | |
---|
66 | \begin{figure} |
---|
67 | \begin{center} |
---|
68 | \includegraphics[width=0.8\textwidth]{triangle} |
---|
69 | \end{center} |
---|
70 | \caption{Conceptual structure of triangles and their relationships.} |
---|
71 | \label{fig:triangle} |
---|
72 | \end{figure} |
---|
73 | |
---|
74 | |
---|
75 | \section{Mesh Data Structure} |
---|
76 | |
---|
77 | Each triangle, each point and each vector could be implemented |
---|
78 | as an object containing the above mentioned attributes. |
---|
79 | However, for performance issues, all information is kept in |
---|
80 | consecutive memory blocks implemented as standard 2d arrays |
---|
81 | and each triangle object pertain to all conceptual instances of |
---|
82 | triangle, point and vector. |
---|
83 | |
---|
84 | In addition, not all information listed above need to be |
---|
85 | stored permanently. |
---|
86 | The midpoints, for example, are only needed once when computing the |
---|
87 | triangle-radii, and are discarded after all other attributes |
---|
88 | have been computed. |
---|
89 | |
---|
90 | Figure \ref{fig:mesh} shows the objects constituting a mesh, the |
---|
91 | arrays that contain the attributes and their relationships. |
---|
92 | Let $M$ be the total number of triangles and $P$ be the total |
---|
93 | number of points. |
---|
94 | Class Points contains an $P \times 2$ floating point array |
---|
95 | representing $x, y$ coordinates of all points entering the |
---|
96 | structure. These are all vertices and centroids. |
---|
97 | Derived midpoints need not be stored. |
---|
98 | Class Vectors contains the same kind of data, |
---|
99 | a $3 M \times 2$ floating point array representing $x,y$ coordinates |
---|
100 | of normal vectors. Class Vectors can be derived from Class Points. |
---|
101 | Class Triangles contains the following arrays |
---|
102 | \begin{itemize} |
---|
103 | \item \textbf{vertices:} An $M \times 3$ integer array representing |
---|
104 | indices into the points array for vertex 0, 1 and 2. |
---|
105 | \item \textbf{centroids:} An $M \times 1$ integer array representing |
---|
106 | indices into the points array for the centroids. |
---|
107 | \item \textbf{normals:} An $M \times 3$ integer array representing |
---|
108 | indices into the Vectors array for normal 0, 1 and 2. |
---|
109 | \item \textbf{neighbours:} An $M \times 3$ integer array representing |
---|
110 | ids of neighbouring triangles. If no neighbouring triangle is present, |
---|
111 | the corresponding neighbour index will be negative |
---|
112 | representing a boundary object. See Section \ref{sec:boundaries}. |
---|
113 | \item \textbf{neighbour\_faces:} An $M \times 3$ integer array representing |
---|
114 | enumerations (0, 1, or 2) of adjacent faces of neighbouring triangles. |
---|
115 | \item \textbf{areas:} An $M \times 1$ floating point |
---|
116 | array representing the derived geometric property area for each triangle. |
---|
117 | \item \textbf{radii:} An $M \times 1$ floating point |
---|
118 | array representing the derived geometric property radius for each triangle. |
---|
119 | \item \textbf{edgelengths:} An $M \times 3$ floating point |
---|
120 | array representing the derived geometric edgelenghts 0, 1 and 2. |
---|
121 | \item \textbf{number\_of\_boundaries:} Number of absent adjacent triangles. |
---|
122 | \end{itemize} |
---|
123 | (FIXME: A proper diagram with both data and methods |
---|
124 | should go in somewhere in this document) |
---|
125 | |
---|
126 | |
---|
127 | |
---|
128 | \begin{figure} |
---|
129 | \begin{center} |
---|
130 | \includegraphics[width=0.8\textwidth]{mesh} |
---|
131 | \end{center} |
---|
132 | \label{fig:mesh} |
---|
133 | \caption{The data structure for a basic mesh (without boundary info).} |
---|
134 | \end{figure} |
---|
135 | |
---|
136 | |
---|
137 | \section{Vertex data structure} |
---|
138 | |
---|
139 | It is convenient to keep a mapping from each point in the mesh to |
---|
140 | the triangles and vertex ids occupying them. |
---|
141 | |
---|
142 | ......... |
---|
143 | |
---|
144 | Mapping:\\ |
---|
145 | Point id: list of (triangle id, vertex id) |
---|
146 | |
---|
147 | |
---|
148 | |
---|
149 | |
---|
150 | \section{Boundaries} |
---|
151 | \label{sec:boundaries} |
---|
152 | |
---|
153 | Tags, boundary objects and more |
---|
154 | |
---|
155 | \end{document} |
---|