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.")
132 this->
nodes_ = mesh_ptr->get_master_mesh()->nodes_;
133 this->
connectivity_ = mesh_ptr->get_master_mesh()->connectivity_;
134 this->
offsets_ = mesh_ptr->get_master_mesh()->offsets_;
145 if (this->
time < field_time) {
146 this->
time = field_time;
153 if(extension.compare( this->_base_filename.extension() ) != 0) {
246 for(
auto &od : od_vec)
247 od = std::make_shared<DummyElementDataCache>(od->field_input_name(), od->n_comp());
262 auto &offset_vec = *(
output_mesh_->offsets_->get_component_data(0).get() );
265 for(
unsigned int i=0; i<node_data_map.size(); ++i) {
266 auto elem_node_cache = node_data_map[i]->element_node_cache_fixed_size(offset_vec);
269 auto &master_offset_vec = *( this->
offsets_->get_component_data(0).get() );
270 auto serial_data_cache = serial_fix_data_cache->element_node_cache_optimize_size(master_offset_vec);
271 auto &master_conn_vec = *( this->
connectivity_->get_component_data(0).get() );
272 node_data_map[i] = serial_data_cache->compute_node_data(master_conn_vec, this->
nodes_->n_values());
277 for(
unsigned int i=0; i<corner_data_map.size(); ++i) {
278 auto elem_node_cache = corner_data_map[i]->element_node_cache_fixed_size(offset_vec);
281 auto &master_offset_vec = *( this->
offsets_->get_component_data(0).get() );
282 corner_data_map[i] = serial_fix_data_cache->element_node_cache_optimize_size(master_offset_vec);
287 for(
unsigned int i=0; i<elm_data_map.size(); ++i) {
289 if (
rank_==0) elm_data_map[i] = serial_data;
292 for(
unsigned int i=0; i<native_data_map.size(); ++i) {
295 auto hash = native_data_map[i]->dof_handler_hash();
296 native_data_map[i] = serial_data;
297 (native_data_map[i])->set_dof_handler_hash(hash);
302 auto &conn_vec = *(
output_mesh_->connectivity_->get_component_data(0).get() );
304 for(
unsigned int i=0; i<node_data_map.size(); ++i) {
305 node_data_map[i] = node_data_map[i]->compute_node_data(conn_vec, this->
nodes_->n_values());
313 #define OUTPUT_PREPARE_COMPUTE_DATA(TYPE) \ 314 template OutputTime::OutputDataPtr OutputTime::prepare_compute_data<TYPE>(std::string field_name, DiscreteSpace space_type, \ 315 unsigned int n_rows, unsigned int n_cols) Classes for auxiliary output mesh.
virtual void set_output_data_caches(std::shared_ptr< OutputMeshBase > mesh_ptr)
Input::Record input_record_
void fix_main_file_extension(std::string extension)
std::shared_ptr< ElementDataCache< unsigned int > > connectivity_
Vector maps the nodes to their coordinates in vector nodes_.
std::shared_ptr< OutputMeshBase > output_mesh_
Output mesh.
std::shared_ptr< ElementDataCache< unsigned int > > offsets_
Vector of offsets of node indices of elements. Maps elements to their nodes in connectivity_.
static const Input::Type::Record & get_input_type()
std::string format(CStringRef format_str, ArgList args)
static Input::Type::Abstract & get_input_format_type()
The specification of output file format.
std::shared_ptr< OutputMeshBase > get_output_mesh_ptr()
static std::shared_ptr< OutputTime > create_output_stream(const std::string &equation_name, const Input::Record &in_rec, std::string unit_str)
This method delete all object instances of class OutputTime stored in output_streams vector...
std::shared_ptr< Observe > observe_
void update_time(double field_time)
static const Input::Type::Record & get_input_type()
The specification of output mesh.
#define OUTPUT_PREPARE_COMPUTE_DATA(TYPE)
OutputTime()
Default constructor. Only for testing.
std::shared_ptr< ElementDataCache< double > > nodes_
Vector of node coordinates. [spacedim x n_nodes].
std::shared_ptr< Observe > observe(Mesh *mesh)
#define LogOut()
Macro defining 'log' record of log.
int get_parallel_current_step()
Return unique value current step for parallel or serial output.
bool parallel_
Parallel or serial version of file format (parallel has effect only for VTK)
#define START_TIMER(tag)
Starts a timer with specified tag.
string parent_path() const
virtual ~OutputTime()
Destructor of OutputTime. It doesn't do anything, because all necessary destructors will be called in...
void clear_data(void)
Clear data for output computed by method compute_field_data.
void set_stream_precision(std::ofstream &stream)
string unit_string_
String representation of time unit.
The class for outputting data during time.
Dedicated class for storing path to input and output files.
void gather_output_data(void)
Collect data of individual processes to serial data on master (0th) process.
Input::Iterator< Input::Array > get_time_set_array()
virtual void init_from_input(const std::string &equation_name, const Input::Record &in_rec, std::string unit_str)
Constructor of OutputTime object. It opens base file for writing.
Input::Iterator< Input::Record > get_output_mesh_record()
virtual int write_data(void)=0
Virtual method for writing data to output file.
static const Input::Type::Array get_input_type()
OutputDataFieldVec output_data_vec_[N_DISCRETE_SPACES]
#define WarningOut()
Macro defining 'warning' record of log.
#define FLOW123D_FORCE_LINK_IN_PARENT(x)
std::string equation_name_