Decoupled the number of events simulated from

the timestep;
Bug with density drawing present
(if CPU syncs don't line up with the timestep)
This commit is contained in:
2025-02-12 14:07:43 +01:00
parent e205e7469e
commit 047cfa8491
5 changed files with 73 additions and 50 deletions
+3 -2
View File
@@ -28,7 +28,7 @@ struct InjectorInfo {
public:
std::shared_ptr<species::TrackedSpecie> created_specie;
std::shared_ptr<VelocityDistribution> creation_velocity_distribution;
int multiplicity;
// int multiplicity;
};
class Injector {
@@ -39,7 +39,8 @@ class Injector {
std::shared_ptr<DriftVelocity> mother_drift_velocity);
std::vector<particle::Particle> rollNewParticles(std::mt19937* engine,
const double current_time);
const double current_time,
const double beta_particle_weight);
// draw new particles from the DynamicDensityField of the provided specie
// the new particles are then appened to the vector queue
+4 -2
View File
@@ -36,11 +36,13 @@ class Simulation {
void finalize();
// cpu_syncs only included for debug purposes, e.g. only drawing decay particles
// at the 0th timestep
void processEvents(int events, int density_events, int cpu_syncs);
void processEvents(int events, int density_events, int cpu_syncs,
const double beta_particle_weight);
void processUntilTermination(particle::Particle& particle);
private:
std::vector<particle::Particle> determineInjectedParticles(RandomNumbers* random);
std::vector<particle::Particle> determineInjectedParticles(RandomNumbers* random,
const double beta_particle_weight);
std::vector<particle::Particle>
determineInjectedDensityParticles(RandomNumbers* random,
const int numberParticlesToDraw, const int current,