1 //------------------------------------------------------------------------- 2 // Filename : NCHelperGCRM.hpp 3 // 4 // Purpose : Climate NC file helper for GCRM grid 5 // 6 // Creator : Danqing Wu 7 //------------------------------------------------------------------------- 8 9 #ifndef NCHELPERGCRM_HPP 10 #define NCHELPERGCRM_HPP 11 12 #include "NCHelper.hpp" 13 14 namespace moab { 15 16 //! Child helper class for GCRM grid 17 class NCHelperGCRM : public UcdNCHelper 18 { 19 public: 20 NCHelperGCRM(ReadNC* readNC, int fileId, const FileOptions& opts, EntityHandle fileSet); 21 static bool can_read_file(ReadNC* readNC); 22 23 private: 24 //! Implementation of NCHelper::init_mesh_vals() 25 virtual ErrorCode init_mesh_vals(); 26 //! Implementation of NCHelper::check_existing_mesh() 27 virtual ErrorCode check_existing_mesh(); 28 //! Implementation of NCHelper::create_mesh() 29 virtual ErrorCode create_mesh(Range& faces); 30 //! Implementation of NCHelper::get_mesh_type_name() get_mesh_type_name()31 virtual std::string get_mesh_type_name() { return "GCRM"; } 32 33 //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset_allocate() 34 virtual ErrorCode read_ucd_variables_to_nonset_allocate(std::vector<ReadNC::VarData>& vdatas, 35 std::vector<int>& tstep_nums); 36 #ifdef MOAB_HAVE_PNETCDF 37 //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset_async() 38 virtual ErrorCode read_ucd_variables_to_nonset_async(std::vector<ReadNC::VarData>& vdatas, 39 std::vector<int>& tstep_nums); 40 #else 41 //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset() 42 virtual ErrorCode read_ucd_variables_to_nonset(std::vector<ReadNC::VarData>& vdatas, 43 std::vector<int>& tstep_nums); 44 #endif 45 46 #ifdef MOAB_HAVE_MPI 47 //! Redistribute local cells after trivial partition (e.g. Zoltan partition, if applicable) 48 ErrorCode redistribute_local_cells(int start_cell_index); 49 #endif 50 51 //! Create local vertices 52 ErrorCode create_local_vertices(const std::vector<int>& vertices_on_local_cells, EntityHandle& start_vertex); 53 54 //! Create local edges (optional) 55 ErrorCode create_local_edges(EntityHandle start_vertex); 56 57 //! Create local cells with padding (pentagons are padded to hexagons) 58 ErrorCode create_padded_local_cells(const std::vector<int>& vertices_on_local_cells, 59 EntityHandle start_vertex, Range& faces); 60 61 //! Create gather set vertices 62 ErrorCode create_gather_set_vertices(EntityHandle gather_set, EntityHandle& gather_set_start_vertex); 63 64 //! Create gather set edges (optional) 65 ErrorCode create_gather_set_edges(EntityHandle gather_set, EntityHandle gather_set_start_vertex); 66 67 //! Create gather set cells with padding (pentagons are padded to hexagons) 68 ErrorCode create_padded_gather_set_cells(EntityHandle gather_set, EntityHandle gather_set_start_vertex); 69 70 private: 71 bool createGatherSet; 72 Range facesOwned; 73 }; 74 75 } // namespace moab 76 77 #endif 78