ivutils
Loading...
Searching...
No Matches
TextRecorder< vset_t > Class Template Reference

This class records fields to the text file. More...

#include <detector.h>

Inheritance diagram for TextRecorder< vset_t >:
Collaboration diagram for TextRecorder< vset_t >:

Public Member Functions

 TextRecorder (const std::string &fname_="")
 columns names which will be printed as a header of the file
 
void SetTypes (int argtype_, int outtype, std::vector< std::string > *columns_=nullptr)
 set using space coordinates, output fields and names for them
 
void SetRecordingFileNode (int node)
 set node which records file (in parallel regime file can be recorded only from one node)
 
void Flush ()
 if data is recorded to file, flush data from buffer to disc
 
int StartRecord (int it)
 Start recording.
 
- Public Member Functions inherited from FieldsRecorder
 FieldsRecorder (const std::string &fn, int bin_format_=DATAFILE_BIN_FORMAT::BIN_RAW)
 Sets file name and binary format for recording, one of DATAFILE_BIN_FORMAT.
 
virtual void SetBytesSize (size_t ds)
 size of one record in bytes
 
void SetSize (size_t sz)
 number of points where field is recorded
 
virtual void record (int node)
 set node which process data for current point (used for Fourier-on-fly)
 
virtual void SetFrequencyRange (vec_type fmin, vec_type fmax, vec_type df, bool use_lambda_=false)
 set frequency range for recorders that perform Fourieron-fly transformation
 
virtual bool active ()
 returns false if this recorder is not working
 
virtual int SetTextHeader (const std::string &head_)
 Set slice (frame) text header .
 
virtual void SetExtra (const std::string &extra_)
 set extra string which will be written in the text file, used in text recorders only
 
- Public Member Functions inherited from apComponent
void InitComponent (const apComponent &other, const std::vector< int > &p_id=std::vector< int >())
 borrow settings from other component
 
virtual void DumpOther (const apComponent *comp, bool lim=false)
 dump some component using dumper
 
virtual void DumpOther (int flags, const apComponent *comp, bool lim=false)
 dump some component using dumper and checking bit flags
 
virtual void Dump (bool lim=false)
 dump itself using dumper
 
- Public Member Functions inherited from restorer
int save_data (FILE *f)
 save data to the file
 
int load_data (FILE *f)
 read data from the file
 
int save_data (const char *fname)
 save data to the file
 
int load_data (const char *fname)
 read data from the file
 

Protected Attributes

bool if_record
 only node, which has if_record=true, records fields to the file.
 
std::string format
 text file descriptor
 
vset_t * vset
 data fprintf format
 
int argtype
 points where fields are recorded
 
std::vector< std::string > columns
 recorded space coordinates
 
int wf
 if first bit is turned on, then recorded fields values are assumed to be zero
 
size_t vnum
 number of points where fields are recorded
 
size_t rec_size
 number of fields per point
 
- Protected Attributes inherited from FieldsRecorder
std::string fname
 file name
 
int wf
 if first bit is turned on, then recorded fields values are assumed to be zero
 
size_t rec_size
 number of fields per point
 
size_t bytes_size
 sizeof(vec_type)*rec_size

 
size_t vnum
 number of points where fields are recorded
 
int bin_format
 binary format flag for large files
 
- Protected Attributes inherited from apComponent
int ut
 if information about this object will be dumped
 
std::string name
 if timers will be used
 

Additional Inherited Members

- Protected Types inherited from apComponent
typedef std::set< apComponent * > registry_t
 name used in dump and runlog files
 
- Protected Member Functions inherited from apComponent
virtual void AddDefaultTimers (const std::vector< int > &p_id)
 connect internal timers hierarchy from log to external timers p_id
 
void start (int id)
 start timers
 
void stop (int id, int force=0)
 stop timers
 

Detailed Description

template<class vset_t>
class TextRecorder< vset_t >

This class records fields to the text file.

After calculation this text file can be used to plot fields history.

Member Function Documentation

◆ StartRecord()

template<class vset_t >
int TextRecorder< vset_t >::StartRecord ( int  it)
virtual

Start recording.

Parameters
ititeration from which recording is started (not zero if record is continuing after restarting the numerical experiment, it<0 means refreshing old file).

Implements FieldsRecorder.

Member Data Documentation

◆ if_record

template<class vset_t >
bool TextRecorder< vset_t >::if_record
protected

only node, which has if_record=true, records fields to the file.

other nodes only collect field and send it to this node
1 is initialization is successful, otherwise -1


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