MOAB: Mesh Oriented datABase  (version 5.2.1)
NCHelperGCRM.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : NCHelperGCRM.hpp
00003 //
00004 // Purpose       : Climate NC file helper for GCRM grid
00005 //
00006 // Creator       : Danqing Wu
00007 //-------------------------------------------------------------------------
00008 
00009 #ifndef NCHELPERGCRM_HPP
00010 #define NCHELPERGCRM_HPP
00011 
00012 #include "NCHelper.hpp"
00013 
00014 namespace moab
00015 {
00016 
00017 //! Child helper class for GCRM grid
00018 class NCHelperGCRM : public UcdNCHelper
00019 {
00020   public:
00021     NCHelperGCRM( ReadNC* readNC, int fileId, const FileOptions& opts, EntityHandle fileSet );
00022     static bool can_read_file( ReadNC* readNC );
00023 
00024   private:
00025     //! Implementation of NCHelper::init_mesh_vals()
00026     virtual ErrorCode init_mesh_vals();
00027     //! Implementation of NCHelper::check_existing_mesh()
00028     virtual ErrorCode check_existing_mesh();
00029     //! Implementation of NCHelper::create_mesh()
00030     virtual ErrorCode create_mesh( Range& faces );
00031     //! Implementation of NCHelper::get_mesh_type_name()
00032     virtual std::string get_mesh_type_name()
00033     {
00034         return "GCRM";
00035     }
00036 
00037     //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset_allocate()
00038     virtual ErrorCode read_ucd_variables_to_nonset_allocate( std::vector< ReadNC::VarData >& vdatas,
00039                                                              std::vector< int >& tstep_nums );
00040 #ifdef MOAB_HAVE_PNETCDF
00041     //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset_async()
00042     virtual ErrorCode read_ucd_variables_to_nonset_async( std::vector< ReadNC::VarData >& vdatas,
00043                                                           std::vector< int >& tstep_nums );
00044 #else
00045     //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset()
00046     virtual ErrorCode read_ucd_variables_to_nonset( std::vector< ReadNC::VarData >& vdatas,
00047                                                     std::vector< int >& tstep_nums );
00048 #endif
00049 
00050 #ifdef MOAB_HAVE_MPI
00051     //! Redistribute local cells after trivial partition (e.g. Zoltan partition, if applicable)
00052     ErrorCode redistribute_local_cells( int start_cell_index );
00053 #endif
00054 
00055     //! Create local vertices
00056     ErrorCode create_local_vertices( const std::vector< int >& vertices_on_local_cells, EntityHandle& start_vertex );
00057 
00058     //! Create local edges (optional)
00059     ErrorCode create_local_edges( EntityHandle start_vertex );
00060 
00061     //! Create local cells with padding (pentagons are padded to hexagons)
00062     ErrorCode create_padded_local_cells( const std::vector< int >& vertices_on_local_cells, EntityHandle start_vertex,
00063                                          Range& faces );
00064 
00065     //! Create gather set vertices
00066     ErrorCode create_gather_set_vertices( EntityHandle gather_set, EntityHandle& gather_set_start_vertex );
00067 
00068     //! Create gather set edges (optional)
00069     ErrorCode create_gather_set_edges( EntityHandle gather_set, EntityHandle gather_set_start_vertex );
00070 
00071     //! Create gather set cells with padding (pentagons are padded to hexagons)
00072     ErrorCode create_padded_gather_set_cells( EntityHandle gather_set, EntityHandle gather_set_start_vertex );
00073 
00074   private:
00075     bool createGatherSet;
00076     Range facesOwned;
00077 };
00078 
00079 }  // namespace moab
00080 
00081 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines