Main Page   Modules   Compound List   File List   File Members  

Domain.h

Go to the documentation of this file.
00001 /* $\Id$ 
00002    Domain.h in library gridlock
00003    Written by Samit Ahlawat <ahlawat2@uiuc.edu>
00004    Distributed under GPL (GNU Public License)
00005 */
00006 
00014 #ifndef _DOMAIN_H_
00015 #define _DOMAIN_H_
00016 #include "common_headers.h"
00017 #include "constants.h"
00018 
00019 
00020 /*************************************************
00021  * This class encapsulates the information related
00022  * with the problem domain, it also allocates    *
00023  * physical storage required for cells, faces,   *
00024  * edges and vertices. The manipulation of each  *
00025  * of these objects is through methods provided by
00026  * their respective classes.                     *
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

Generated on Sun Nov 27 23:41:47 2005 by doxygen1.2.18