Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
NCHelperGCRM.hpp
Go to the documentation of this file.
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 #ifdef MOAB_HAVE_MPI
17 class ParallelComm;
18 #endif
19 //! Child helper class for GCRM grid
20 class NCHelperGCRM : public UcdNCHelper
21 {
22  public:
23  NCHelperGCRM( ReadNC* readNC, int fileId, const FileOptions& opts, EntityHandle fileSet );
24  static bool can_read_file( ReadNC* readNC );
25 
26  private:
27  //! Implementation of NCHelper::init_mesh_vals()
28  virtual ErrorCode init_mesh_vals();
29  //! Implementation of NCHelper::check_existing_mesh()
31  //! Implementation of NCHelper::create_mesh()
32  virtual ErrorCode create_mesh( Range& faces );
33  //! Implementation of NCHelper::get_mesh_type_name()
34  virtual std::string get_mesh_type_name()
35  {
36  return "GCRM";
37  }
38 
39  //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset_allocate()
40  virtual ErrorCode read_ucd_variables_to_nonset_allocate( std::vector< ReadNC::VarData >& vdatas,
41  std::vector< int >& tstep_nums );
42 #ifdef MOAB_HAVE_PNETCDF
43  //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset_async()
44  virtual ErrorCode read_ucd_variables_to_nonset_async( std::vector< ReadNC::VarData >& vdatas,
45  std::vector< int >& tstep_nums );
46 #else
47  //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset()
48  virtual ErrorCode read_ucd_variables_to_nonset( std::vector< ReadNC::VarData >& vdatas,
49  std::vector< int >& tstep_nums );
50 #endif
51 
52 #ifdef MOAB_HAVE_MPI
53  //! Redistribute local cells after trivial partition (e.g. Zoltan partition, if applicable)
54  ErrorCode redistribute_local_cells( int start_cell_index, ParallelComm* pco );
55 #endif
56 
57  //! Create local vertices
58  ErrorCode create_local_vertices( const std::vector< int >& vertices_on_local_cells, EntityHandle& start_vertex );
59 
60  //! Create local edges (optional)
62 
63  //! Create local cells with padding (pentagons are padded to hexagons)
64  ErrorCode create_padded_local_cells( const std::vector< int >& vertices_on_local_cells,
65  EntityHandle start_vertex,
66  Range& faces );
67 
68  //! Create gather set vertices
69  ErrorCode create_gather_set_vertices( EntityHandle gather_set, EntityHandle& gather_set_start_vertex );
70 
71  //! Create gather set edges (optional)
72  ErrorCode create_gather_set_edges( EntityHandle gather_set, EntityHandle gather_set_start_vertex );
73 
74  //! Create gather set cells with padding (pentagons are padded to hexagons)
75  ErrorCode create_padded_gather_set_cells( EntityHandle gather_set, EntityHandle gather_set_start_vertex );
76 
77  private:
80 };
81 
82 } // namespace moab
83 
84 #endif