Flow123d  DF_patch_fe_data_tables-b669755
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
Observe Class Reference

#include <observe.hh>

Collaboration diagram for Observe:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr< ElementDataCacheBaseOutputDataPtr
 
typedef std::map< string, OutputDataPtrOutputDataFieldMap
 

Public Member Functions

 Observe (string observe_name, Mesh &mesh, Input::Array in_array, unsigned int precision, const std::shared_ptr< TimeUnitConversion > &time_unit_conv)
 
 ~Observe ()
 Destructor, must close the file. More...
 
const std::vector< unsigned int > & observed_elements () const
 
void output_header ()
 
void output_time_frame (bool flush)
 
const std::vector< ObservePoint > & points () const
 
const Distributionpoint_ds () const
 
Range< ObservePointAccessorlocal_range () const
 Returns local range of observe points. More...
 
OutputDataPtr prepare_compute_data (std::string field_name, double field_time, unsigned int n_shape)
 
OutputDataPtr get_output_cache (std::string field_name)
 
PatchPointVecpatch_point_data ()
 Getter of patch_point_data. More...
 

Protected Member Functions

void flush_values ()
 Effectively writes the data into the observe stream. More...
 

Protected Attributes

int rank_
 
std::vector< ObservePointpoints_
 Full information about observe points. More...
 
std::vector< unsigned int > observed_element_indices_
 Elements of the o_points. More...
 
OutputDataFieldMap observe_field_values_
 Stored field values. More...
 
std::vector< double > observe_values_time_
 Common evaluation time of the fields for single time frame. More...
 
std::string observe_name_
 
std::ofstream observe_file_
 Output file stream. More...
 
unsigned int precision_
 Precision of float output. More...
 
std::shared_ptr< TimeUnitConversiontime_unit_conversion_
 Time unit conversion object. More...
 
bool no_fields_warning =false
 
std::vector< LongIdxpoint_4_loc_
 Index set assigning to local point index its global index. More...
 
Distributionpoint_ds_
 Parallel distribution of observe points. More...
 
unsigned int observe_time_idx_
 Index of actual (last) time in observe_values_time_ vector. More...
 
PatchPointVec patch_point_data_
 Holds observe data of eval points on patch. More...
 

Static Protected Attributes

static const unsigned int max_observe_value_time = 1000
 Maximal size of observe values times vector. More...
 

Friends

class ObservePointAccessor
 

Detailed Description

This class takes care about the observe points in the output stream, storing observe values of the fields and their output in the YAML format.

Definition at line 228 of file observe.hh.

Member Typedef Documentation

◆ OutputDataFieldMap

Definition at line 232 of file observe.hh.

◆ OutputDataPtr

typedef std::shared_ptr<ElementDataCacheBase> Observe::OutputDataPtr

Definition at line 231 of file observe.hh.

Constructor & Destructor Documentation

◆ Observe()

Observe::Observe ( string  observe_name,
Mesh mesh,
Input::Array  in_array,
unsigned int  precision,
const std::shared_ptr< TimeUnitConversion > &  time_unit_conv 
)

Construct the observation object.

observe_name - base name of the output file, the equation name. mesh - the mesh used for search for the observe points in_array - the array of observe points

Definition at line 340 of file observe.cc.

◆ ~Observe()

Observe::~Observe ( )

Destructor, must close the file.

Definition at line 394 of file observe.cc.

Member Function Documentation

◆ flush_values()

void Observe::flush_values ( )
protected

Effectively writes the data into the observe stream.

Definition at line 432 of file observe.cc.

Here is the caller graph for this function:

◆ get_output_cache()

OutputDataPtr Observe::get_output_cache ( std::string  field_name)
inline

Return pointer to ElementDataCache of given field.

Parameters
field_nameQuantity name of founding ElementDataCache

Definition at line 300 of file observe.hh.

Here is the caller graph for this function:

◆ local_range()

Range< ObservePointAccessor > Observe::local_range ( ) const

Returns local range of observe points.

Definition at line 488 of file observe.cc.

Here is the caller graph for this function:

◆ observed_elements()

const std::vector<unsigned int>& Observe::observed_elements ( ) const
inline

Provides a vector of element indices on which the observation values are evaluated. This can be used to evaluate derived fields only on these elements in the times not selected to full output.

Definition at line 253 of file observe.hh.

◆ output_header()

void Observe::output_header ( )

Output file header.

Definition at line 420 of file observe.cc.

Here is the caller graph for this function:

◆ output_time_frame()

void Observe::output_time_frame ( bool  flush)

Sets next output time frame of observe. If the table is full, writes field values to the output file. Using the YAML format. Argument flush starts writing to output file explicitly.

Definition at line 463 of file observe.cc.

◆ patch_point_data()

PatchPointVec& Observe::patch_point_data ( )
inline

Getter of patch_point_data.

Definition at line 307 of file observe.hh.

Here is the caller graph for this function:

◆ point_ds()

const Distribution* Observe::point_ds ( ) const
inline

Return point distribution

Definition at line 276 of file observe.hh.

◆ points()

const std::vector<ObservePoint>& Observe::points ( ) const
inline

Return points_ vector

Definition at line 270 of file observe.hh.

◆ prepare_compute_data()

Observe::OutputDataPtr Observe::prepare_compute_data ( std::string  field_name,
double  field_time,
unsigned int  n_shape 
)

Prepare data for computing observe values.

Method:

  • check that all fields of one time frame are evaluated at the same time
  • find and return ElementDataCache of given field_name, create its if doesn't exist.
Parameters
field_nameQuantity name of founding ElementDataCache
field_timeActual computing time
n_shapeCount of rows * cols of data cache (used only if new cache is created)

Definition at line 401 of file observe.cc.

Friends And Related Function Documentation

◆ ObservePointAccessor

friend class ObservePointAccessor
friend

Definition at line 361 of file observe.hh.

Member Data Documentation

◆ max_observe_value_time

const unsigned int Observe::max_observe_value_time = 1000
staticprotected

Maximal size of observe values times vector.

Definition at line 318 of file observe.hh.

◆ no_fields_warning

bool Observe::no_fields_warning =false
protected

Definition at line 347 of file observe.hh.

◆ observe_field_values_

OutputDataFieldMap Observe::observe_field_values_
protected

Stored field values.

Definition at line 329 of file observe.hh.

◆ observe_file_

std::ofstream Observe::observe_file_
protected

Output file stream.

Definition at line 339 of file observe.hh.

◆ observe_name_

std::string Observe::observe_name_
protected

Definition at line 336 of file observe.hh.

◆ observe_time_idx_

unsigned int Observe::observe_time_idx_
protected

Index of actual (last) time in observe_values_time_ vector.

Definition at line 356 of file observe.hh.

◆ observe_values_time_

std::vector<double> Observe::observe_values_time_
protected

Common evaluation time of the fields for single time frame.

Definition at line 333 of file observe.hh.

◆ observed_element_indices_

std::vector<unsigned int> Observe::observed_element_indices_
protected

Elements of the o_points.

Definition at line 326 of file observe.hh.

◆ patch_point_data_

PatchPointVec Observe::patch_point_data_
protected

Holds observe data of eval points on patch.

Definition at line 359 of file observe.hh.

◆ point_4_loc_

std::vector<LongIdx> Observe::point_4_loc_
protected

Index set assigning to local point index its global index.

Definition at line 350 of file observe.hh.

◆ point_ds_

Distribution* Observe::point_ds_
protected

Parallel distribution of observe points.

Definition at line 353 of file observe.hh.

◆ points_

std::vector<ObservePoint> Observe::points_
protected

Full information about observe points.

Definition at line 324 of file observe.hh.

◆ precision_

unsigned int Observe::precision_
protected

Precision of float output.

Definition at line 342 of file observe.hh.

◆ rank_

int Observe::rank_
protected

Definition at line 321 of file observe.hh.

◆ time_unit_conversion_

std::shared_ptr<TimeUnitConversion> Observe::time_unit_conversion_
protected

Time unit conversion object.

Definition at line 344 of file observe.hh.


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