ivutils
Loading...
Searching...
No Matches
FieldsRecorder Class Referenceabstract

Class for recording data. More...

#include <detector.h>

Inheritance diagram for FieldsRecorder:
Collaboration diagram for FieldsRecorder:

Public Member Functions

 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 SetRecordingFileNode (int node)=0
 set node which records file (in parallel regime file can be recorded only from one node)
 
virtual void record (int node)
 set node which process data for current point (used for Fourier-on-fly)
 
virtual void SetTypes (int argtype, int outtype, std::vector< std::string > *columns=nullptr)
 set using space coordinates, output fields and names for them
 
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 void Flush ()
 if data is recorded to file, flush data from buffer to disc
 
virtual int StartRecord (int it)=0
 Start recording.
 
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

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

Class for recording data.

There are following phases to work with this class:

  1. Initialization using SetSize and SetRecordingFileNode
  2. record
  3. StartRecord
  4. NextRecord with array of current field values as an argument
  5. EndRecord

Member Function Documentation

◆ SetTextHeader()

virtual int FieldsRecorder::SetTextHeader ( const std::string &  head_)
inlinevirtual

Set slice (frame) text header .

Supported by QPLT format. The information will be used while writing the next slice header.

Reimplemented in FileRecorder.

◆ StartRecord()

virtual int FieldsRecorder::StartRecord ( int  it)
pure 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).

Implemented in TextRecorder< vset_t >, TextFluxRecorder< vset_t >, emFourierRecorder, and FileRecorder.


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