Flow123d  release_2.1.0-84-g6a13a75
Public Types | Public Member Functions | Static Public Member Functions | 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...
 
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...
 
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 ()
 
void make_output_mesh (FieldSet &output_fields)
 
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 ()
 
std::shared_ptr< Observeobserve ()
 
void clear_data (void)
 Clear data for output computed by method compute_field_data. More...
 
 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 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 Types

typedef std::shared_ptr< OutputDataBaseOutputDataPtr
 
typedef std::vector< OutputDataPtrOutputDataFieldVec
 
typedef unsigned int DiscreteSpaceFlags
 

Protected Member Functions

void compute_discontinuous_output_mesh ()
 
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
 
Input::Record input_record_
 
ofstream _base_file
 
FilePath _base_filename
 
std::string equation_name_
 
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_
 Auxliary 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 48 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 219 of file output_time.hh.

Definition at line 192 of file output_time.hh.

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

Map field name to its OutputData object.

Definition at line 191 of file output_time.hh.

Member Enumeration Documentation

Enumerator
NODE_DATA 
CORNER_DATA 
ELEM_DATA 

Definition at line 90 of file output_time.hh.

Constructor & Destructor Documentation

OutputTime::OutputTime ( )

Default constructor. Only for testing.

Definition at line 65 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 92 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 247 of file output_time.cc.

Here is the caller graph for this function:

void OutputTime::compute_discontinuous_output_mesh ( )
protected

Definition at line 149 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 112 of file output_time.impl.hh.

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 191 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 157 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 58 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 38 of file output_time.cc.

Here is the caller graph for this function:

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

Here is the caller graph for this function:

void OutputTime::make_output_mesh ( FieldSet output_fields)

Create the output mesh from the given computational mesh. The field set passed in is used to select the field used for adaptivity of the output mesh.

Definition at line 111 of file output_time.cc.

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

Getter of the oubserve object.

Definition at line 234 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 84 of file output_time.impl.hh.

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

Member Data Documentation

ofstream OutputTime::_base_file
protected

Base output stream

Definition at line 229 of file output_time.hh.

FilePath OutputTime::_base_filename
protected

Name of base output file

Definition at line 234 of file output_time.hh.

Mesh* OutputTime::_mesh
protected

Cached pointer at mesh used by this output stream

Definition at line 245 of file output_time.hh.

int OutputTime::current_step
protected

Current step

Definition at line 203 of file output_time.hh.

bool OutputTime::enable_refinement_
protected

Auxliary flag for refinement enabling, due to gmsh format.

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

Input::Record OutputTime::input_record_
protected

Record for current output stream

Definition at line 224 of file output_time.hh.

const unsigned int OutputTime::N_DISCRETE_SPACES = 3
static

Types of reference data

Definition at line 89 of file output_time.hh.

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

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

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

Output mesh.

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

int OutputTime::rank
protected

Cached MPI rank of process (is tested in methods)

Definition at line 186 of file output_time.hh.

double OutputTime::time
protected

The newest time of registered data

Definition at line 208 of file output_time.hh.

double OutputTime::write_time
protected

The last time, when data was wrote to this stream

Definition at line 213 of file output_time.hh.


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