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