source: trunk/anuga_core/documentation/old_pyvolution_documentation/pyvolution_structure.tex @ 7935

Last change on this file since 7935 was 1497, checked in by ole, 19 years ago

Added old draft of pyvolution docu to serve as a starting point

File size: 5.5 KB
Line 
1\documentclass[12pt]{article}
2\usepackage{graphicx}
3
4
5\begin{document}
6
7
8\section{Abstract view of a basic triangle}
9
10The fundamental geometric structure in the finite-volume
11or finite-element method is the \textbf{triangle}.
12Several triangles can be joined along their edges to
13form \textbf{meshes} thus providing the ability to discretise complex and
14general domains. Figure \ref{fig:mesh_example} shows a mesh composed of a
15number 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
27Triangles are fully described by the location of their three \textbf{vertices}
28always required to be given in \emph{counter-clockwise} order and they are
29enumerated as 0, 1, 2.
30Other properties are derived automatically and each triangle is given a
31unique non-negative integer id. The derived
32properties 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
48In 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
62The conceptual structure of a triangle and it's relation to edges and
63adjacent triangles are shown in Figure \ref{fig:triangle}.
64Some 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
77Each triangle, each point and each vector could be implemented
78as an object containing the above mentioned attributes.
79However, for performance issues, all information is kept in
80consecutive memory blocks implemented as standard 2d arrays
81and each triangle object pertain to all conceptual instances of
82triangle, point and vector.
83
84In addition, not all information listed above need to be
85stored permanently.
86The midpoints, for example, are only needed once when computing the
87triangle-radii, and are discarded after all other attributes
88have been computed.
89
90Figure \ref{fig:mesh} shows the objects constituting a mesh, the
91arrays that contain the attributes and their relationships.
92Let $M$ be the total number of triangles and $P$ be the total
93number of points.
94Class Points contains an $P \times 2$ floating point array
95representing $x, y$ coordinates of all points entering the
96structure. These are all vertices and centroids.
97Derived midpoints need not be stored.
98Class Vectors contains the same kind of data,
99a $3 M \times 2$ floating point array representing $x,y$ coordinates
100of normal vectors. Class Vectors can be derived from Class Points.
101Class 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
124should 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
139It is convenient to keep a mapping from each point in the mesh to
140the triangles and vertex ids occupying them.
141
142.........
143
144Mapping:\\
145  Point id: list of (triangle id, vertex id)
146
147
148
149
150\section{Boundaries}
151\label{sec:boundaries}
152
153Tags, boundary objects and more
154
155\end{document}
Note: See TracBrowser for help on using the repository browser.