Bugfixes;

Restarts now reproduce longer Sims
This commit is contained in:
2024-09-11 14:56:14 +02:00
parent 75bb2e4d85
commit b4cbd8c44c
9 changed files with 53 additions and 14 deletions
+8 -1
View File
@@ -37,7 +37,14 @@ MaxwellBoltzmann::MaxwellBoltzmann(double temperature_K)
}
double MaxwellBoltzmann::rollEnergy(std::mt19937* engine) {
return distribution_(*engine);
double value = distribution_(*engine);
// this makes (the test case) reproduceable through restart
// but it does impact the efficiency of the drawing (simple test
// resultet in about an increase of 50% for the function call)
// however, i think that that time increse is almost negligible
// compared to the rest of the operations in the simulation
distribution_.reset();
return value;
}
Constant::Constant(double constant_eV) : constant_eV_(constant_eV) {