00001 #ifndef _FV_MSH_ELEMS_H_ 00002 #define _FV_MSH_ELEMS_H_ 00003 00004 00005 /* structure with mesh parameters */ 00006 typedef struct { 00007 int nrno; /* number of active nodes */ 00008 int nmno; /* maximal index of initiated node */ 00009 int mxno; /* maximal available index of node */ 00010 int pfno; /* pointer to first free node space*/ 00011 int nred; /* number of active edges */ 00012 int nmed; /* maximal index of initiated edge */ 00013 int mxed; /* maximal available index of edge */ 00014 int pfed; /* pointer to first free edge space*/ 00015 int nrfa; /* number of active faces */ 00016 int nmfa; /* maximal index of initiated face */ 00017 int mxfa; /* maximal available index of face */ 00018 int pffa; /* pointer to first free face space */ 00019 int nrel; /* number of active elements */ 00020 int nmel; /* maximal index of initiated element */ 00021 int mxel; /* maximal available index of element */ 00022 int pfel; /* pointer to first free element space */ 00023 int maxgen; /* maximum generation level for elements */ 00024 int maxgendiff; /* maximum difference of generation levels */ 00025 /* for neighboring elements */ 00026 } mmt_meshp; 00027 00028 /* node structure */ 00029 typedef struct { 00030 /*||begin||*/ 00031 //int ipid; 00032 /*||end||*/ 00033 double x; /* x-coor of the node (or -1e11 for free spaces ) */ 00034 double y; /* y-coor of the node (or next free space ID) */ 00035 double z; /* z-coor of the node */ 00036 int ipid; /* global identifier that include ownership info */ 00037 } mmt_nodes; 00038 00039 /* edge structure */ 00040 typedef struct { 00041 int type; /* 1 (MMC_EDGE) - active edge */ 00042 /* <0 - inactive edge, number of attempted divisions */ 00043 /* 0 (MMC_FREE) - free space */ 00044 /*||begin||*/ 00045 //int ipid; /* global identifier that include ownership info */ 00046 /*||end||*/ 00047 int node[2]; /* for active edges: node's IDs */ 00048 /* for free spaces: node[0] - the next free space */ 00049 /* for inactive edges: son's IDs */ 00050 } mmt_edges; 00051 00052 /* face structure */ 00053 typedef struct { 00054 int type; /* type and status of the face: */ 00055 /* 1 (MMC_EDGE) - 1D face for 2D elements, */ 00056 /* 2 (MMC_QUAD) - quadrilateral */ 00057 /* 3 (MMC_TRIA) - triangle, */ 00058 /* 0 (MMC_FREE) - free space */ 00059 /* >0 - active, not refined */ 00060 /* <0 - inactive, refined */ 00061 /*||begin||*/ 00062 //int ipid; /* global identifier that include ownership info */ 00063 /*||end||*/ 00064 int bc; /* bc flag for the face (obtained from mesh generator and */ 00065 /* interpreted by the problem dependent module) */ 00066 /* for free spaces: next free space's ID */ 00067 int edge[4]; /* edges' IDs - in proper order */ 00068 /* >0 - edge with the same orientation as face */ 00069 /* <0 - edge with opposite orientation */ 00070 int neig[2]; /* neighboring elements' global IDs */ 00071 /* (first neighbor has the same orientation */ 00072 /* as the face and ordering of its nodes */ 00073 /* defines ordering of nodes on the face) */ 00074 /* >0 - ID of equal size neighbor */ 00075 /* -1 (MMC_BIG_NGB) - indicates big neighbor */ 00076 /* 0 (MMC_BOUNDARY) - boundary (always second neighbor) */ 00077 /* -2 (MMC_SUB_BND) - inter-subdomain boundary */ 00078 int *sons; /* sons */ 00079 } mmt_faces; 00080 00081 /* element structure */ 00082 typedef struct { 00083 int type; /* 7 (MMC_TETRA) - tetrahedron */ 00084 /* 5 (MMC_PRISM) - prism */ 00085 /* 6 (MMC_BRICK) - brick */ 00086 /* 0 (MMC_FREE) - free space (face and sons not allocated) */ 00087 /* >0 - active, not refined */ 00088 /* <0 - inactive, refined */ 00089 /*||begin||*/ 00090 //int ipid; /* global identifier that include ownership info */ 00091 /*||end||*/ 00092 int mate; /* material ID */ 00093 /* for free space: ID of the next free structure */ 00094 int fath; /* parent's global ID */ 00095 /* 0 (MMC_NO_FATH) - if the element has no parent */ 00096 int refi; /* type of the last refinement */ 00097 /* 0 (MMC_NOT_REF) - sons not allocated */ 00098 /* 1 (MMC_REF_TYP_ISO) - isotropic refinement */ 00099 int *face; /* faces' global IDs (sign=orientation)*/ 00100 int *sons; /* children */ 00101 } mmt_elems; 00102 00103 /* structure with mesh data */ 00104 typedef struct { 00105 int space_dim; /* number of space dimensions */ 00106 int monitor; /* printing flag */ 00107 mmt_meshp parm; /* structure with mesh parameters */ 00108 mmt_nodes *node; /* pointer to array of nodes */ 00109 mmt_edges *edge; /* pointer to array of edges */ 00110 mmt_faces *face; /* pointer to array of faces */ 00111 mmt_elems *elem; /* pointer to array of elements */ 00112 } mmt_mesh; 00113 00114 00115 /*||begin||*/ 00116 /* info about refinements - data exchanged between subdoamins */ 00117 typedef struct{ 00118 /* for each refined element (prism or hexahedron): 00119 element_ID, element_type, new_node_ID (if any), 00120 new_edges_IDs, new_faces_IDs (horizontal+vertical), new_elems_IDs (sons) 00121 1 + 1 + [1] + 3..6 + 10..12 + 8 = 23..29 00122 */ 00123 int* elem; 00124 /* for each refined face: 00125 face_ID, face_type, 00126 new_node_ID (if any), new_edges_IDs, new_faces_IDs (sons) 00127 1 + 1 + [1] + 3..4 + 4 = 9..11 00128 */ 00129 int* face; 00130 /* for each refined edge: 00131 edge_ID, new_node_ID, new_edges_IDs (sons) 00132 1 + 1 + 2 = 4 00133 */ 00134 int* edge; 00135 } mmt_ref_info; 00136 00137 00138 #endif /* _FV_MSH_ELEMS_H_ 00139 */