14 template <
class Value>
18 this->set_vtk_type<ElemType>();
34 "Do not support output of vectors with fixed size >3. Field: %s\n",
35 this->field_name.c_str());
42 THROW(OutputTime::ExcOutputVariableVector() << OutputTime::EI_FieldName(this->field_name));
57 template <
class Value>
70 template <
class Value>
76 out_stream << *ptr <<
" ";
86 template <
class Value>
89 for(
unsigned int idx = 0; idx < this->
n_values; idx++) {
92 out_stream << *ptr <<
" ";
98 template <
class Value>
101 if (print_data_size) {
104 out_stream.write(reinterpret_cast<const char*>(&data_byte_size),
sizeof(
unsigned long long int));
107 for(
unsigned int idx = 0; idx < this->
n_values; idx++) {
110 out_stream.write(reinterpret_cast<const char*>(ptr),
sizeof(
ElemType));
116 template <
class Value>
120 for(
unsigned int idx = 0; idx < this->
n_values; idx++) {
121 if (idx != 0) out_stream <<
", ";
123 typename Value::return_type
value;
130 template <
class Value>
133 min = std::numeric_limits<double>::max();
134 max = std::numeric_limits<double>::min();
135 for(
unsigned int idx = 0; idx < this->
n_values; idx++) {
138 if ((
double)(*ptr) < min) min = (double)(*ptr);
139 if ((
double)(*ptr) > max) max = (
double)(*ptr);
148 template <
class Value>
156 template <
class Value>
164 template <
class Value>
172 template <
class Value>
Common abstract parent of all Field<...> classes.
void operate(unsigned int idx, const Value &val, const Func &func)
std::string output_field_name
void print_all_yaml(ostream &out_stream, unsigned int precision) override
void print_binary_all(ostream &out_stream, bool print_data_size=true) override
Print all data stored in output data to appended binary format.
void print_ascii(ostream &out_stream, unsigned int idx) override
This class is used for storing data that are copied from field.
void zero(unsigned int idx)
OutputData(const FieldCommon &field, unsigned int size)
Constructor of templated OutputData.
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
static constexpr bool value
Value::element_type ElemType
void get_min_max_range(double &min, double &max) override
void add(unsigned int idx, const Value &value)
void normalize(unsigned int idx, unsigned int divisor)
virtual ~OutputData() override
Destructor of OutputData.
void print_ascii_all(ostream &out_stream) override
Print all data stored in output data ro ascii format.
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than)
FieldCommon & name(const string &name)
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
void store_value(unsigned int idx, const Value &value)