MeshKit
1.0
|
00001 // It exchanges entities and sets 00002 // calls moab::ParallelComm::exchange_owned_meshs 00003 // 00004 00005 #ifndef PAR_EXCHANGE_MESH_HPP 00006 #define PAR_EXCHANGE_MESH_HPP 00007 00008 #include "meshkit/MeshScheme.hpp" 00009 #include "meshkit/ModelEnt.hpp" 00010 #include "moab/ParallelComm.hpp" 00011 00012 namespace MeshKit 00013 { 00014 using namespace moab; 00015 00016 class ParExchangeMesh : public MeshScheme 00017 { 00018 public: 00019 00020 ParExchangeMesh(MKCore *mkcore, const MEntVector &me_vec); 00021 00022 virtual ~ParExchangeMesh(); 00023 00025 static const char* name() 00026 { return "ParExchangeMesh"; } 00027 00032 static bool can_mesh(iBase_EntityType dim) 00033 { return iBase_ALL_TYPES == dim; } 00034 00041 static bool can_mesh(ModelEnt *me) 00042 { return (me->dimension() == 4); } 00043 00047 static const moab::EntityType* output_types(); 00048 00052 virtual const moab::EntityType* mesh_types_arr() const 00053 { return output_types(); } 00054 00057 virtual void setup_this(); 00058 00061 virtual void execute_this(); 00062 00063 // debug function 00064 void print_mesh(); 00065 00066 private: 00067 00068 ParallelComm* m_mpcomm; // mesh parallel communication 00069 00070 unsigned int m_rank, m_proc_size; 00071 00072 iBase_TagHandle m_mPuniqueIDTag; 00073 00074 std::vector< Range* > m_shared_entities; 00075 00076 std::vector< unsigned int > m_shared_procs; 00077 00078 std::vector< MPI_Request > m_recv_reqs, m_recv_remoteh_reqs; 00079 00080 int get_shared_list(const int to_proc); 00081 }; 00082 } 00083 00084 #endif