PopWriter

The class PopWriter is used to write the population data to a subgroup of the populations group.

It owns specialized writers for the various environment and population data.

Code:

PublicMethods

constructor

PopWriter(std::vector<PopBase *> vPops);

The constructor copies the vector of populations to an internal vector.

destructor

~PopWriter();

The destructor closes open HDF handles.

write

int write(const std::string sFilename,   int iStep,              float fStartTime,
          const std::string sInfoString, const std::string sSpc, int iWSpecial, int iDumpMode=-1);
int write(hid_t hFile, const std::string sSub, int iWSpecial, int iDumpMode=-1);
The first version creates (or opens) a qdf file and writes the population data.
The second version uses the open file to write the population data
sFileName

Name of output file.

iStep

The current simulation step. This number is saved as an attribute in the output file’s root group.

fStartTime

The start time of the simulation (i.e. the ‘real’ time at step 0). This number is also saved as an attribute in the output file’s root group.

sInfoString

An arbitrary string which will be saved as an attribute in the output file’s root group.

sSpc

Species name of the population to be written

iWSpecial

A population specific write flag. An or-ed combination of the values shown in the table below.

Pop-specific Flag

Value

meaninging

PW_NONE

0

Write nothing

PW_AGENTS_ONLY

1

Write agent data only

PW_STATS_ONLY

2

Write move statistics only

PW_ADDITIONAL_ONLY

4

Write additional data only

PW_ALL

7

Write all

iDumpMode

Dump mode. If -1, normal writing is performed, otherwise use LBController::DUMP_MODE_FLAT (0) or LBController::DUMP_MODE_SMART (1).

Returns 0 on success, -1 on failure.

openPopulationGroup

int openPopulationGroup():

Opens the population group and stores the HDF handle to it.

Returns 0 on success, -1 on failure.

closePopulationGroup

void closePopulationGroup();

Closes the population group.

Protected Methods

opencreatePopGroup

int opencreatePopGroup();

Opens or creates the population group and stores the HDF handle to it.

Returns 0 on success, -1 on failure.

opencreateSpeciesGroup

int opencreateSpeciesGroup(PopBase *pPB, int iDumpMode);

Opens or creates the species group and stores the HDF handle to it.

Returns 0 on success, -1 on failure.