Flow123d  last_with_con_2.0.0-663-gd0e2296
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) 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.
void print_binary_all(ostream &out_stream) override
Prints the whole data vector into stream.
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 get_min_max_range(double &min, double &max) override