Flow123d  release_2.2.0-21-g2806cf6
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
OutputTime Class Referenceabstract

The class for outputting data during time. More...

#include <output_time.hh>

Inheritance diagram for OutputTime:
Inheritance graph
[legend]
Collaboration diagram for OutputTime:
Collaboration graph
[legend]

Public Types

enum  DiscreteSpace { NODE_DATA = 0, CORNER_DATA = 1, ELEM_DATA = 2 }
 
typedef unsigned int DiscreteSpaceFlags
 
typedef std::shared_ptr< ElementDataCacheBaseOutputDataPtr
 
typedef std::vector< OutputDataPtrOutputDataFieldVec
 

Public Member Functions

 OutputTime ()
 Default constructor. Only for testing. More...
 
virtual void init_from_input (const std::string &equation_name, Mesh &mesh, const Input::Record &in_rec)
 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::Arrayget_time_set_array ()
 
Input::Iterator< Input::Recordget_output_mesh_record ()
 
void write_time_frame ()
 
std::shared_ptr< Observeobserve ()
 
void clear_data (void)
 Clear data for output computed by method compute_field_data. More...
 
bool is_output_mesh_init ()
 
bool enable_refinement ()
 Return auxiliary flag enable_refinement_. More...
 
std::shared_ptr< OutputMeshBasecreate_output_mesh_ptr (bool init_input, bool discont=false)
 
std::shared_ptr< OutputMeshBaseget_output_mesh_ptr (bool discont=false)
 
int get_rank ()
 
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)
 

Static Public Member Functions

static const Input::Type::Recordget_input_type ()
 The specification of output stream. More...
 
static Input::Type::Abstractget_input_format_type ()
 The specification of output file format. More...
 
static std::shared_ptr< OutputTimecreate_output_stream (const std::string &equation_name, Mesh &mesh, const Input::Record &in_rec)
 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 = 3
 

Protected Member Functions

void compute_discontinuous_output_mesh ()
 
void fix_main_file_extension (std::string extension)
 
virtual int write_data (void)=0
 Virtual method for writing data to output file. More...
 

Protected Attributes

int rank
 
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_
 
Mesh_mesh
 
std::shared_ptr< OutputMeshoutput_mesh_
 Output mesh. More...
 
std::shared_ptr< OutputMeshDiscontinuousoutput_mesh_discont_
 Discontinuous (non-conforming) mesh. Used for CORNER_DATA. More...
 
std::shared_ptr< Observeobserve_
 
bool enable_refinement_
 Auxiliary flag for refinement enabling, due to gmsh format. More...
 

Detailed Description

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 44 of file output_time.hh.

Member Typedef Documentation

typedef unsigned int OutputTime::DiscreteSpaceFlags

Maps names of output fields required by user to their indices in output_data_vec_.

Definition at line 106 of file output_time.hh.

Definition at line 112 of file output_time.hh.

Map field name to its OutputData object.

Definition at line 111 of file output_time.hh.

Member Enumeration Documentation

Enumerator
NODE_DATA 
CORNER_DATA 
ELEM_DATA 

Definition at line 96 of file output_time.hh.

Constructor & Destructor Documentation

OutputTime::OutputTime ( )

Default constructor. Only for testing.

Definition at line 67 of file output_time.cc.

OutputTime::~OutputTime ( void  )
virtual

Destructor of OutputTime. It doesn't do anything, because all necessary destructors will be called in destructor of Output.

Definition at line 101 of file output_time.cc.

Member Function Documentation

void OutputTime::clear_data ( void  )

Clear data for output computed by method compute_field_data.

Definition at line 252 of file output_time.cc.

Here is the caller graph for this function:

void OutputTime::compute_discontinuous_output_mesh ( )
protected

Definition at line 154 of file output_time.cc.

Here is the caller graph for this function:

std::shared_ptr< OutputMeshBase > OutputTime::create_output_mesh_ptr ( bool  init_input,
bool  discont = false 
)

Create shared pointer of output_mesh_ or output_mesh_discont_ (if discont is true) and return its.

Parameters
init_inputCall constructor with initialization from Input Record
discontDetermines type of output mesh (output_mesh_ or output_mesh_discont_)

Definition at line 125 of file output_time.cc.

Here is the caller graph for this function:

std::shared_ptr< OutputTime > OutputTime::create_output_stream ( const std::string &  equation_name,
Mesh mesh,
const Input::Record in_rec 
)
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 196 of file output_time.cc.

Here is the caller graph for this function:

bool OutputTime::enable_refinement ( )
inline

Return auxiliary flag enable_refinement_.

Definition at line 149 of file output_time.hh.

void OutputTime::fix_main_file_extension ( std::string  extension)
protected

Change main filename to have prescribed extension.

Definition at line 162 of file output_time.cc.

Here is the caller graph for this function:

IT::Abstract & OutputTime::get_input_format_type ( )
static

The specification of output file format.

Definition at line 60 of file output_time.cc.

Here is the caller graph for this function:

const IT::Record & OutputTime::get_input_type ( )
static

The specification of output stream.

Returns
This variable defines record for output stream

Definition at line 37 of file output_time.cc.

Here is the caller graph for this function:

std::shared_ptr< OutputMeshBase > OutputTime::get_output_mesh_ptr ( bool  discont = false)

Get shared pointer of output_mesh_ or output_mesh_discont_ (if discont is true).

Definition at line 138 of file output_time.cc.

Here is the caller graph for this function:

Input::Iterator< Input::Record > OutputTime::get_output_mesh_record ( )

Return the input record for the output mesh of the output stream.

Definition at line 120 of file output_time.cc.

Here is the caller graph for this function:

int OutputTime::get_rank ( )
inline

Return MPI rank of process

Definition at line 169 of file output_time.hh.

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 115 of file output_time.cc.

void OutputTime::init_from_input ( const std::string &  equation_name,
Mesh mesh,
const Input::Record in_rec 
)
virtual

Constructor of OutputTime object. It opens base file for writing.

Parameters
[in]equation_nameThe name of equation, used for forming output file name.
[in]in_recThe reference on the input record

Reimplemented in OutputVTK.

Definition at line 78 of file output_time.cc.

Here is the caller graph for this function:

bool OutputTime::is_output_mesh_init ( )
inline

Return if shared pointer to output_mesh_ is created.

Definition at line 144 of file output_time.hh.

std::shared_ptr< Observe > OutputTime::observe ( )

Getter of the observe object.

Definition at line 239 of file output_time.cc.

template<typename T >
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:

  • compute discontinuous mesh if CORNER_DATA is calculated
  • find and return ElementDataCache of given field_name, create its if doesn't exist
Parameters
field_nameQuantity name of founding ElementDataCache
space_typeOutput discrete space
n_rowsCount of rows of data cache (used only if new cache is created)
n_colsCount of columns of data cache (used only if new cache is created)

Definition at line 78 of file output_time.impl.hh.

Here is the caller graph for this function:

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 94 of file output_time.cc.

Here is the caller graph for this function:

void OutputTime::update_time ( double  field_time)

Update the last time is actual time is less than field_time

Definition at line 147 of file output_time.cc.

Here is the caller graph for this function:

virtual int OutputTime::write_data ( void  )
protectedpure virtual

Virtual method for writing data to output file.

Implemented in OutputVTK, and OutputMSH.

Here is the caller graph for this function:

void OutputTime::write_time_frame ( )

Write all data registered as a new time frame.

Definition at line 210 of file output_time.cc.

Member Data Documentation

ofstream OutputTime::_base_file
protected

Base output stream

Definition at line 243 of file output_time.hh.

FilePath OutputTime::_base_filename
protected

Name of base output file

Definition at line 248 of file output_time.hh.

Mesh* OutputTime::_mesh
protected

Cached pointer at mesh used by this output stream

Definition at line 264 of file output_time.hh.

int OutputTime::current_step
protected

Current step

Definition at line 223 of file output_time.hh.

bool OutputTime::enable_refinement_
protected

Auxiliary flag for refinement enabling, due to gmsh format.

Definition at line 274 of file output_time.hh.

std::string OutputTime::equation_name_
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 254 of file output_time.hh.

Input::Record OutputTime::input_record_
protected

Record for current output stream

Definition at line 238 of file output_time.hh.

const unsigned int OutputTime::N_DISCRETE_SPACES = 3
static

Types of reference data

Definition at line 95 of file output_time.hh.

std::shared_ptr<Observe> OutputTime::observe_
protected

Definition at line 271 of file output_time.hh.

OutputDataFieldVec OutputTime::output_data_vec_[N_DISCRETE_SPACES]
protected

Registered output data. Single map for every value of DiscreteSpace corresponding to nodes, elements and corners.

Definition at line 218 of file output_time.hh.

std::shared_ptr<OutputMesh> OutputTime::output_mesh_
protected

Output mesh.

Definition at line 267 of file output_time.hh.

std::shared_ptr<OutputMeshDiscontinuous> OutputTime::output_mesh_discont_
protected

Discontinuous (non-conforming) mesh. Used for CORNER_DATA.

Definition at line 269 of file output_time.hh.

int OutputTime::precision_
protected

Number of decimal digits used for output of double values.

Definition at line 259 of file output_time.hh.

int OutputTime::rank
protected

Cached MPI rank of process (is tested in methods)

Definition at line 212 of file output_time.hh.

double OutputTime::time
protected

The newest time of registered data

Definition at line 228 of file output_time.hh.

double OutputTime::write_time
protected

The last time, when data was wrote to this stream

Definition at line 233 of file output_time.hh.


The documentation for this class was generated from the following files: