Flow123d  jenkins-Flow123d-windows32-release-multijob-51
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | List of all members
OutputTime Class Referenceabstract

The class for outputing 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 = 3 }
 

Public Member Functions

 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")
 
 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, const Input::Type::Selection &in_sel)
 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)
 
template<int spacedim, class Value >
void register_data (const Input::Record &in_rec, const RefType type, MultiField< spacedim, Value > &multi_field)
 
template<int spacedim, class Value >
void register_data (const Input::Record &in_rec, const RefType ref_type, Field< spacedim, Value > &field_ref)
 

Static Public Member Functions

static void destroy_all (void)
 Try to find output stream from a key in record. More...
 
static OutputTimecreate_output_stream (const Input::Record &in_rec)
 This method write all registered data to output streams. More...
 

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...
 

Protected Types

enum  OutFileFormat { NONE = 0, GMSH = 1, VTK = 2 }
 
typedef enum
OutputTime::OutFileFormat 
OutFileFormat
 

Protected Member Functions

template<int spacedim, class Value >
void compute_field_data (DiscreteSpace space, Field< spacedim, Value > &field)
 
OutputDataBaseoutput_data_by_field_name (const string &field_name, DiscreteSpace ref_type)
 This method returns pointer at existing data, when corresponding output data exists or it creates new one. More...
 
void set_data_time (void *data, double time)
 This method set current time for registered data array/vector. More...
 
virtual int write_data (void)=0
 
virtual int write_head (void)=0
 
virtual int write_tail (void)=0
 
string * base_filename ()
 
ofstream & get_base_file (void)
 
ofstream & get_data_file (void)
 
string & get_data_filename (void)
 
Meshget_mesh (void)
 
unsigned int get_corner_count (void)
 
void set_data_file (ofstream *_data_file)
 
void set_mesh (Mesh *_mesh)
 
void set_base_file (ofstream *_base_file)
 

Protected Attributes

int rank
 MPI rank of process (is tested in methods) More...
 
OutFileFormat file_format
 
vector< OutputDataBase * > node_data
 
vector< OutputDataBase * > corner_data
 
vector< OutputDataBase * > elem_data
 
int current_step
 Current step. More...
 
double time
 The newest time of registered data. More...
 
double write_time
 The last time, when data was wrote to this stream. More...
 
map< string, bool > output_names
 Map of names of output fields. True means that field will be saved. More...
 
Input::Record input_record_
 

Static Protected Attributes

static std::vector< OutputTime * > output_streams
 Vector of pointers at OutputTime. More...
 

Private Attributes

ofstream * base_file
 Base output stream. More...
 
string * _base_filename
 Name of base output file. More...
 
string * data_filename
 Name of data output file. More...
 
ofstream * data_file
 Data output stream (could be same as base_file) More...
 
Meshmesh
 

Detailed Description

The class for outputing data during time.

This class is descendant of Output class. This class is used for outputing 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 37 of file output_time.hh.

Member Typedef Documentation

Enumeration of file formats supported by Flow123d

Member Enumeration Documentation

Types of reference data

Enumerator
NODE_DATA 
CORNER_DATA 
ELEM_DATA 

Definition at line 46 of file output_time.hh.

enum OutputTime::OutFileFormat
protected

Enumeration of file formats supported by Flow123d

Enumerator
NONE 
GMSH 
VTK 

Definition at line 182 of file output_time.hh.

Constructor & Destructor Documentation

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

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

Declaration of exceptions

Parameters
[in]in_recThe reference on the input record

Definition at line 248 of file output.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 310 of file output.cc.

Member Function Documentation

void OutputTime::add_admissible_field_names ( const Input::Array in_array,
const Input::Type::Selection in_sel 
)

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

Parameters
in_arrayArray of admissible fields (array of selections).
in_selTemporary - selection with field names.

Definition at line 231 of file output.cc.

Here is the caller graph for this function:

string* OutputTime::base_filename ( )
inlineprotected

Definition at line 223 of file output_time.hh.

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 428 of file output.cc.

Here is the caller graph for this function:

template<int spacedim, class Value >
void OutputTime::compute_field_data ( DiscreteSpace  space,
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 280 of file output.h.

Here is the caller graph for this function:

OutputTime * OutputTime::create_output_stream ( const Input::Record in_rec)
static

This method write all registered data to output streams.

Definition at line 171 of file output.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"   
)
void OutputTime::destroy_all ( void  )
static

Try to find output stream from a key in record.

Try to find output stream with this name Does OutputStream with same name and filename exist?

When this record is already created, then it returns pointer at corresponding OutputTime. When this record doesn't exist, then it create new OutputTime object and it puts this object to the array of OutputTime pointers

Parameters
[in]in_recThe reference at the input record This method delete all object instances of class OutputTime stored in output_streams vector

Definition at line 121 of file output.cc.

ofstream& OutputTime::get_base_file ( void  )
inlineprotected

Definition at line 225 of file output_time.hh.

unsigned int OutputTime::get_corner_count ( void  )
inlineprotected

Definition at line 233 of file output_time.hh.

ofstream& OutputTime::get_data_file ( void  )
inlineprotected

Definition at line 227 of file output_time.hh.

string& OutputTime::get_data_filename ( void  )
inlineprotected

Definition at line 229 of file output_time.hh.

Mesh* OutputTime::get_mesh ( void  )
inlineprotected

Definition at line 231 of file output_time.hh.

Here is the caller graph for this function:

void OutputTime::mark_output_times ( const TimeGovernor tg)

Add time marks matching given tgoutput_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 331 of file output.cc.

Here is the caller graph for this function:

OutputDataBase * OutputTime::output_data_by_field_name ( const string &  field_name,
DiscreteSpace  ref_type 
)
protected

This method returns pointer at existing data, when corresponding output data exists or it creates new one.

Definition at line 94 of file output.cc.

Here is the caller graph for this function:

template<int spacedim, class Value >
void OutputTime::register_data ( const Input::Record in_rec,
const RefType  type,
MultiField< spacedim, Value > &  multi_field 
)

Definition at line 8 of file output_impl.hh.

template<int spacedim, class Value >
void OutputTime::register_data ( const Input::Record in_rec,
const RefType  ref_type,
Field< spacedim, Value > &  field_ref 
)

Definition at line 19 of file output_impl.hh.

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 243 of file output.h.

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 262 of file output.h.

void OutputTime::set_base_file ( ofstream *  _base_file)
inlineprotected

Definition at line 250 of file output_time.hh.

Here is the caller graph for this function:

void OutputTime::set_data_file ( ofstream *  _data_file)
inlineprotected

Definition at line 243 of file output_time.hh.

void OutputTime::set_data_time ( void *  data,
double  time 
)
protected

This method set current time for registered data array/vector.

void OutputTime::set_mesh ( Mesh _mesh)
inlineprotected

Definition at line 248 of file output_time.hh.

Here is the caller graph for this function:

OutputTime::TYPEDEF_ERR_INFO ( EI_FieldName  ,
std::string   
)
virtual int OutputTime::write_data ( void  )
protectedpure virtual

Implemented in OutputVTK, and OutputMSH.

Here is the caller graph for this function:

virtual int OutputTime::write_head ( void  )
protectedpure virtual

Implemented in OutputVTK, and OutputMSH.

virtual int OutputTime::write_tail ( void  )
protectedpure virtual

Implemented in OutputVTK, and OutputMSH.

void OutputTime::write_time_frame ( )

Write all data registered as a new time frame.

Definition at line 362 of file output.cc.

Here is the caller graph for this function:

Member Data Documentation

string* OutputTime::_base_filename
private

Name of base output file.

Definition at line 171 of file output_time.hh.

ofstream* OutputTime::base_file
private

Base output stream.

Definition at line 170 of file output_time.hh.

vector<OutputDataBase*> OutputTime::corner_data
protected

Definition at line 268 of file output_time.hh.

int OutputTime::current_step
protected

Current step.

Definition at line 272 of file output_time.hh.

ofstream* OutputTime::data_file
private

Data output stream (could be same as base_file)

Definition at line 173 of file output_time.hh.

string* OutputTime::data_filename
private

Name of data output file.

Definition at line 172 of file output_time.hh.

vector<OutputDataBase*> OutputTime::elem_data
protected

Definition at line 269 of file output_time.hh.

OutFileFormat OutputTime::file_format
protected

Definition at line 263 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

Definition at line 280 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)),
"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.

Mesh* OutputTime::mesh
private

Definition at line 174 of file output_time.hh.

vector<OutputDataBase*> OutputTime::node_data
protected

Definition at line 267 of file output_time.hh.

map<string,bool> OutputTime::output_names
protected

Map of names of output fields. True means that field will be saved.

Definition at line 278 of file output_time.hh.

std::vector< OutputTime * > OutputTime::output_streams
staticprotected

Vector of pointers at OutputTime.

Definition at line 250 of file output_time.hh.

int OutputTime::rank
protected

MPI rank of process (is tested in methods)

Definition at line 261 of file output_time.hh.

double OutputTime::time
protected

The newest time of registered data.

Definition at line 274 of file output_time.hh.

double OutputTime::write_time
protected

The last time, when data was wrote to this stream.

Definition at line 276 of file output_time.hh.


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