Reworked Populations Loggers.
Added Save and Load Option for Population Data.
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
using namespace std;
|
||||
|
||||
|
||||
const long int Simulation::seed = getParameter("seed");
|
||||
const long int Simulation::numberTotalDecays = getParameter("numberTotalDecays");
|
||||
const long int Simulation::seed = load_parameter("seed");
|
||||
const long int Simulation::numberTotalDecays = load_parameter("numberTotalDecays");
|
||||
|
||||
void Simulation::init() {
|
||||
set_RNGs();
|
||||
@@ -26,7 +26,8 @@ void Simulation::init() {
|
||||
interactions = Interaction_Builder::build(&populations, &rngUni);
|
||||
terminators = Terminator_Builder::build();
|
||||
|
||||
pop_loggers = Population_Logger_Builder::build(&h5f, &populations);
|
||||
pop_loggers = Population_Logger_Builder::build(&h5f, &populations, &timer);
|
||||
pop_load_saver = Population_Load_Saver(&populations, &timer);
|
||||
|
||||
set_statusUpdater();
|
||||
}
|
||||
@@ -53,7 +54,7 @@ void Simulation::doit() {
|
||||
vec3 oldLoc_m;
|
||||
while ( (numberDecays < numberTotalDecays) || (!partQue.empty()) ) {
|
||||
if (partQue.empty()) {
|
||||
pop_loggers.log(numberDecays);
|
||||
pop_loggers.log();
|
||||
curPart = injector.injectElectron(numberTotalParticles);
|
||||
numberDecays++;
|
||||
numberTotalParticles++;
|
||||
@@ -78,7 +79,7 @@ void Simulation::doit() {
|
||||
partQue.back().set_Id(numberTotalParticles++);
|
||||
}
|
||||
if (IntOut.get_decrease_population()) {
|
||||
populations.find(IntOut.get_decrease_species())->decrease_denisty(IntOut.get_decrease_location());
|
||||
populations.find(IntOut.get_decrease_species())->decrease_denisty(IntOut.get_decrease_location(), IntOut.get_decrease_energy_eV());
|
||||
}
|
||||
if (IntOut.get_delete_current()) {
|
||||
break;
|
||||
@@ -86,7 +87,7 @@ void Simulation::doit() {
|
||||
}
|
||||
}
|
||||
}
|
||||
pop_loggers.log(numberDecays);
|
||||
pop_loggers.log();
|
||||
};
|
||||
|
||||
|
||||
@@ -148,10 +149,10 @@ void Simulation::do_interaction(Electron *interactElectron) {
|
||||
|
||||
void Simulation::parameterCheck_TC6() {
|
||||
if (
|
||||
getParameter("injectionMethod") == 1 &&
|
||||
getParameter("elaOn") == 0 &&
|
||||
getParameter("ionOn") == 1 &&
|
||||
getParameter("numberZBins") == -1
|
||||
load_parameter("injectionMethod") == 1 &&
|
||||
load_parameter("elaOn") == 0 &&
|
||||
load_parameter("ionOn") == 1 &&
|
||||
load_parameter("numberZBins") == -1
|
||||
) {
|
||||
return;
|
||||
}else {
|
||||
|
||||
Reference in New Issue
Block a user