Flow123d  release_2.1.0-87-gfbc1563
output_mesh_data.hh
Go to the documentation of this file.
1 /*
2  * output_mesh_data.hh
3  *
4  * Created on: Jul 8, 2016
5  * Author: jb
6  */
7 
8 #ifndef SRC_IO_OUTPUT_MESH_DATA_HH_
9 #define SRC_IO_OUTPUT_MESH_DATA_HH_
10 
11 #include <ostream>
12 #include <string>
13 #include "system/asserts.hh"
14 #include "io/output_data_base.hh"
15 #include <type_traits>
16 
17 /// Class representing data vector of geometry and topology information (especially for VTK).
18 /// Filling the vector is the users responsibility.
19 template <typename T>
20 class MeshData : public OutputDataBase {
21 public:
22  /// Constructor. @p name is the possible name of the output vector.
23  MeshData(std::string name, NumCompValueType n_elem = N_SCALAR);
24 
25  ~MeshData() override;
26 
27  /// Prints @p idx element of data vector into stream.
28  void print_ascii(std::ostream& out_stream, unsigned int idx) override;
29 
30  /// Prints the whole data vector into stream.
31  void print_ascii_all(std::ostream& out_stream) override;
32 
33  /**
34  * Prints the whole data vector into stream in appended binary format.
35  */
36  void print_binary_all(ostream &out_stream, bool print_data_size = true) override;
37 
38  /// Prints the whole data vector into stream. UNSUPPORTED.
39  void print_all_yaml(std::ostream& out_stream, unsigned int precision) override;
40 
41  /**
42  * Find minimal and maximal range of stored data
43  */
44  void get_min_max_range(double &min, double &max) override;
45 
46  /// Access i-th element in the data vector.
47  T& operator[](unsigned int i);
48 
49  /// Data vector.
51 
52 };
53 
54 
55 
56 #endif /* SRC_IO_OUTPUT_MESH_DATA_HH_ */
Common parent class for templated OutputData.
Definitions of ASSERTS.
void print_ascii(std::ostream &out_stream, unsigned int idx) override
Prints idx element of data vector into stream.
void print_ascii_all(std::ostream &out_stream) override
Prints the whole data vector into stream.
MeshData(std::string name, NumCompValueType n_elem=N_SCALAR)
Constructor. name is the possible name of the output vector.
T & operator[](unsigned int i)
Access i-th element in the data vector.
~MeshData() override
void print_all_yaml(std::ostream &out_stream, unsigned int precision) override
Prints the whole data vector into stream. UNSUPPORTED.
std::vector< T > data_
Data vector.
void print_binary_all(ostream &out_stream, bool print_data_size=true) override
Prints the whole data vector into stream.
void get_min_max_range(double &min, double &max) override