Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
ReadCGNS.hpp
Go to the documentation of this file.
1 #ifndef READ_CGNS_HPP
2 #define READ_CGNS_HPP
3 
4 #include "moab/ReaderIface.hpp"
5 #include "moab/Range.hpp"
6 
7 #include "cgnslib.h"
8 
9 namespace moab
10 {
11 
12 class ReadUtilIface;
13 class Interface;
14 
15 /**
16  * \brief Export CGNS files.
17  * \author Carlos Breviglieri, Carlos Junqueira Junior
18  */
19 
20 class ReadCGNS : public ReaderIface
21 {
22 
23  public:
24  //! factory method
25  static ReaderIface* factory( Interface* );
26 
27  ErrorCode load_file( const char* file_name,
28  const EntityHandle* file_set,
29  const FileOptions& opts,
30  const SubsetList* subset_list = 0,
31  const Tag* file_id_tag = 0 );
32 
33  ErrorCode read_tag_values( const char* file_name,
34  const char* tag_name,
35  const FileOptions& opts,
36  std::vector< int >& tag_values_out,
37  const SubsetList* subset_list = 0 );
38 
39  //! Constructor
40  ReadCGNS( Interface* impl = NULL );
41 
42  //! Destructor
43  virtual ~ReadCGNS();
44 
45  private:
46  ErrorCode create_elements( char* sectionName,
47  const Tag* file_id_tag,
48  const EntityType& ent_type,
49  const int& verts_per_elem,
50  long& section_offset,
51  int elems_count,
52  const std::vector< cgsize_t >& elemsConn );
53 
54  ErrorCode create_sets( char* sectionName,
55  const Tag* file_id_tag,
56  EntityType element_type,
57  const Range& elements,
58  const std::vector< int >& set_ids,
59  int set_type );
60 
62 
63  /** \brief Process options passed into the reader
64  * \param opts Options passed into this read
65  */
66  ErrorCode process_options( const FileOptions& opts );
67 
68  const char* fileName;
69 
70  short mesh_dim;
71 
73 
74  //! interface instance
76 
80 };
81 
82 } // namespace moab
83 
84 #endif