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
+16 -7
View File
@@ -15,22 +15,31 @@
Particle_Logger_Manager Particle_Logger_Builder::build(H5_File *h5f) {
Particle_Logger_Manager ParticleLogger;
H5_Particles *h5p = h5f->get_h5p();
H5_Particles *h5part = h5f->get_h5part();
ParticleLogger.add(build_eLogger(h5p));
ParticleLogger.add(build_eLogger(h5part));
ParticleLogger.add(new Off_Particle_Logger(tritiumI));
ParticleLogger.add(new Off_Particle_Logger(tritium2I));
return (ParticleLogger);
}
Particle_Logger_Base *Particle_Logger_Builder::build_eLogger(H5_Particles *h5p) {
Particle_Logger_Base *Particle_Logger_Builder::build_eLogger(H5_Particles *h5part) {
Particle_Logger_Base *res;
if (h5p->get_logging() == false) {
if (h5part->get_logging() == false) {
res = new Off_Particle_Logger(electron);
} else if(h5p->get_numberZBins() == -1){
res = new SF_Particle_Logger(electron, h5p->get_h5g_z());
} else if(h5part->get_numberZBins() == -1){
res = new SF_Particle_Logger(electron, h5part->get_h5g_z());
} else {
res = new MuliZ_Particle_Logger(electron, h5p->get_numberZBins(), h5p->get_zValues(), h5p->get_h5g_z());
res = new MuliZ_Particle_Logger(electron, h5part->get_numberZBins(), h5part->get_zValues(), h5part->get_h5g_z());
}
return (res);
}
Population_Logger_Manager Population_Logger_Builder::build(H5_File *h5f, Population_Manager *populations) {
Population_Logger_Manager Population_Logger;
H5_Populations *h5pop = h5f->get_h5pop();
Thermal_Base *T2I_population = dynamic_cast<Thermal_Base*>(populations->find(tritium2I));
Population_Logger.add(new Thermal_Population_Logger(T2I_population, h5pop->get_h5g_pop()));
return (Population_Logger);
}