38 stringstream default_prec;
39 default_prec << std::numeric_limits<double>::max_digits10;
40 return IT::Record(
"OutputStream",
"Configuration of the spatial output of a single balance equation.")
43 "File path to the connected output file.")
46 "File format of the output stream and possible parameters.")
48 "Output times used for fields that do not have their own output times defined.")
50 "Output mesh record enables output on a refined mesh [EXPERIMENTAL, VTK only]." 51 "Sofar refinement is performed only in discontinous sense." 52 "Therefore only corner and element data can be written on refined output mesh." 53 "Node data are to be transformed to corner data, native data cannot be written." 54 "Do not include any node or native data in output fields.")
56 "The number of decimal digits used in output of floating point values.\n" 57 "Default is 17 decimal digits which are necessary to reproduce double values exactly after write-read cycle.")
59 "Array of observe points.")
65 return IT::Abstract(
"OutputTime",
"Format of output stream and possible parameters.")
131 this->
nodes_ = mesh_ptr->get_master_mesh()->nodes_;
132 this->
connectivity_ = mesh_ptr->get_master_mesh()->connectivity_;
133 this->
offsets_ = mesh_ptr->get_master_mesh()->offsets_;
144 if (this->
time < field_time) {
145 this->
time = field_time;
152 if(extension.compare( this->_base_filename.extension() ) != 0) {
245 for(
auto &od : od_vec)
246 od = std::make_shared<DummyElementDataCache>(od->field_input_name(), od->n_comp());
261 auto &offset_vec = *(
output_mesh_->offsets_->get_component_data(0).get() );
264 for(
unsigned int i=0; i<node_data_map.size(); ++i) {
265 auto elem_node_cache = node_data_map[i]->element_node_cache_fixed_size(offset_vec);
268 auto &master_offset_vec = *( this->
offsets_->get_component_data(0).get() );
269 auto serial_data_cache = serial_fix_data_cache->element_node_cache_optimize_size(master_offset_vec);
270 auto &master_conn_vec = *( this->
connectivity_->get_component_data(0).get() );
271 node_data_map[i] = serial_data_cache->compute_node_data(master_conn_vec, this->
nodes_->n_values());
276 for(
unsigned int i=0; i<corner_data_map.size(); ++i) {
277 auto elem_node_cache = corner_data_map[i]->element_node_cache_fixed_size(offset_vec);
280 auto &master_offset_vec = *( this->
offsets_->get_component_data(0).get() );
281 corner_data_map[i] = serial_fix_data_cache->element_node_cache_optimize_size(master_offset_vec);
286 for(
unsigned int i=0; i<elm_data_map.size(); ++i) {
288 if (
rank_==0) elm_data_map[i] = serial_data;
291 for(
unsigned int i=0; i<native_data_map.size(); ++i) {
294 auto hash = native_data_map[i]->dof_handler_hash();
295 native_data_map[i] = serial_data;
296 (native_data_map[i])->set_dof_handler_hash(hash);
301 auto &conn_vec = *(
output_mesh_->connectivity_->get_component_data(0).get() );
303 for(
unsigned int i=0; i<node_data_map.size(); ++i) {
304 node_data_map[i] = node_data_map[i]->compute_node_data(conn_vec, this->
nodes_->n_values());
312 #define OUTPUT_PREPARE_COMPUTE_DATA(TYPE) \ 313 template OutputTime::OutputDataPtr OutputTime::prepare_compute_data<TYPE>(std::string field_name, DiscreteSpace space_type, \ 314 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_