Added class for population logging.

This commit is contained in:
Christian
2019-06-04 09:23:55 +02:00
parent 8af5ca0427
commit 142197d10a
25 changed files with 669 additions and 80 deletions
+6 -8
View File
@@ -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]);
}
}