00001 /************************************************************************ 00002 File ddh_metis_adapter.h - domain decomposition adapter for external mesh 00003 partitioning libraries Metis and ParMetis 00004 00005 Contains: 00006 - constants 00007 - data types 00008 - function headers 00009 ------------------------------ 00010 History: 00011 08.2012 - Kamil Wachala, initial version 00012 03.2013 - Kazimierz Michalik, incorporating into ModFEM 00013 *************************************************************************/ 00014 00015 #ifndef _ddd_metis_adapter_ 00016 #define _ddd_metis_adapter_ 00017 00018 #include<map> 00019 00020 /* mesh manipulation interface */ 00021 #include "mmh_intf.h" 00022 00023 /* parallel mesh manipulation interface */ 00024 #include "mmph_intf.h" 00025 00026 // uses 00027 #include "../mmph_adapter.h" 00028 00029 #ifdef __cplusplus 00030 extern "C"{ 00031 #endif 00032 00033 00034 /*** LOCAL PROCEDURES ***/ 00035 //-------------------------------------------------------- 00036 // ddr_mesh_to_CRS_graph - to save initial mesh (generation=level=1) as graph in compressed storage format 00037 //------------------------------------------------------- 00038 int ddr_mesh_to_CRSGraph(// return >=0 - number of vertices in CSR graph, <0 - error 00039 const int Mesh_id); 00040 00041 int ddr_check_CSR(const int Mesh_id) ; 00042 00043 int ddr_PCSR_create_initial_distribution( 00044 const int Mesh_id); 00045 00046 int mmpr_PCSR_distribute_elems_to_procs(const int Mesh_id, 00047 const int Source_proc_id); 00048 00049 00050 00051 00052 00053 00054 00055 00056 00060 //int ddr_copy_full_elems( 00061 // const int Mesh_id, 00062 // const int Source_proc_id, 00063 // const int Dest_proc_id, 00064 // const int N_copied_elems, 00065 // const int *Copied_elem_ids); 00066 00070 00071 00072 00073 00074 int mmpr_PCSR_create_IPC(// return >=0 - number of vertices in CSR graph for local proc, <0 - error 00075 const int Mesh_id); 00079 int ddr_PCSR_partition_mesh( /* returns: 1 - success, <0 - error code */ 00080 int Mesh_id, /* ID of the current mesh */ 00081 int Part_amount, /* The number of parts to partition the mesh */ 00082 int Parition_tool /* Used partition tool. Can be: MAC_USE_KWAY_GRAPH_PART_TOOL or MAC_USE_RB_GRAPH_PART_TOOL */ 00083 ); 00084 00088 int mmpr_adaptive_repartition( /* returns: 1 - success, <0 - error code */ 00089 int Mesh_id /* ID of the current mesh */ 00090 ); 00091 00095 int ddr_PCSR_improve_partitioning( /* returns: 1 - success, <0 - error code */ 00096 int Mesh_id /* ID of the current mesh */ 00097 ); 00098 00102 void mmpr_set_metis_options(const int Mesh_id, idx_t options[]); 00103 00107 void mmpr_set_parmetis_options(const int Mesh_id, idx_t options[]); 00108 00112 void mmpr_init_data( 00113 int Mesh_id, /* ID of the current mesh */ 00114 int Part_amount /* The number of parts to partition the mesh */ 00115 ); 00116 00120 void mmpr_end_work(); 00121 00125 void mmpr_create_overlap(const int MeshID); 00126 00130 // NOTE: if overlap does not exist at all, it will be created as 1 element overlap. 00131 int mmpr_IPC_update(const int Mesh_id, 00132 const int* ElemsChanged, 00133 const int nElems 00134 ); 00138 // NOTE: if overlap does not exist at all, it will be created as 1 element overlap. 00139 int mmpr_IPC_expand_overlap(const int Mesh_id 00140 ); 00141 00142 00143 #ifdef __cplusplus 00144 } 00145 #endif 00146 00147 00148 00149 #endif
1.6.1