MeshKit
1.0
|
00001 // It does parallel meshing 00002 // Read and distribute geometry in parallel by iGeom 00003 // Inserts shared vertex/edge/surface entity mesh operations and 00004 // exchange operations to graph 00005 // shared entities are meshed and exchanged, then volume mesh is 00006 // performed at last 00007 // 00008 00009 #ifndef PARALLELMESHER_HPP 00010 #define PARALLELMESHER_HPP 00011 00012 #include "meshkit/MeshScheme.hpp" 00013 #include "moab/ParallelComm.hpp" 00014 #include "TDParallel.hpp" 00015 00016 namespace MeshKit 00017 { 00018 class ModelEnt; 00019 00020 using namespace moab; 00021 00022 enum PARALLEL_OP_TYPE 00023 { 00024 MESH_VERTEX = 0, 00025 MESH_EDGE, 00026 MESH_INTER_SURF, 00027 MESH_NINTER_SURF, 00028 EXCHANGE_VERTEX, 00029 EXCHANGE_EDGE, 00030 POST_RECV, 00031 SEND_POST_SURF_MESH, 00032 RECV_SURF_MESH, 00033 MESH_VOLUME 00034 }; 00035 00036 class ParallelMesher : public MeshScheme 00037 { 00038 public: 00039 00040 ParallelMesher(MKCore *mkcore, const MEntVector &me_vec); 00041 00042 virtual ~ParallelMesher(); 00043 00045 static const char* name() 00046 { return "ParallelMesher"; } 00047 00052 static bool can_mesh(iBase_EntityType dim) 00053 { return iBase_REGION == dim; } 00054 00061 static bool can_mesh(ModelEnt *me) 00062 { return canmesh_region(me); } 00063 00067 static const moab::EntityType* output_types(); 00068 00072 virtual const moab::EntityType* mesh_types_arr() const 00073 { return output_types(); } 00074 00077 virtual void setup_this(); 00078 00081 virtual void execute_this(); 00082 00087 void set_mesh_size(double size, int interval); 00088 00089 // debug function 00090 void print_mesh(); 00091 00092 // debug function 00093 void print_geom_info(ModelEnt* me, const int dim, 00094 const bool local); 00095 00096 private: 00097 00102 MeshOp* get_mesher(PARALLEL_OP_TYPE type); 00103 00109 void add_parallel_mesh_op(PARALLEL_OP_TYPE type, bool after = false); 00110 00111 void check_partition(TDParallel* td_par, ModelEnt* me, int dim); 00112 00113 ParallelComm* m_mpcomm; // mesh parallel communication 00114 00115 unsigned int m_rank; 00116 00117 iBase_TagHandle m_mPuniqueIDTag; 00118 00119 std::vector< MEntSet > m_sEntity; 00120 }; 00121 } 00122 00123 #endif