Go to the documentation of this file. 1
2
3
4
5
6
7
8
9 #ifndef READDAMSEL_HPP
10 #define READDAMSEL_HPP
11
12 #ifndef IS_BUILDING_MB
13
14 #endif
15
16 #include <vector>
17 #include <map>
18 #include <string>
19
20 #include "moab/Forward.hpp"
21 #include "moab/ReaderIface.hpp"
22 #include "moab/Range.hpp"
23 #include "moab/RangeMap.hpp"
24 #include "DebugOutput.hpp"
25 #include "DamselUtil.hpp"
26
27 #include "damsel.h"
28
29 namespace moab
30 {
31
32 class ReadUtilIface;
33 class ParallelComm;
34 class Error;
35
36 class ReadDamsel : public ReaderIface
37 {
38 public:
39 static ReaderIface* factory( Interface* );
40
41
42 ErrorCode load_file( const char* file_name,
43 const EntityHandle* file_set,
44 const FileOptions& opts,
45 const SubsetList* subset_list = 0,
46 const Tag* file_id_tag = 0 );
47
48
49 ReadDamsel( Interface* impl = NULL );
50
51
52 virtual ~ReadDamsel();
53
54 virtual ErrorCode read_tag_values( const char* file_name,
55 const char* tag_name,
56 const FileOptions& opts,
57 std::vector< int >& tag_values_out,
58 const SubsetList* subset_list = 0 );
59
60 private:
61
62
63 ErrorCode get_contents( damsel_model m, damsel_container c, Range& ents );
64
65
66
67 ErrorCode get_contents( damsel_model m, damsel_container c, EntityHandle* ents );
68
69 ErrorCode init();
70
71 ErrorCode parse_options( const FileOptions& opts, bool& parallel );
72
73 ErrorCode process_tags( std::vector< damsel_tag_buf_type >& tag_infos );
74
75 ErrorCode process_ent_info( const damsel_entity_buf_type& einfo );
76
77 ErrorCode process_entity_tags( int count,
78 damsel_container tag_container,
79 damsel_container app_cont,
80 Range& these_ents );
81
82 ErrorCode process_coll_infos( std::vector< damsel_collection_buf_type >& coll_infos );
83
84
85
86 ErrorCode container_to_handle_pairs( damsel_container& cont, std::vector< damsel_handle >& handle_pairs );
87
88
89
90 ErrorCode insert_into_map( std::vector< damsel_handle >& handle_pairs, EntityHandle start_handle );
91
92 class subrange
93 {
94 public:
95 subrange( damsel_handle ch, EntityHandle s, int c ) : collh( ch ), seth( s ), count( c ) {}
96 damsel_handle collh;
97 EntityHandle seth;
98 int count;
99 };
100
101
102
103
104 Interface* mbImpl;
105
106
107 ReadUtilIface* readMeshIface;
108
109
110 std::string fileName;
111
112
113 bool nativeParallel;
114
115
116 ParallelComm* myPcomm;
117
118
119 Tag mGlobalIdTag;
120
121
122 RangeMap< damsel_handle, EntityHandle, 0 > dmHandleRMap;
123
124
125 DamselUtil dU;
126 };
127
128 inline const bool operator==( const damsel_err_t& lhs, const damsel_err_t& rhs )
129 {
130 return lhs.id == rhs.id;
131 }
132
133 }
134
135 #endif