Flow123d
release_3.0.0-1008-gca43bb7
|
The class for outputting data during time. More...
#include <output_time.hh>
Public Types | |
enum | DiscreteSpace { NODE_DATA = 0, CORNER_DATA = 1, ELEM_DATA = 2, NATIVE_DATA = 3, MESH_DEFINITION = 9, UNDEFINED = 10 } |
typedef unsigned int | DiscreteSpaceFlags |
typedef std::shared_ptr< ElementDataCacheBase > | OutputDataPtr |
typedef std::vector< OutputDataPtr > | OutputDataFieldVec |
typedef std::pair< std::string, unsigned int > | FieldInterpolationData |
pair of field name and shape (= Scalar 1, Vector 3, Tensor 9) More... | |
typedef std::map< DiscreteSpace, std::vector< FieldInterpolationData > > | InterpolationMap |
Public Member Functions | |
OutputTime () | |
Default constructor. Only for testing. More... | |
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. More... | |
void | set_stream_precision (std::ofstream &stream) |
virtual | ~OutputTime () |
Destructor of OutputTime. It doesn't do anything, because all necessary destructors will be called in destructor of Output. More... | |
Input::Iterator< Input::Array > | get_time_set_array () |
Input::Iterator< Input::Record > | get_output_mesh_record () |
void | write_time_frame () |
std::shared_ptr< Observe > | observe (Mesh *mesh) |
void | clear_data (void) |
Clear data for output computed by method compute_field_data . More... | |
bool | is_output_data_caches_init () |
bool | enable_refinement () |
Return auxiliary flag enable_refinement_. More... | |
virtual void | set_output_data_caches (std::shared_ptr< OutputMeshBase > mesh_ptr) |
std::shared_ptr< OutputMeshBase > | get_output_mesh_ptr () |
void | update_time (double field_time) |
template<typename T > | |
ElementDataCache< T > & | prepare_compute_data (std::string field_name, DiscreteSpace space_type, unsigned int n_rows, unsigned int n_cols) |
bool | is_parallel () const |
int | rank () const |
int | n_proc () const |
virtual void | add_dummy_fields () |
Complete information about dummy fields, method has effect only for GMSH output. More... | |
Static Public Member Functions | |
static const Input::Type::Record & | get_input_type () |
The specification of output stream. More... | |
static Input::Type::Abstract & | get_input_format_type () |
The specification of output file format. More... | |
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. More... | |
Static Public Attributes | |
static const unsigned int | N_DISCRETE_SPACES = 4 |
Protected Member Functions | |
void | fix_main_file_extension (std::string extension) |
int | get_parallel_current_step () |
Return unique value current step for parallel or serial output. More... | |
virtual int | write_data (void)=0 |
Virtual method for writing data to output file. More... | |
void | gather_output_data (void) |
Collect data of individual processes to serial data on master (0th) process. More... | |
Protected Attributes | |
int | rank_ |
int | n_proc_ |
OutputDataFieldVec | output_data_vec_ [N_DISCRETE_SPACES] |
int | current_step |
double | time |
double | write_time |
Input::Record | input_record_ |
ofstream | _base_file |
FilePath | _base_filename |
std::string | equation_name_ |
int | precision_ |
std::shared_ptr< OutputMeshBase > | output_mesh_ |
Output mesh. More... | |
std::shared_ptr< Observe > | observe_ |
bool | enable_refinement_ |
Auxiliary flag for refinement enabling, due to gmsh format. More... | |
bool | parallel_ |
Parallel or serial version of file format (parallel has effect only for VTK) More... | |
string | unit_string_ |
String representation of time unit. More... | |
std::shared_ptr< ElementDataCache< double > > | nodes_ |
Vector of node coordinates. [spacedim x n_nodes]. More... | |
std::shared_ptr< ElementDataCache< unsigned int > > | connectivity_ |
Vector maps the nodes to their coordinates in vector nodes_ . More... | |
std::shared_ptr< ElementDataCache< unsigned int > > | offsets_ |
Vector of offsets of node indices of elements. Maps elements to their nodes in connectivity_. More... | |
The class for outputting data during time.
This class is descendant of Output class. This class is used for outputting data varying in time. Own output to specific file formats is done at other places to. See output_vtk.cc and output_msh.cc.
Definition at line 50 of file output_time.hh.
typedef unsigned int OutputTime::DiscreteSpaceFlags |
Maps names of output fields required by user to their indices in output_data_vec_.
Definition at line 117 of file output_time.hh.
typedef std::pair< std::string, unsigned int > OutputTime::FieldInterpolationData |
pair of field name and shape (= Scalar 1, Vector 3, Tensor 9)
Definition at line 126 of file output_time.hh.
Definition at line 127 of file output_time.hh.
Definition at line 123 of file output_time.hh.
typedef std::shared_ptr<ElementDataCacheBase> OutputTime::OutputDataPtr |
Map field name to its OutputData object.
Definition at line 122 of file output_time.hh.
Enumerator | |
---|---|
NODE_DATA | |
CORNER_DATA | |
ELEM_DATA | |
NATIVE_DATA | |
MESH_DEFINITION | |
UNDEFINED |
Definition at line 104 of file output_time.hh.
OutputTime::OutputTime | ( | ) |
Default constructor. Only for testing.
Definition at line 72 of file output_time.cc.
|
virtual |
Destructor of OutputTime. It doesn't do anything, because all necessary destructors will be called in destructor of Output.
Definition at line 107 of file output_time.cc.
|
virtual |
Complete information about dummy fields, method has effect only for GMSH output.
Reimplemented in OutputMSH.
Definition at line 255 of file output_time.cc.
void OutputTime::clear_data | ( | void | ) |
Clear data for output computed by method compute_field_data
.
Definition at line 242 of file output_time.cc.
|
static |
This method delete all object instances of class OutputTime stored in output_streams vector.
This method tries to create new instance of OutputTime according record in configuration file.
Definition at line 185 of file output_time.cc.
|
inline |
Return auxiliary flag enable_refinement_.
Definition at line 164 of file output_time.hh.
|
protected |
Change main filename to have prescribed extension.
Definition at line 151 of file output_time.cc.
|
protected |
Collect data of individual processes to serial data on master (0th) process.
Definition at line 259 of file output_time.cc.
|
static |
The specification of output file format.
Definition at line 65 of file output_time.cc.
|
static |
The specification of output stream.
Definition at line 38 of file output_time.cc.
std::shared_ptr< OutputMeshBase > OutputTime::get_output_mesh_ptr | ( | ) |
Get shared pointer of output_mesh_
.
Definition at line 139 of file output_time.cc.
Input::Iterator< Input::Record > OutputTime::get_output_mesh_record | ( | ) |
Return the input record for the output mesh of the output stream.
Definition at line 126 of file output_time.cc.
|
protected |
Return unique value current step for parallel or serial output.
Respect value of parallel_
flag:
current_step
Definition at line 248 of file output_time.cc.
Input::Iterator< Input::Array > OutputTime::get_time_set_array | ( | ) |
Return the input array for the output time set of the output stream.
Definition at line 121 of file output_time.cc.
|
virtual |
Constructor of OutputTime object. It opens base file for writing.
[in] | equation_name | The name of equation, used for forming output file name. |
[in] | in_rec | The reference on the input record |
Reimplemented in OutputVTK.
Definition at line 84 of file output_time.cc.
|
inline |
Return if shared pointer to output data caches are created.
Definition at line 159 of file output_time.hh.
|
inline |
Return if output is serial or parallel
Definition at line 204 of file output_time.hh.
|
inline |
Return number of processes
Definition at line 218 of file output_time.hh.
Getter of the observe object.
Definition at line 230 of file output_time.cc.
ElementDataCache< T > & OutputTime::prepare_compute_data | ( | std::string | field_name, |
DiscreteSpace | space_type, | ||
unsigned int | n_rows, | ||
unsigned int | n_cols | ||
) |
Prepare data for computing field values.
Method:
field_name | Quantity name of founding ElementDataCache |
space_type | Output discrete space |
n_rows | Count of rows of data cache (used only if new cache is created) |
n_cols | Count of columns of data cache (used only if new cache is created) |
size | Size of data cache (used only if new cache is created and only for native data) |
Definition at line 78 of file output_time.impl.hh.
|
inline |
Return rank of actual process
Definition at line 211 of file output_time.hh.
|
virtual |
Set shared pointers of output data caches.
Set shared pointer of output_mesh_
(temporary solution).
Reimplemented in OutputMSH.
Definition at line 131 of file output_time.cc.
void OutputTime::set_stream_precision | ( | std::ofstream & | stream | ) |
Common method to set scientific format and precision for output of floating point values to ASCII streams.
Definition at line 100 of file output_time.cc.
void OutputTime::update_time | ( | double | field_time | ) |
Update the last time is actual time
is less than field_time
Definition at line 144 of file output_time.cc.
|
protectedpure virtual |
void OutputTime::write_time_frame | ( | ) |
Write all data registered as a new time frame.
Definition at line 199 of file output_time.cc.
|
protected |
Base output stream
Definition at line 293 of file output_time.hh.
|
protected |
Name of base output file
Definition at line 298 of file output_time.hh.
|
protected |
Vector maps the nodes to their coordinates in vector nodes_
.
Definition at line 328 of file output_time.hh.
|
protected |
Current step
Definition at line 273 of file output_time.hh.
|
protected |
Auxiliary flag for refinement enabling, due to gmsh format.
Definition at line 317 of file output_time.hh.
|
protected |
Name of the equation owning the output stream. Usually the balance equation. Used for forming default output file name and the name of observe output file.
Definition at line 304 of file output_time.hh.
|
protected |
Record for current output stream
Definition at line 288 of file output_time.hh.
|
static |
Types of reference data
NATIVE_DATA represents output of FieldFE in our own format, Paraview ignores this format.
Definition at line 103 of file output_time.hh.
|
protected |
Cached MPI number of processes (is tested in methods)
Definition at line 262 of file output_time.hh.
|
protected |
Vector of node coordinates. [spacedim x n_nodes].
Definition at line 326 of file output_time.hh.
|
protected |
Definition at line 314 of file output_time.hh.
|
protected |
Vector of offsets of node indices of elements. Maps elements to their nodes in connectivity_.
Definition at line 330 of file output_time.hh.
|
protected |
Registered output data. Single map for every value of DiscreteSpace corresponding to nodes, elements and corners.
Definition at line 268 of file output_time.hh.
|
protected |
Output mesh.
Definition at line 312 of file output_time.hh.
|
protected |
Parallel or serial version of file format (parallel has effect only for VTK)
Definition at line 320 of file output_time.hh.
|
protected |
Number of decimal digits used for output of double values.
Definition at line 309 of file output_time.hh.
|
protected |
Cached MPI rank of process (is tested in methods)
Definition at line 257 of file output_time.hh.
|
protected |
The newest time of registered data
Definition at line 278 of file output_time.hh.
|
protected |
String representation of time unit.
Definition at line 323 of file output_time.hh.
|
protected |
The last time, when data was wrote to this stream
Definition at line 283 of file output_time.hh.