From 0734f8d84221be71b0f73d8bfbc1ab4f5bf3cc90 Mon Sep 17 00:00:00 2001 From: "Jostein R. Natvig" Date: Tue, 31 Aug 2010 14:09:05 +0000 Subject: [PATCH] Add copy of (proposed) grid structure. --- grid.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 grid.h diff --git a/grid.h b/grid.h new file mode 100644 index 00000000..24f72884 --- /dev/null +++ b/grid.h @@ -0,0 +1,45 @@ +#ifndef GRID_H_INCLUDED +#define GRID_H_INCLUDED + +/* GRID_TOPOLOGY and GRID_GEOMETRY must be at the beginning of every + * grid type. + * + * + */ +#define GRID_TOPOLOGY \ + int dimensions; \ + \ + int number_of_cells; \ + int number_of_faces; \ + int number_of_nodes; \ + \ + int *face_nodes; \ + int *face_nodepos; \ + int *face_cells; \ + \ + int *cell_faces; \ + int *cell_facepos; \ + +#define GRID_GEOMETRY \ + double *node_coordinates; \ + \ + double *face_centroids; \ + double *face_areas; \ + double *face_normals; \ + \ + double *cell_centroids; \ + double *cell_volumes; \ + + +typedef struct { + GRID_TOPOLOGY + GRID_GEOMETRY +} grid_t; + + +void free_grid (grid_t *g); +void alloc_grid_geometry (grid_t *g); +void print_grid_summary (grid_t *g); + + +#endif