Flow123d
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
flow123d
src
io
output_vtk.h
Go to the documentation of this file.
1
/*!
2
*
3
* Copyright (C) 2007 Technical University of Liberec. All rights reserved.
4
*
5
* Please make a following refer to Flow123d on your project site if you use the program for any purpose,
6
* especially for academic research:
7
* Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic
8
*
9
* This program is free software; you can redistribute it and/or modify it under the terms
10
* of the GNU General Public License version 3 as published by the Free Software Foundation.
11
*
12
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
* See the GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along with this program; if not,
17
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.
18
*
19
*
20
* $Id: $
21
* $Revision: $
22
* $LastChangedBy: $
23
* $LastChangedDate: $
24
*
25
* @file output_vtk.h
26
* @brief Header: The functions for VTK outputs.
27
*
28
*/
29
30
#ifndef OUTPUT_VTK_HH_
31
#define OUTPUT_VTK_HH_
32
33
#include "
input/accessors.hh
"
34
#include "
fields/field_base.hh
"
35
36
#include "
io/output.h
"
37
38
/**
39
* \brief This class is used for output data to VTK file format
40
*/
41
class
OutputVTK
:
public
OutputTime
{
42
43
public
:
44
45
/**
46
* \brief The constructor of this class. The head of file is written, when
47
* constructor is called
48
*/
49
OutputVTK
(
const
Input::Record
&in_rec);
50
51
/**
52
* \brief The constructor of this class. The head of file is written, when
53
* constructor is called
54
*/
55
OutputVTK
();
56
57
/**
58
* \brief The destructor of this class. It writes tail of the file too.
59
*/
60
~OutputVTK
();
61
62
/**
63
* \brief The definition of input record for vtk file format
64
*/
65
static
Input::Type::Record
input_type
;
66
67
/**
68
* \brief The definition of input record for selection of variant of file format
69
*/
70
static
Input::Type::Selection
input_type_variant
;
71
72
/**
73
* \brief The definition of input record for selection of compression type
74
*/
75
static
Input::Type::Selection
input_type_compression
;
76
77
/**
78
* \brief This function write data to VTK (.pvd) file format
79
* for curent time
80
*/
81
int
write_data
(
void
);
82
83
/**
84
* \brief This function writes header of VTK (.pvd) file format
85
*/
86
int
write_head
(
void
);
87
88
/**
89
* \brief This function writes tail of VTK (.pvd) file format
90
*/
91
int
write_tail
(
void
);
92
93
private
:
94
95
/**
96
* Was header already written to output file?
97
*/
98
bool
header_written
;
99
100
/**
101
* \brief The declaration enumeration used for variant of file VTK format
102
*/
103
typedef
enum
Variant
{
104
VARIANT_ASCII
= 1,
105
VARIANT_BINARY
= 2
106
}
Variant
;
107
108
/**
109
* \brief The declaration of enumeration used for type of compression
110
* used in file format
111
*/
112
typedef
enum
Compression
{
113
COMPRESSION_NONE
= 1,
114
COMPRESSION_GZIP
= 2
115
}
Compression
;
116
117
// VTK Element types
118
typedef
enum
{
119
VTK_VERTEX
= 1,
120
VTK_POLY_VERTEX
= 2,
121
VTK_LINE
= 3,
122
VTK_POLY_LINE
= 4,
123
VTK_TRIANGLE
= 5,
124
VTK_TRIANGLE_STRIP
= 6,
125
VTK_POLYGON
= 7,
126
VTK_PIXEL
= 8,
127
VTK_QUAD
= 9,
128
VTK_TETRA
= 10,
129
VTK_VOXEL
= 11,
130
VTK_HEXAHEDRON
= 12,
131
VTK_WEDGE
= 13,
132
VTK_PYRAMID
= 14,
133
VTK_QUADRIC_EDGE
= 21,
134
VTK_QUADRIC_TRIANGLE
= 22,
135
VTK_QUADRIC_QUAD
= 23,
136
VTK_QUADRIC_TETRA
= 24,
137
VTK_QUADRIC_HEXAHEDRON
= 25
138
}
VTKElemType
;
139
140
// VTK Element size (number of nodes)
141
typedef
enum
{
142
VTK_LINE_SIZE
= 2,
143
VTK_TRIANGLE_SIZE
= 3,
144
VTK_TETRA_SIZE
= 4
145
}
VTKElemSize
;
146
147
/**
148
* \brief Write header of VTK file (.vtu)
149
*/
150
void
write_vtk_vtu_head
(
void
);
151
152
/**
153
* \brief Write geometry (position of nodes) to the VTK file (.vtu)
154
*/
155
void
write_vtk_geometry
(
void
);
156
157
/**
158
* \brief Write topology (connection of nodes) to the VTK file (.vtu)
159
*/
160
void
write_vtk_topology
(
void
);
161
162
/**
163
* \brief Write geometry (position of nodes) to the VTK file (.vtu)
164
*
165
* This method is used, when discontinuous data are saved to the .vtu file
166
*/
167
void
write_vtk_discont_geometry
(
void
);
168
169
/**
170
* \brief Write topology (connection of nodes) to the VTK file (.vtu)
171
*
172
* This method is used, when discontinuous data are saved to the .vtu file
173
*/
174
void
write_vtk_discont_topology
(
void
);
175
176
/**
177
*
178
*/
179
void
write_vtk_data_ascii
(
vector<OutputDataBase*>
&output_data);
180
181
/**
182
* \brief Write names of data sets in @p output_data vector that have value type equal to @p type.
183
* Output is done into stream @p file.
184
*/
185
void
write_vtk_data_names
(ofstream &file,
vector<OutputDataBase*>
&output_data);
186
187
/**
188
* \brief Write data on nodes to the VTK file (.vtu)
189
*/
190
void
write_vtk_node_data
(
void
);
191
192
/**
193
* \brief Write data on elements to the VTK file (.vtu)
194
*/
195
void
write_vtk_element_data
(
void
);
196
197
/**
198
* \brief Write tail of VTK file (.vtu)
199
*/
200
void
write_vtk_vtu_tail
(
void
);
201
202
/**
203
* \brief This function write all scalar and vector data on nodes and elements
204
* to the VTK file (.vtu)
205
*/
206
void
write_vtk_vtu
(
void
);
207
};
208
209
#endif
/* OUTPUT_VTK_HH_ */
Generated on Thu May 29 2014 23:14:48 for Flow123d by
1.8.4