00001
00002
00003
00004
00005
00006
00014 #ifndef _DOMAIN_H_
00015 #define _DOMAIN_H_
00016 #include "common_headers.h"
00017 #include "constants.h"
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00039 struct FaceCellMap
00040 {
00041 struct Cell* cells [2];
00042 };
00043
00051 struct EdgeFaceMap
00052 {
00053 int numFaces;
00054 struct Face** faces;
00055 };
00056
00064 struct VertexVertexMap
00065 {
00066 int numVertices;
00067 struct Vertex** vertices;
00068 };
00069
00077 struct VertexEdgeMap
00078 {
00079 int numEdges;
00080 struct Edge** edges;
00081 };
00082
00110 struct Domain
00111 {
00112 struct Cell* cells;
00113 int cell_num;
00114 struct Face* faces;
00115 int face_num;
00116 struct Edge* edges;
00117 int edge_num;
00118 struct Vertex* vertices;
00119 int vertex_num;
00120 struct FaceCellMap* face_cell_mapping;
00121 struct EdgeFaceMap* edge_face_mapping;
00122 struct VertexVertexMap* vrt_vrt_mapping;
00123 struct VertexEdgeMap* vrt_edg_mapping;
00124 };
00125
00126
00127
00135 void domain_init (int cl_num, int fc_num, int ed_num, int vt_num, const char* file, struct Domain* dmn);
00136
00141 void find_face_cell_mapping (struct Domain* dmn);
00142
00147 void find_edge_face_mapping (struct Domain* dmn);
00148
00153 void find_vertex_vertex_mapping (struct Domain* dmn);
00154
00159 void find_vertex_edge_mapping (struct Domain* dmn);
00160
00165 void output_domain (FILE* fp, struct Domain* dmn);
00166
00171 void serialize_domain (FILE* fp, struct Domain* dmn);
00172
00173 #ifndef AREA_VOLUME_NORMAL_NOT_NEEDED
00174 void print_cell_stats (FILE* fp, struct Domain* dmn);
00175 #endif
00176
00177 struct SortAsp
00178 {
00179 int cell_num;
00180 float asp_ratio;
00181 };
00182
00183 int compar (const struct SortAsp* sa1, const struct SortAsp* sa2);
00184
00185 void print_cell_aspect_ratios (FILE* fp, struct Domain* dmn);
00186
00192 void domain_destroy (struct Domain* dmn);
00193
00194 #endif