Flow123d  jenkins-Flow123d-linux-release-multijob-282
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | 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 }
 

Public Member Functions

 OutputTime ()
 Default constructor. Only for testing. More...
 
 OutputTime (const Input::Record &in_rec)
 Constructor of OutputTime object. It opens base file for writing. More...
 
virtual ~OutputTime ()
 Destructor of OutputTime. It doesn't do anything, because all necessary destructors will be called in destructor of Output. More...
 
template<int spacedim, class Value >
void register_data (const DiscreteSpace type, MultiField< spacedim, Value > &multi_field)
 Generic method for registering output data stored in MultiField. More...
 
template<int spacedim, class Value >
void register_data (const DiscreteSpace ref_type, Field< spacedim, Value > &field)
 Generic method for registering of output data stored in Field. More...
 
void write_time_frame ()
 
void add_admissible_field_names (const Input::Array &in_array)
 Registers names of output fields that can be written using this stream. More...
 
void clear_data (void)
 Clear data for output computed by method compute_field_data. More...
 
void mark_output_times (const TimeGovernor &tg)
 
 TYPEDEF_ERR_INFO (EI_FieldName, std::string)
 
 DECLARE_EXCEPTION (ExcOutputVariableVector,<< "Can not output field "<< EI_FieldName::qval<< " returning variable size vectors. Try convert to MultiField.\n")
 

Static Public Member Functions

static OutputTimecreate_output_stream (const Input::Record &in_rec)
 This method delete all object instances of class OutputTime stored in output_streams vector. More...
 

Public Attributes

Input::AbstractRecord format_record_
 

Static Public Attributes

static Input::Type::Record input_type
 The specification of output stream. More...
 
static Input::Type::AbstractRecord input_format_type
 The specification of output file format. More...
 
static const unsigned int N_DISCRETE_SPACES = 3
 

Protected Types

typedef std::shared_ptr
< OutputDataBase
OutputDataPtr
 
typedef std::vector
< OutputDataPtr
OutputDataFieldVec
 
typedef unsigned int DiscreteSpaceFlags
 

Protected Member Functions

template<int spacedim, class Value >
void compute_field_data (DiscreteSpace type, Field< spacedim, Value > &field)
 
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
 
std::map< std::string,
DiscreteSpaceFlags
output_names
 
Input::Record input_record_
 
ofstream _base_file
 
string _base_filename
 
Mesh_mesh
 

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

Member Typedef Documentation

typedef unsigned int OutputTime::DiscreteSpaceFlags
protected

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

Definition at line 201 of file output_time.hh.

Definition at line 174 of file output_time.hh.

typedef std::shared_ptr<OutputDataBase> OutputTime::OutputDataPtr
protected

Map field name to its OutputData object.

Definition at line 173 of file output_time.hh.

Member Enumeration Documentation

Enumerator
NODE_DATA 
CORNER_DATA 
ELEM_DATA 

Definition at line 68 of file output_time.hh.

Constructor & Destructor Documentation

OutputTime::OutputTime ( )

Default constructor. Only for testing.

Definition at line 66 of file output_time.cc.

OutputTime::OutputTime ( const Input::Record in_rec)

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

Parameters
[in]in_recThe reference on the input record

Definition at line 74 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 91 of file output_time.cc.

Member Function Documentation

void OutputTime::add_admissible_field_names ( const Input::Array in_array)

Registers names of output fields that can be written using this stream.

Parameters
in_arrayArray of admissible fields (array of selections).

Definition at line 165 of file output_time.cc.

Here is the caller graph for this function:

void OutputTime::clear_data ( void  )

Clear data for output computed by method compute_field_data.

Definition at line 237 of file output_time.cc.

Here is the caller graph for this function:

template<int spacedim, class Value >
void OutputTime::compute_field_data ( DiscreteSpace  type,
Field< spacedim, Value > &  field 
)
protected

Interpolate given field into output discrete space and store the values into private storage for postponed output.

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

Here is the caller graph for this function:

OutputTime * OutputTime::create_output_stream ( 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 141 of file output_time.cc.

Here is the caller graph for this function:

OutputTime::DECLARE_EXCEPTION ( ExcOutputVariableVector  ,
<< "Can not output field "<< EI_FieldName::qval<< " returning variable size vectors. Try convert to MultiField.\n"   
)

Declaration of exception

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

Change main filename to have prescribed extension.

Definition at line 110 of file output_time.cc.

Here is the caller graph for this function:

void OutputTime::mark_output_times ( const TimeGovernor tg)

Add time marks matching given tg.output_mark_type as well as general output type TimeMarks::type_output(). The time marks denotes times when output should be performed according to the input record of the output stream, namely keys: time_step, time_list, and include_input_times.

Definition at line 182 of file output_time.cc.

Here is the caller graph for this function:

template<int spacedim, class Value >
void OutputTime::register_data ( const DiscreteSpace  type,
MultiField< spacedim, Value > &  multi_field 
)

Generic method for registering output data stored in MultiField.

Parameters
ref_typeType of output (element, node, corner data).
multi_fieldThe actual field for output.

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

Here is the caller graph for this function:

template<int spacedim, class Value >
void OutputTime::register_data ( const DiscreteSpace  ref_type,
Field< spacedim, Value > &  field 
)

Generic method for registering of output data stored in Field.

Parameters
ref_typeType of output (element, node, corner data).
fieldThe actual field for output.

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

OutputTime::TYPEDEF_ERR_INFO ( EI_FieldName  ,
std::string   
)

Declaration of new exception info used in following exception

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

Here is the caller graph for this function:

Member Data Documentation

ofstream OutputTime::_base_file
protected

Base output stream

Definition at line 212 of file output_time.hh.

string OutputTime::_base_filename
protected

Name of base output file

Definition at line 217 of file output_time.hh.

Mesh* OutputTime::_mesh
protected

Cached pointer at mesh used by this output stream

Definition at line 222 of file output_time.hh.

int OutputTime::current_step
protected

Current step

Definition at line 185 of file output_time.hh.

Input::AbstractRecord OutputTime::format_record_

Record for current output stream

Definition at line 143 of file output_time.hh.

AbstractRecord OutputTime::input_format_type
static
Initial value:
= AbstractRecord("OutputTime",
"Format of output stream and possible parameters.")

The specification of output file format.

Definition at line 62 of file output_time.hh.

Input::Record OutputTime::input_record_
protected

Record for current output stream

Definition at line 207 of file output_time.hh.

Record OutputTime::input_type
static
Initial value:
= Record("OutputStream", "Parameters of output.")
.declare_key("file", FileName::output(), Default::obligatory(),
"File path to the connected output file.")
.declare_key("format", OutputTime::input_format_type, Default::optional(),
"Format of output stream and possible parameters.")
.declare_key("time_step", Double(0.0),
"Time interval between outputs.\n"
"Regular grid of output time points starts at the initial time of the equation and ends at the end time which must be specified.\n"
"The start time and the end time are always added. ")
.declare_key("time_list", Array(Double(0.0)),
Default::read_time("List containing the initial time of the equation. \n You can prescribe an empty list to override this behavior."),
"Explicit array of output time points (can be combined with 'time_step'.")
.declare_key("add_input_times", Bool(), Default("false"),
"Add all input time points of the equation, mentioned in the 'input_fields' list, also as the output points.")

The specification of output stream.

Returns
This variable defines record for output stream

Definition at line 57 of file output_time.hh.

const unsigned int OutputTime::N_DISCRETE_SPACES = 3
static

Types of reference data

Definition at line 67 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 180 of file output_time.hh.

std::map<std::string, DiscreteSpaceFlags> OutputTime::output_names
protected

Definition at line 202 of file output_time.hh.

int OutputTime::rank
protected

Cached MPI rank of process (is tested in methods)

Definition at line 168 of file output_time.hh.

double OutputTime::time
protected

The newest time of registered data

Definition at line 190 of file output_time.hh.

double OutputTime::write_time
protected

The last time, when data was wrote to this stream

Definition at line 195 of file output_time.hh.


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