00001 /************************************************************************ 00002 File mmph_prism.h - internal information for parallel overlap for 00003 mesh manipulation module for prismatic elements 00004 00005 Contains: 00006 - constants 00007 - data types 00008 - global variables (for the whole module) 00009 - function headers 00010 00011 ------------------------------ 00012 History: 00013 08.2011 - Krzysztof Banas, initial version 00014 *************************************************************************/ 00015 00016 #ifndef _mmph_prism_ 00017 #define _mmph_prism_ 00018 00019 #include "mmh_intf.h" 00020 00021 #include "mmph_intf.h" 00022 00023 00024 /*** CONSTANTS ***/ 00025 00026 #define MMC_MAX_NUM_MESH 10 /* maximal number of meshes */ 00027 00028 /*** DATA TYPES ***/ 00029 00030 /* type IPID - InterProcessorID - main type for parallel modules */ 00031 typedef struct { 00032 int owner; /* owner ID (from 1 to nrproc) */ 00033 int id_at_owner; 00034 } mmpt_ipid; 00035 00036 /* node structure */ 00037 typedef struct { 00038 int owner; /* owner ID (from 1 to nrproc) */ 00039 int id_at_owner; 00040 } mmpt_nodes; 00041 00042 /* edge structure */ 00043 typedef struct { 00044 int owner; /* owner ID (from 1 to nrproc) */ 00045 int id_at_owner; 00046 } mmpt_edges; 00047 00048 /* face structure */ 00049 typedef struct { 00050 int owner; /* owner ID (from 1 to nrproc) */ 00051 int id_at_owner; 00052 } mmpt_faces; 00053 00054 /* element structure */ 00055 typedef struct { 00056 int owner; /* owner ID (from 1 to nrproc) */ 00057 int id_at_owner; 00058 } mmpt_elems; 00059 00060 /* info about refinements - data exchanged between subdoamins */ 00061 typedef struct{ 00062 /* for each refined element (prism or hexahedron): 00063 element_ID, element_type, new_node_ID (if any), 00064 new_edges_IDs, new_faces_IDs (horizontal+vertical), new_elems_IDs (sons) 00065 1 + 1 + [1] + 3..6 + 10..12 + 8 = 23..29 00066 */ 00067 int* elem; 00068 /* for each refined face: 00069 face_ID, face_type, 00070 new_node_ID (if any), new_edges_IDs, new_faces_IDs (sons) 00071 1 + 1 + [1] + 3..4 + 4 = 9..11 00072 */ 00073 int* face; 00074 /* for each refined edge: 00075 edge_ID, new_node_ID, new_edges_IDs (sons) 00076 1 + 1 + 2 = 4 00077 */ 00078 int* edge; 00079 } mmpt_ref_info; 00080 00081 typedef struct{ 00082 int* face; /* list of deleted owned faces */ 00083 int* edge; /* list of deleted owned edges */ 00084 } mmpt_del_info; 00085 00086 /* 00087 * data structure to handle parallel adaptivity 00088 */ 00089 00090 /* structure with arrays of overlap entities' local and alien IDs */ 00091 /* (alien ID is an ID on another processor) */ 00092 /* for each processor, sharing entities with the given one, there is */ 00093 /* a separate set of lists (to speed up searching of lists, they should be */ 00094 /* stored in increasing order of local IDs !!!!!*/ 00095 typedef struct{ 00096 int nr_elem_alien[MMPC_MAX_NUM_SUB]; 00097 int nr_face_alien[MMPC_MAX_NUM_SUB]; 00098 int nr_edge_alien[MMPC_MAX_NUM_SUB]; 00099 int nr_vert_alien[MMPC_MAX_NUM_SUB]; 00100 int nr_elem_ovl[MMPC_MAX_NUM_SUB]; 00101 int* l_elem_ovl_loc[MMPC_MAX_NUM_SUB]; 00102 int* l_elem_ovl_ali[MMPC_MAX_NUM_SUB]; 00103 int nr_face_ovl[MMPC_MAX_NUM_SUB]; 00104 int* l_face_ovl_loc[MMPC_MAX_NUM_SUB]; 00105 int* l_face_ovl_ali[MMPC_MAX_NUM_SUB]; 00106 int nr_edge_ovl[MMPC_MAX_NUM_SUB]; 00107 int* l_edge_ovl_loc[MMPC_MAX_NUM_SUB]; 00108 int* l_edge_ovl_ali[MMPC_MAX_NUM_SUB]; 00109 int nr_vert_ovl[MMPC_MAX_NUM_SUB]; 00110 int* l_vert_ovl_loc[MMPC_MAX_NUM_SUB]; 00111 int* l_vert_ovl_ali[MMPC_MAX_NUM_SUB]; 00112 } mmpt_mesh_ovl; 00113 00114 /* structure with mesh data */ 00115 typedef struct { 00116 mmpt_nodes *node; /* pointer to array of nodes */ 00117 mmpt_edges *edge; /* pointer to array of edges */ 00118 mmpt_faces *face; /* pointer to array of faces */ 00119 mmpt_elems *elem; /* pointer to array of elements */ 00120 mmpt_ref_info *ref_loc; 00121 mmpt_ref_info *ref_ali; 00122 mmpt_del_info *del_loc; 00123 mmpt_mesh_ovl *mesh_ovls; 00124 } mmpt_mesh; 00125 00126 /*** GLOBAL VARIABLES for the whole module ***/ 00127 00128 extern int mmpv_nr_meshes; /* the number of meshes in the problem */ 00129 extern int mmpv_cur_mesh_id; /* ID of the current mesh */ 00130 extern mmpt_mesh mmpv_meshes[MMC_MAX_NUM_MESH]; /* array of meshes */ 00131 00132 extern int mmpv_nr_sub; 00133 extern int mmpv_my_proc_id; 00134 00135 /*** LOCAL PROCEDURES ***/ 00136 00140 mmpt_mesh* mmpr_select_mesh( /* returns pointer to the chosen mesh */ 00141 /* to avoid errors if input is not valid */ 00142 /* it returns the pointer to the current mesh */ 00143 int Mesh_id /* in: mesh ID or 0 (MMC_CUR_MESH_ID) for the current mesh */ 00144 ); 00145 00146 #endif