1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//-------------------------------------------------------------------------
// Filename      : NCHelperGCRM.hpp
//
// Purpose       : Climate NC file helper for GCRM grid
//
// Creator       : Danqing Wu
//-------------------------------------------------------------------------

#ifndef NCHELPERGCRM_HPP
#define NCHELPERGCRM_HPP

#include "NCHelper.hpp"

namespace moab
{

//! Child helper class for GCRM grid
class NCHelperGCRM : public UcdNCHelper
{
  public:
    NCHelperGCRM( ReadNC* readNC, int fileId, const FileOptions& opts, EntityHandle fileSet );
    static bool can_read_file( ReadNC* readNC );

  private:
    //! Implementation of NCHelper::init_mesh_vals()
    virtual ErrorCode init_mesh_vals();<--- Function in derived class<--- Function in derived class
    //! Implementation of NCHelper::check_existing_mesh()
    virtual ErrorCode check_existing_mesh();<--- Function in derived class<--- Function in derived class
    //! Implementation of NCHelper::create_mesh()
    virtual ErrorCode create_mesh( Range& faces );<--- Function in derived class<--- Function in derived class
    //! Implementation of NCHelper::get_mesh_type_name()
    virtual std::string get_mesh_type_name()<--- Function in derived class<--- Function in derived class
    {
        return "GCRM";
    }

    //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset_allocate()
    virtual ErrorCode read_ucd_variables_to_nonset_allocate( std::vector< ReadNC::VarData >& vdatas,<--- Function in derived class<--- Function in derived class
                                                             std::vector< int >& tstep_nums );
#ifdef MOAB_HAVE_PNETCDF
    //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset_async()
    virtual ErrorCode read_ucd_variables_to_nonset_async( std::vector< ReadNC::VarData >& vdatas,
                                                          std::vector< int >& tstep_nums );
#else
    //! Implementation of UcdNCHelper::read_ucd_variables_to_nonset()
    virtual ErrorCode read_ucd_variables_to_nonset( std::vector< ReadNC::VarData >& vdatas,<--- Function in derived class<--- Function in derived class
                                                    std::vector< int >& tstep_nums );
#endif

#ifdef MOAB_HAVE_MPI
    //! Redistribute local cells after trivial partition (e.g. Zoltan partition, if applicable)
    ErrorCode redistribute_local_cells( int start_cell_index );
#endif

    //! Create local vertices
    ErrorCode create_local_vertices( const std::vector< int >& vertices_on_local_cells, EntityHandle& start_vertex );

    //! Create local edges (optional)
    ErrorCode create_local_edges( EntityHandle start_vertex );

    //! Create local cells with padding (pentagons are padded to hexagons)
    ErrorCode create_padded_local_cells( const std::vector< int >& vertices_on_local_cells,
                                         EntityHandle start_vertex,
                                         Range& faces );

    //! Create gather set vertices
    ErrorCode create_gather_set_vertices( EntityHandle gather_set, EntityHandle& gather_set_start_vertex );

    //! Create gather set edges (optional)
    ErrorCode create_gather_set_edges( EntityHandle gather_set, EntityHandle gather_set_start_vertex );

    //! Create gather set cells with padding (pentagons are padded to hexagons)
    ErrorCode create_padded_gather_set_cells( EntityHandle gather_set, EntityHandle gather_set_start_vertex );

  private:
    bool createGatherSet;
    Range facesOwned;
};

}  // namespace moab

#endif