39 stringstream default_prec;
40 default_prec << std::numeric_limits<double>::max_digits10;
41 return IT::Record(
"OutputStream",
"Configuration of the spatial output of a single balance equation.")
44 "File path to the connected output file.")
47 "File format of the output stream and possible parameters.")
49 "Output times used for fields that do not have their own output times defined.")
51 "Output mesh record enables output on a refined mesh [EXPERIMENTAL, VTK only]."
52 "Sofar refinement is performed only in discontinous sense."
53 "Therefore only corner and element data can be written on refined output mesh."
54 "Node data are to be transformed to corner data, native data cannot be written."
55 "Do not include any node or native data in output fields.")
57 "The number of decimal digits used in output of floating point values.\n"
58 "Default is 17 decimal digits which are necessary to reproduce double values exactly after write-read cycle.")
60 "Array of observe points.")
66 return IT::Abstract(
"OutputTime",
"Format of output stream and possible parameters.")
74 registered_time_(-1.0),
86 const std::shared_ptr<TimeUnitConversion>& time_unit_conv)
134 this->
nodes_ = mesh_ptr->get_master_mesh()->nodes_;
135 this->
connectivity_ = mesh_ptr->get_master_mesh()->connectivity_;
136 this->
offsets_ = mesh_ptr->get_master_mesh()->offsets_;
155 if(extension.compare( this->_base_filename.extension() ) != 0) {
189 const std::shared_ptr<TimeUnitConversion>& time_unit_conv)
242 observe_points, precision,
253 for(
auto &od : od_vec)
254 od = std::make_shared<DummyElementDataCache>(od->field_input_name(), od->n_comp());
269 auto &offset_vec = *(
output_mesh_->offsets_->get_data().get() );
272 for(
unsigned int i=0; i<node_data_map.size(); ++i) {
273 auto elem_node_cache = node_data_map[i]->element_node_cache_fixed_size(offset_vec);
276 auto &master_offset_vec = *( this->
offsets_->get_data().get() );
277 auto serial_data_cache = serial_fix_data_cache->element_node_cache_optimize_size(master_offset_vec);
278 auto &master_conn_vec = *( this->
connectivity_->get_data().get() );
279 node_data_map[i] = serial_data_cache->compute_node_data(master_conn_vec, this->
nodes_->n_values());
284 for(
unsigned int i=0; i<corner_data_map.size(); ++i) {
285 auto elem_node_cache = corner_data_map[i]->element_node_cache_fixed_size(offset_vec);
288 auto &master_offset_vec = *( this->
offsets_->get_data().get() );
289 corner_data_map[i] = serial_fix_data_cache->element_node_cache_optimize_size(master_offset_vec);
294 for(
unsigned int i=0; i<elm_data_map.size(); ++i) {
296 if (
rank_==0) elm_data_map[i] = serial_data;
299 for(
unsigned int i=0; i<native_data_map.size(); ++i) {
302 auto hash = native_data_map[i]->dof_handler_hash();
303 native_data_map[i] = serial_data;
304 (native_data_map[i])->set_dof_handler_hash(hash);
309 auto &conn_vec = *(
output_mesh_->connectivity_->get_data().get() );
311 for(
unsigned int i=0; i<node_data_map.size(); ++i) {
312 node_data_map[i] = node_data_map[i]->compute_node_data(conn_vec, this->
nodes_->n_values());
320 #define OUTPUT_PREPARE_COMPUTE_DATA(TYPE) \
321 template OutputTime::OutputDataPtr OutputTime::prepare_compute_data<TYPE>(std::string field_name, DiscreteSpace space_type, \
322 unsigned int n_rows, unsigned int n_cols, std::string fe_type, unsigned int n_dofs_per_element)
Dedicated class for storing path to input and output files.
string parent_path() const
static const Input::Type::Record & get_input_type()
static const Input::Type::Record & get_input_type()
The specification of output mesh.
static const Input::Type::Array get_input_type()
The class for outputting data during time.
std::shared_ptr< ElementDataCache< unsigned int > > offsets_
Vector of offsets of node indices of elements. Maps elements to their nodes in connectivity_.
std::shared_ptr< OutputMeshBase > get_output_mesh_ptr()
void set_stream_precision(std::ofstream &stream)
static Input::Type::Abstract & get_input_format_type()
The specification of output file format.
std::string equation_name_
static const Input::Type::Record & get_input_type()
The specification of output stream.
void fix_main_file_extension(std::string extension)
OutputTime()
Default constructor. Only for testing.
Input::Iterator< Input::Array > get_time_set_array()
Input::Iterator< Input::Record > get_output_mesh_record()
virtual int write_data(void)=0
Virtual method for writing data to output file.
bool parallel_
Parallel or serial version of file format (parallel has effect only for VTK)
std::shared_ptr< TimeUnitConversion > time_unit_converter
Time unit conversion object from the equation time governor.
static std::shared_ptr< OutputTime > create_output_stream(const std::string &equation_name, const Input::Record &in_rec, const std::shared_ptr< TimeUnitConversion > &time_unit_conv)
This method delete all object instances of class OutputTime stored in output_streams vector.
std::shared_ptr< ElementDataCache< unsigned int > > connectivity_
Vector maps the nodes to their coordinates in vector nodes_.
std::shared_ptr< Observe > observe(Mesh *mesh)
std::shared_ptr< Observe > observe_
std::shared_ptr< OutputMeshBase > output_mesh_
Output mesh.
virtual ~OutputTime()
Destructor of OutputTime. It doesn't do anything, because all necessary destructors will be called in...
void update_time(double field_time)
void clear_data(void)
Clear data for output computed by method compute_field_data.
OutputDataFieldVec output_data_vec_[N_DISCRETE_SPACES]
int get_parallel_current_step()
Return unique value current step for parallel or serial output.
std::shared_ptr< ElementDataCache< double > > nodes_
Vector of node coordinates. [spacedim x n_nodes].
void gather_output_data(void)
Collect data of individual processes to serial data on master (0th) process.
virtual void set_output_data_caches(std::shared_ptr< OutputMeshBase > mesh_ptr)
virtual void init_from_input(const std::string &equation_name, const Input::Record &in_rec, const std::shared_ptr< TimeUnitConversion > &time_unit_conv)
Constructor of OutputTime object. It opens base file for writing.
Input::Record input_record_
#define FLOW123D_FORCE_LINK_IN_PARENT(x)
#define WarningOut()
Macro defining 'warning' record of log.
#define LogOut()
Macro defining 'log' record of log.
manipulators::Array< T, Delim > format(T const &deduce, Delim delim=", ")
Classes for auxiliary output mesh.
#define OUTPUT_PREPARE_COMPUTE_DATA(TYPE)
#define START_TIMER(tag)
Starts a timer with specified tag.
Basic time management class.