MOAB: Mesh Oriented datABase  (version 5.3.0)
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 
00017 //! Child helper class for MPAS grid
00018 class NCHelperMPAS : public UcdNCHelper
00019 {
00020   public:
00021     NCHelperMPAS( 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 "MPAS";
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, const std::vector< int >& num_edges_on_local_cells );
00060 
00061     //! Create local cells without padding (cells are divided into groups based on the number of
00062     //! edges)
00063     ErrorCode create_local_cells( const std::vector< int >& vertices_on_local_cells,
00064                                   const std::vector< int >& num_edges_on_local_cells, EntityHandle start_vertex,
00065                                   Range& faces );
00066 
00067     //! Create local cells with padding (padded cells will have the same number of edges)
00068     ErrorCode create_padded_local_cells( const std::vector< int >& vertices_on_local_cells, EntityHandle start_vertex,
00069                                          Range& faces );
00070 
00071     //! Create gather set vertices
00072     ErrorCode create_gather_set_vertices( EntityHandle gather_set, EntityHandle& gather_set_start_vertex );
00073 
00074     //! Create gather set edges (optional)
00075     ErrorCode create_gather_set_edges( EntityHandle gather_set, EntityHandle gather_set_start_vertex );
00076 
00077     //! Create gather set cells without padding (cells are divided into groups based on the number
00078     //! of edges)
00079     ErrorCode create_gather_set_cells( EntityHandle gather_set, EntityHandle gather_set_start_vertex );
00080 
00081     //! Create gather set cells with padding (padded cells will have the same number of edges)
00082     ErrorCode create_padded_gather_set_cells( EntityHandle gather_set, EntityHandle gather_set_start_vertex );
00083 
00084   private:
00085     int maxEdgesPerCell;
00086     int numCellGroups;
00087     bool createGatherSet;
00088     std::map< EntityHandle, int > cellHandleToGlobalID;
00089     Range facesOwned;
00090 };
00091 
00092 }  // namespace moab
00093 
00094 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines