Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
NCHelperScrip.hpp
Go to the documentation of this file.
1 /*
2  * NCHelperScrip.hpp
3  * Purpose : Climate NC file helper for Scrip grid
4  */
5 
6 #ifndef SRC_IO_NCHELPERSCRIP_HPP_
7 #define SRC_IO_NCHELPERSCRIP_HPP_
8 
9 #include "NCHelper.hpp"
10 
11 namespace moab
12 {
13 #ifdef MOAB_HAVE_MPI
14 class ParallelComm;
15 #endif
16 class NCHelperScrip : public ScdNCHelper
17 {
18  public:
19  NCHelperScrip( ReadNC* readNC, int fileId, const FileOptions& opts, EntityHandle fileSet )
20  : ScdNCHelper( readNC, fileId, opts, fileSet ), grid_corners( 0 ), grid_size( 0 ), grid_rank( 1 ), nLocalCells( 0 ),
21  degrees( true )
22  {
23  }
24  static bool can_read_file( ReadNC* readNC, int fileId );
25 
26  ErrorCode create_mesh( Range& faces );
27 
28 #ifdef MOAB_HAVE_MPI
29  //! Redistribute local cells after trivial partition (e.g. Zoltan partition, if applicable)
30  ErrorCode redistribute_local_cells( int start_cell_index, ParallelComm* pco );
31 #endif
32 
33  private:
34  virtual ErrorCode init_mesh_vals();
35  virtual std::string get_mesh_type_name()
36  {
37  return "SCRIP";
38  }
39 
40  int grid_corners; // number of vertices per cell
41  int grid_size;
42  int grid_rank;
43  int nLocalCells; // in parallel, number of local cells, initially, and after repartition
44  Range localGidCells; // will store the ids after repartitioning;
45  bool degrees; // if false, it means it is radians
46 };
47 
48 } /* namespace moab */
49 
50 #endif /* SRC_IO_NCHELPERSCRIP_HPP_ */