97 template <
class Value>
131 THROW(OutputTime::ExcOutputVariableVector() << OutputTime::EI_FieldName(this->
field_name));
150 delete[] this->
data_;
163 void print(ostream &out_stream,
unsigned int idx)
override
168 out_stream << *ptr <<
" ";
181 void add(
unsigned int idx,
const Value& value) {
189 void normalize(
unsigned int idx,
unsigned int divisor) {
198 template <
class Func>
199 void operate(
unsigned int idx,
const Value &val,
const Func& func) {
202 for(
unsigned int i_row=0; i_row < this->
n_rows; i_row++)
203 for(
unsigned int i_col=0; i_col < this->
n_cols; i_col++)
205 if (i_row < val.n_rows() && i_col < val.n_cols())
206 func(*ptr, val(i_row, i_col));
224 typename Value::return_type
aux;
242 template<
int spacedim,
class Value>
248 for (
unsigned long index=0; index < multi_field.
size(); index++)
261 template<
int spacedim,
class Value>
279 template<
int spacedim,
class Value>
284 if( this->
rank != 0) {
305 unsigned int n_corners = 0;
307 n_corners += ele->n_nodes();
326 for(
unsigned int idx=0; idx < output_data->n_values; idx++)
327 output_data->zero(idx);
332 Node * node = ele->node[i_node];
333 unsigned int ele_index = ele.index();
336 const Value &node_value =
337 Value( const_cast<typename Value::return_type &>(
339 output_data->add(node_index, node_value);
346 for(
unsigned int idx=0; idx < output_data->n_values; idx++)
347 output_data->normalize(idx, count[idx]);
351 unsigned int corner_index=0;
354 Node * node = ele->node[i_node];
355 unsigned int ele_index = ele.index();
357 const Value &node_value =
358 Value( const_cast<typename Value::return_type &>(
360 output_data->store_value(corner_index, node_value);
368 unsigned int ele_index = ele.index();
369 const Value &ele_value =
370 Value( const_cast<typename Value::return_type &>(
373 output_data->store_value(ele_index, ele_value);
double time
The newest time of registered data.
Common abstract parent of all Field<...> classes.
Common parent class for templated OutputData.
#define FOR_ELEMENT_NODES(i, j)
void operate(unsigned int idx, const Value &val, const Func &func)
std::string output_field_name
void print(ostream &out_stream, unsigned int idx) override
unsigned int size() const
Number of subfields that compose the multi-field.
#define FOR_ELEMENTS(_mesh_, __i)
Class template representing a field with values dependent on: point, element, and region...
void register_data(const DiscreteSpace type, MultiField< spacedim, Value > &multi_field)
Generic method for registering output data stored in MultiField.
~OutputData()
Destructor of OutputData.
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.
vector< OutputDataBase * > node_data
Value::element_type ElemType
unsigned int n_elements() const
void compute_field_data(DiscreteSpace space, Field< spacedim, Value > &field)
void add(unsigned int idx, const Value &value)
#define ASSERT_LESS(a, b)
OutputDataBase * output_data_by_field_name(const string &field_name, DiscreteSpace ref_type)
This method returns pointer at existing data, when corresponding output data exists or it creates new...
void normalize(unsigned int idx, unsigned int divisor)
vector< OutputDataBase * > elem_data
map< string, bool > output_names
Map of names of output fields. True means that field will be saved.
unsigned int index(const T *pointer) const
virtual Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm) const
int rank
MPI rank of process (is tested in methods)
Value::return_type aux
auxiliary value
const Mesh * mesh() const
FieldCommon & name(const string &name)
unsigned int n_nodes() const
Class for representation of a vector of fields of the same physical quantity.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
NodeVector node_vector
Vector of nodes of the mesh.
void store_value(unsigned int idx, const Value &value)
vector< OutputDataBase * > corner_data