Mesh Oriented datABase
(version 5.5.1)
An array-based unstructured mesh library
WriteDamsel.hpp
Go to the documentation of this file.
1
//-------------------------------------------------------------------------
2
// Filename : WriteDamsel.hpp
3
//
4
// Purpose : ExodusII writer
5
//
6
// Special Notes : Lots of code taken from verde implementation
7
//
8
// Creator : Corey Ernst
9
//
10
// Date : 8/02
11
//
12
// Owner : Corey Ernst
13
//-------------------------------------------------------------------------
14
15
#ifndef WRITEDAMSEL_HPP
16
#define WRITEDAMSEL_HPP
17
18
#ifndef IS_BUILDING_MB
19
#error "WriteDamsel.hpp isn't supposed to be included into an application"
20
#endif
21
22
#include <vector>
23
#include <string>
24
25
#include "
moab/Interface.hpp
"
26
#include "
moab/Range.hpp
"
27
#include "
moab/WriterIface.hpp
"
28
#include "
RangeSeqIntersectIter.hpp
"
29
#include "
moab/FileOptions.hpp
"
30
#include "
DamselUtil.hpp
"
31
32
#include "damsel.h"
33
34
namespace
moab
35
{
36
37
class
WriteUtilIface;
38
class
SequenceManager;
39
class
Error;
40
41
class
WriteDamsel
:
public
WriterIface
42
{
43
public
:
44
//! Factory function, for ReaderWriter
45
static
WriterIface
*
factory
(
Interface
*
iface
);
46
47
//! Constructor
48
WriteDamsel
(
Interface
* impl );
49
50
//! Destructor
51
virtual
~WriteDamsel
();
52
53
//! Primary interface function
54
//! \param file_name Filename being written
55
//! \param overwrite If true and the file exists, an error is returned
56
//! \param opts File options, e.g. whether and how to write in parallel
57
//! \param meshset_list If non-NULL, a vector of sets defining what is to be written
58
//! \param num_sets The number of sets to be written, only used if meshset_list is non-NULL
59
//! \param qa_records Strings defining provenance information
60
//! \param tag_list If non-NULL, only these tags should be written
61
//! \param num_tags The number of tag handles in tag_list, used only if tag_list is non-NULL
62
//! \param requested_output_dimension Dimension used for coordinates
63
ErrorCode
write_file
(
const
char
* file_name,
64
const
bool
/* overwrite */
,
65
const
FileOptions
& opts,
66
const
EntityHandle
* meshset_list,
67
const
int
num_sets,
68
const
std::vector< std::string >&
/* qa_records */
,
69
const
Tag
*
/* tag_list */
= NULL,
70
int
/* num_tags */
= 0,
71
int
/* requested_output_dimension */
= 3 );
72
73
enum
74
{
75
DAMSEL_IS_TRACKING
= 0x1
76
}
DAMSEL_FLAGS
;
77
78
private
:
79
//! Initialize global information about dense/sparse/conventional tags, once for entire
80
//! write_file call
81
ErrorCode
init_tag_info
();
82
83
//! Write a subrange of entities/sets; just a wrapper to write_[vertices, entities, sets]
84
ErrorCode
write_subrange
(
RangeSeqIntersectIter
& rsi );
85
86
//! Write the vertices in the model, for the handles in the specified RangeSeqIntersectIter
87
//! \param rsi Range sequence iterator defining range of entities/sets to be written
88
ErrorCode
write_vertices
(
RangeSeqIntersectIter
& rsi );
89
90
//! Write the entities in the model, for the handles in the specified RangeSeqIntersectIter
91
//! \param rsi Range sequence iterator defining range of entities/sets to be written
92
ErrorCode
write_entities
(
RangeSeqIntersectIter
& rsi );
93
94
//! Write the sets in the model, for the handles in the specified RangeSeqIntersectIter
95
//! \param rsi Range sequence iterator defining range of entities/sets to be written
96
ErrorCode
write_sets
(
RangeSeqIntersectIter
& rsi );
97
98
//! Map dense tags for the specified entities, using the specified damsel entity container
99
ErrorCode
map_dense_tags
(
RangeSeqIntersectIter
& rsi, damsel_container& ent_cont );
100
101
//! Map sparse tags for all entities
102
ErrorCode
map_sparse_tags
();
103
104
//! Interface instance
105
Interface
*
mbImpl
;
106
107
//! WriteUtil object used in this writer
108
WriteUtilIface
*
mWriteIface
;
109
110
//! Used to initialize the RangeSeqIntersectIter
111
SequenceManager
*
sequenceManager
;
112
113
//! File name
114
std::string
fileName
;
115
116
//! Utility for storing damsel-specific stuff
117
DamselUtil
dU
;
118
};
119
120
inline
ErrorCode
WriteDamsel::write_subrange
(
RangeSeqIntersectIter
& rsi )
121
{
122
ErrorCode
rval =
MB_SUCCESS
;
123
124
if
(
MBVERTEX
==
mbImpl
->
type_from_handle
( rsi.
get_start_handle
() ) )
125
rval =
write_vertices
( rsi );
126
else
if
(
MBENTITYSET
>
mbImpl
->
type_from_handle
( rsi.
get_start_handle
() ) )
127
rval =
write_entities
( rsi );
128
// else
129
// rval = write_sets(rsi);
130
131
return
rval;
132
}
133
134
}
// namespace moab
135
136
#endif
src
io
WriteDamsel.hpp
Generated on Tue Oct 29 2024 02:05:52 for Mesh Oriented datABase by
1.9.1.