next up previous contents
Next: get_new_hmesh() Up: An Interface Recipe Previous: The Bismesh Structure

Data Structures of the Interface

The purpose of a hmesh interface is to translate data stored in a given user format - like the above bismesh structures - into the HMESH2D/HELEMENT2D structures. According to the interface mask the INTERFACE_ELEMENT consists of all data of the HELEMENT2D. These are grouped in HMESH2D_HELEMENT2D_STRUCT. The additional variables support the recursive mesh traversal and the generation of HELEMENT2Ds. Furthermore there may be some entries which depend on the user's data format.

typedef struct interface_element {
  HMESH2D_HELEMENT2D_STRUCT;

  USER_ELEMENT* user_element;
  double*       point_coords[MAX_NUMBER_OF_VERTICES_PER_ELEMENT];
  int           level;

  struct interface_element* next;

  ...                                 /* additional entries by the user */

} INTERFACE_ELEMENT;

In our case the INTERFACE_ELEMENT structure of the mask has the concrete outline:

typedef struct interface_element {
  HMESH2D_HELEMENT2D_STRUCT;

  BELEMENT*     belement;
  double*       point_coords[MAX_NUMBER_OF_VERTICES_PER_ELEMENT];
  int           level;

  struct interface_element* next;

  VEC3          coord_of_new_node;

} INTERFACE_ELEMENT;
The INTERFACE_ELEMENTs are organized in a free list which is linked via the next pointer. The coordinates of the point that is created while the element is being bisected are stored in coord_of_new_node. Although the routines for traversing the mesh have pointers to HELEMENT2Ds as arguments and return values, in the inteface these pointers will be casted pointers to INTERFACE_ELEMENTs. In an object oriented setting one would apply the subclass concept here.

figure884


next up previous contents
Next: get_new_hmesh() Up: An Interface Recipe Previous: The Bismesh Structure

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.