Added class for population logging.
This commit is contained in:
@@ -13,36 +13,34 @@
|
||||
|
||||
|
||||
class MuliZ_Particle_Logger : public Particle_Logger_Base {
|
||||
H5TB_Interface *h5tb;
|
||||
H5TB_Particle_Interface *h5tb;
|
||||
|
||||
int numberZBins;
|
||||
double *zLogValues;
|
||||
hid_t *h5g_z;
|
||||
|
||||
public:
|
||||
MuliZ_Particle_Logger(species this_species, const int &numberZBins, double *zLogValues, hid_t *h5g_z) : Particle_Logger_Base(this_species) {
|
||||
this->numberZBins = numberZBins;
|
||||
this->zLogValues = zLogValues;
|
||||
this->h5g_z = h5g_z;
|
||||
create();
|
||||
create(h5g_z);
|
||||
}
|
||||
private:
|
||||
void create();
|
||||
void create(hid_t *h5g_z);
|
||||
|
||||
public:
|
||||
void log(const Particle &logPart, const vec3 &oldLoc_m);
|
||||
};
|
||||
|
||||
|
||||
inline void MuliZ_Particle_Logger::create() {
|
||||
inline void MuliZ_Particle_Logger::create(hid_t *h5g_z) {
|
||||
std::string speciesName = get_species_string(get_species());
|
||||
if (numberZBins < 1) {
|
||||
std::stringstream ss;
|
||||
ss<<"MuliZ_Particle_Logger::create: numberZBins < 1.\n";
|
||||
}
|
||||
h5tb = new H5TB_Interface[numberZBins];
|
||||
h5tb = new H5TB_Particle_Interface[numberZBins];
|
||||
for (int i = 0; i < numberZBins; i++) {
|
||||
h5tb[i] = H5TB_Interface(speciesName, &h5g_z[i]);
|
||||
h5tb[i] = H5TB_Particle_Interface(speciesName, &h5g_z[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user