Reworked logging model:
Added T+, T3+. Changes in logging hierarchie: Every species individually logs positions.
This commit is contained in:
@@ -14,41 +14,53 @@
|
||||
|
||||
#include "population_logger_base.h"
|
||||
|
||||
const int Particle_Logger_Builder::logging = load_parameter("logging");
|
||||
const int Particle_Logger_Builder::numberZBins = load_parameter("numberZBins");
|
||||
|
||||
Particle_Logger_Manager Particle_Logger_Builder::build(H5_File *h5f) {
|
||||
Particle_Logger_Manager ParticleLogger;
|
||||
H5_Particles *h5part = h5f->get_h5part();
|
||||
double z_rw = z_RW_m;
|
||||
ParticleLogger.add(build_eLogger(h5part));
|
||||
ParticleLogger.add(new Off_Particle_Logger(tritium));
|
||||
ParticleLogger.add (new MultiZ_Particle_Logger(tritiumI, 1, &z_rw, h5part->get_h5g_z()));
|
||||
ParticleLogger.add (new MultiZ_Particle_Logger(tritium2I, 1, &z_rw, h5part->get_h5g_z()));
|
||||
ParticleLogger.add (new MultiZ_Particle_Logger(tritium3I, 1, &z_rw, h5part->get_h5g_z()));
|
||||
|
||||
/*
|
||||
ParticleLogger.add(new Off_Particle_Logger(tritiumI));
|
||||
ParticleLogger.add(new Off_Particle_Logger(tritium2I));
|
||||
ParticleLogger.add(new Off_Particle_Logger(tritium3I));
|
||||
*/
|
||||
|
||||
if (logging == 0) {
|
||||
ParticleLogger.add(new Off_Particle_Logger(electron));
|
||||
ParticleLogger.add(new Off_Particle_Logger(tritiumI));
|
||||
ParticleLogger.add(new Off_Particle_Logger(tritium2I));
|
||||
ParticleLogger.add(new Off_Particle_Logger(tritium3I));
|
||||
} else if(numberZBins == -1){
|
||||
ParticleLogger.add(new SF_Particle_Logger(electron, h5f));
|
||||
ParticleLogger.add(new SF_Particle_Logger(tritiumI, h5f));
|
||||
ParticleLogger.add(new SF_Particle_Logger(tritium2I, h5f));
|
||||
ParticleLogger.add(new SF_Particle_Logger(tritium3I, h5f));
|
||||
} else {
|
||||
build_MultiZ(&ParticleLogger, h5f);
|
||||
}
|
||||
return ParticleLogger;
|
||||
}
|
||||
|
||||
Particle_Logger_Base *Particle_Logger_Builder::build_eLogger(H5_Particles *h5part) {
|
||||
Particle_Logger_Base *res;
|
||||
if (h5part->get_logging() == false) {
|
||||
res = new Off_Particle_Logger(electron);
|
||||
} else if(h5part->get_numberZBins() == -1){
|
||||
res = new SF_Particle_Logger(electron, h5part->get_h5g_z());
|
||||
} else {
|
||||
res = new MultiZ_Particle_Logger(electron, h5part->get_numberZBins(), h5part->get_zValues(), h5part->get_h5g_z());
|
||||
void Population_Logger_Builder::build_MultiZ(Particle_Logger_Manager *ParticleLogger, H5_File *h5f) {
|
||||
double *zValues = new double[numberZBins];
|
||||
double start_m = z_RW_m;
|
||||
double length_m = z_WGTS_end_m - start_m;
|
||||
double stepLength_m = length_m/(numberZBins-1);
|
||||
|
||||
double z_m;
|
||||
for (int i = 0;i<numberZBins;i++) {
|
||||
z_m = start_m + stepLength_m*i;
|
||||
zValues[i] = z_m;
|
||||
}
|
||||
return res;
|
||||
ParticleLogger->add(new MultiZ_Particle_Logger(electron, h5f, numberZBins, zValues));
|
||||
ParticleLogger->add(new MultiZ_Particle_Logger(tritiumI, h5f, numberZBins, zValues));
|
||||
ParticleLogger->add(new MultiZ_Particle_Logger(tritium2I, h5f, numberZBins, zValues));
|
||||
ParticleLogger->add(new MultiZ_Particle_Logger(tritium3I, h5f, numberZBins, zValues));
|
||||
|
||||
delete[] zValues;
|
||||
}
|
||||
|
||||
|
||||
Population_Logger_Manager Population_Logger_Builder::build(H5_File *h5f, Population_Manager *populations, Timer *timer) {
|
||||
Population_Logger_Manager Population_Loggers;
|
||||
hid_t *h5pop = h5f->get_h5pop()->get_h5g_pop();
|
||||
Population_Base *T2I_population = populations->find(tritium2I);
|
||||
Population_Loggers.add (new Population_Logger(T2I_population, timer, h5pop));
|
||||
Population_Loggers.add (new Population_Logger(populations->find(tritiumI), timer, h5f));
|
||||
Population_Loggers.add (new Population_Logger(populations->find(tritium2I), timer, h5f));
|
||||
Population_Loggers.add (new Population_Logger(populations->find(tritium3I), timer, h5f));
|
||||
return Population_Loggers;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user