next up previous contents index
Next: Memory Methods on Triang2d Up: Surfaces and 2D Finite Previous: Surfaces and 2D Finite

Triang2d

 

 

#CLASS Triang2d : Root {
  int number_of_points;
  int max_number_of_points;
  double *x, *y, *z;          /* point coordinates, z==NIL possible */
  int number_of_elements;
  int max_number_of_elements;
  INT3 *vertex;               /* vertex indices for all triangles */
  INT3 *neighbour;            /* indices of neighbour triangles */
                              /* neighbour[j][i] opposite to vertex[j][i] */
  int data_is_borrowed;
};

 

typedef INT3 int[3];

Like all triang classes Triang2d has a three coordinate vectors x, y and z which define the location of points in three-space, the coordinates may be restricted to two dimensions by setting the third coordinate pointer z to NULL (methods like "display" which need a third coordinate will use zero as default). But be careful when using this feature with Geom2d and its subclasses, some methods may not be able to handle this NULL pointer.

The variable vertex points to an array which contains the global vertex numbers for the local vertices of the triangles, the neighbour variable contains information of the neighbour elements. Example:

            14 +-------+ 13
               |\2    1|
               |1\     |
               |  \    |
triangle 0 --> |   \   | <-- triangle 1
               |    \  |
               |     \0|
               |2    0\|
            11 +-------+ 12
The local vertices of each triangle are numbered 0, 1 and 2, the numbers 11, 12, 13 and 14 are the global vertex numbers corresponding to the local ones. For this configuration the variables have the following values:
vertex[0][0] = 12           vertex[1][0] = 12
vertex[0][1] = 14           vertex[1][1] = 13
vertex[0][2] = 11           vertex[1][2] = 14

neighbour[0][0] = -1        neighbour[1][0] = -1
neighbour[0][1] = -1        neighbour[1][1] = 0
neighbour[0][2] = 1         neighbour[1][2] = -1
The neighbour array contains for each triangle for each local vertex the number of the neighbour of the edge opposite to the vertex, negative values mark boundary edges.





SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.