Flow123d  last_with_con_2.0.0-4-g42e6930
output_data_base.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file output_data_base.hh
15  * @brief
16  */
17 
18 #ifndef OUTPUT_DATA_BASE_HH_
19 #define OUTPUT_DATA_BASE_HH_
20 
21 
22 
23 #include <ostream>
24 #include <string>
25 
26 #include "fields/unit_si.hh"
27 
28 using namespace std;
29 
30 /**
31  * \brief Common parent class for templated OutputData.
32  *
33  * Provides virtual method for output of stored data.
34  *
35  */
37 public:
38 
39  /**
40  * Number of components of element data stored in the database.
41  */
43  N_SCALAR = 1,
44  N_VECTOR = 3,
45  N_TENSOR = 9
46  };
47 
48  /**
49  * Destructor of OutputDataBase
50  */
51  virtual ~OutputDataBase() {};
52 
53  /**
54  * Print one value at given index
55  */
56  virtual void print(ostream &out_stream, unsigned int idx) = 0;
57 
58  /**
59  * Print all data at once stored in database
60  */
61  virtual void print_all(ostream &out_stream) = 0;
62 
63  /**
64  * Print stored values in the YAML format (using JSON like arrays).
65  * Used for output of observe values.
66  */
67  virtual void print_all_yaml(ostream &out_stream, unsigned int precision) = 0;
68 
69  /**
70  * Data copied from Field.
71  */
72  std::string output_field_name;
73  std::string field_name;
75 
76  /**
77  * Number of data values.
78  */
79  unsigned int n_values;
80 
81  /**
82  * Number of data elements per data value.
83  */
85 
86 };
87 
88 
89 
90 
91 #endif /* OUTPUT_DATA_BASE_HH_ */
Common parent class for templated OutputData.
std::string output_field_name
FMT_API void print(std::FILE *f, CStringRef format_str, ArgList args)
Definition: format.cc:489
virtual ~OutputDataBase()
unsigned int n_values
NumCompValueType n_elem_
std::string field_name
Class for representation SI units of Fields.
Definition: unit_si.hh:40