Flow123d  jenkins-Flow123d-windows32-release-multijob-51
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"
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  */
66 
67  /**
68  * \brief The definition of input record for selection of variant of file format
69  */
71 
72  /**
73  * \brief The definition of input record for selection of compression type
74  */
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  */
99 
100  /**
101  * \brief The declaration enumeration used for variant of file VTK format
102  */
103  typedef enum Variant {
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 {
115  } Compression;
116 
117  // VTK Element types
118  typedef enum {
121  VTK_LINE = 3,
127  VTK_QUAD = 9,
128  VTK_TETRA = 10,
129  VTK_VOXEL = 11,
131  VTK_WEDGE = 13,
138  } VTKElemType;
139 
140  // VTK Element size (number of nodes)
141  typedef enum {
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  */
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_ */
void write_vtk_discont_topology(void)
Write topology (connection of nodes) to the VTK file (.vtu)
Definition: output_vtk.cc:215
Header: The functions for all outputs.
static Input::Type::Selection input_type_variant
The definition of input record for selection of variant of file format.
Definition: output_vtk.h:70
void write_vtk_vtu(void)
This function write all scalar and vector data on nodes and elements to the VTK file (...
Definition: output_vtk.cc:394
bool header_written
Definition: output_vtk.h:98
void write_vtk_geometry(void)
Write geometry (position of nodes) to the VTK file (.vtu)
Definition: output_vtk.cc:87
int write_head(void)
This function writes header of VTK (.pvd) file format.
Definition: output_vtk.cc:558
void write_vtk_element_data(void)
Write data on elements to the VTK file (.vtu)
Definition: output_vtk.cc:366
void write_vtk_data_names(ofstream &file, vector< OutputDataBase * > &output_data)
Write names of data sets in output_data vector that have value type equal to type. Output is done into stream file.
Definition: output_vtk.cc:317
void write_vtk_discont_geometry(void)
Write geometry (position of nodes) to the VTK file (.vtu)
Definition: output_vtk.cc:186
static Input::Type::Record input_type
The definition of input record for vtk file format.
Definition: output_vtk.h:65
void write_vtk_data_ascii(vector< OutputDataBase * > &output_data)
Definition: output_vtk.cc:286
int write_data(void)
This function write data to VTK (.pvd) file format for curent time.
Definition: output_vtk.cc:448
static Input::Type::Selection input_type_compression
The definition of input record for selection of compression type.
Definition: output_vtk.h:75
Accessor to the data with type Type::Record.
Definition: accessors.hh:308
void write_vtk_vtu_tail(void)
Write tail of VTK file (.vtu)
Definition: output_vtk.cc:385
This class is used for output data to VTK file format.
Definition: output_vtk.h:41
int write_tail(void)
This function writes tail of VTK (.pvd) file format.
Definition: output_vtk.cc:582
The class for outputing data during time.
Definition: output_time.hh:37
~OutputVTK()
The destructor of this class. It writes tail of the file too.
Definition: output_vtk.cc:612
OutputVTK()
The constructor of this class. The head of file is written, when constructor is called.
void write_vtk_node_data(void)
Write data on nodes to the VTK file (.vtu)
Definition: output_vtk.cc:336
Variant
The declaration enumeration used for variant of file VTK format.
Definition: output_vtk.h:103
Record type proxy class.
Definition: type_record.hh:161
void write_vtk_vtu_head(void)
Write header of VTK file (.vtu)
Definition: output_vtk.cc:76
Compression
The declaration of enumeration used for type of compression used in file format.
Definition: output_vtk.h:112
Template for classes storing finite set of named values.
void write_vtk_topology(void)
Write topology (connection of nodes) to the VTK file (.vtu)
Definition: output_vtk.cc:118