Flow123d  last_with_con_2.0.0-4-g42e6930
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 
16 /// Class representing data vector of geometry and topology information (especially for VTK).
17 /// Filling the vector is the users responsibility.
18 template <typename T>
19 class MeshData : public OutputDataBase {
20 public:
21  /// Constructor. @p name is the possible name of the output vector.
22  MeshData(std::string name, NumCompValueType n_elem = N_SCALAR);
23 
24  ~MeshData() override;
25 
26  /// Prints @p idx element of data vector into stream.
27  void print(std::ostream& out_stream, unsigned int idx) override;
28 
29  /// Prints the whole data vector into stream.
30  void print_all(std::ostream& out_stream) override;
31 
32  /// Prints the whole data vector into stream. UNSUPPORTED.
33  void print_all_yaml(std::ostream& out_stream, unsigned int precision) override;
34 
35  /// Access i-th element in the data vector.
36  T& operator[](unsigned int i);
37 
38  /// Data vector.
40 };
41 
42 
43 
44 #endif /* SRC_IO_OUTPUT_MESH_DATA_HH_ */
void print_all(std::ostream &out_stream) override
Prints the whole data vector into stream.
Common parent class for templated OutputData.
Definitions of ASSERTS.
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.
void print(std::ostream &out_stream, unsigned int idx) override
Prints idx element of data vector into stream.
~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.