MeshKit  1.0
ParallelMesher.hpp
Go to the documentation of this file.
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   SEND_POST_SURF_MESH,
00031   RECV_SURF_MESH,
00032   MESH_VOLUME
00033 };
00034 
00035 class ParallelMesher : public MeshScheme
00036 {
00037 public:
00038 
00039   ParallelMesher(MKCore *mkcore, const MEntVector &me_vec);
00040 
00041   virtual ~ParallelMesher();
00042 
00044   static const char* name() 
00045     { return "ParallelMesher"; }
00046 
00051   static bool can_mesh(iBase_EntityType dim)
00052     { return iBase_REGION == dim; }
00053    
00060   static bool can_mesh(ModelEnt *me)
00061     { return canmesh_region(me); }
00062   
00066   static const moab::EntityType* output_types();
00067 
00071   virtual const moab::EntityType* mesh_types_arr() const
00072     { return output_types(); }
00073 
00076   virtual void setup_this();
00077 
00080   virtual void execute_this();
00081 
00086   void set_mesh_size(double size, int interval);
00087 
00088   // debug function
00089   void print_mesh();
00090 
00091   // debug function
00092   void print_geom_info(ModelEnt* me, const int dim,
00093                        const bool local);
00094   
00095 private:
00096 
00101   MeshOp* get_mesher(PARALLEL_OP_TYPE type);
00102 
00108   void add_parallel_mesh_op(PARALLEL_OP_TYPE type, bool after = false);
00109 
00110   void check_partition(TDParallel* td_par, ModelEnt* me, int dim);
00111 
00112   ParallelComm* m_mpcomm; // mesh parallel communication
00113 
00114   unsigned int m_rank;
00115 
00116   iBase_TagHandle m_mPuniqueIDTag;
00117   
00118   std::vector< MEntSet > m_sEntity;
00119 };
00120 }
00121 
00122 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines