Injection stride on a per injected species basis

This commit is contained in:
2025-10-07 13:15:15 +02:00
parent 8425535f9d
commit 4a11245994
5 changed files with 116 additions and 134 deletions
+12 -5
View File
@@ -28,7 +28,9 @@ struct InjectorInfo {
public:
std::shared_ptr<species::TrackedSpecie> created_specie;
std::shared_ptr<VelocityDistribution> creation_velocity_distribution;
// int multiplicity;
double weight = 0;
int injection_group;
int injection_stride;
};
class Injector {
@@ -39,11 +41,16 @@ class Injector {
std::shared_ptr<DriftVelocity> mother_drift_velocity);
std::vector<particle::Particle> rollNewParticles(std::mt19937* engine,
const double current_time,
const double beta_particle_weight);
const int timestep);
// draw new particles from the DynamicDensityField of the provided specie
// the new particles are then appened to the vector queue
// physical_number: physical number of particles that are injected in one
// timestep
// numerical_number: number of numerical beta particles to be injected on
// a single process
void setWeights(const double physical_number, const int numerical_number);
// draw new particles from the DynamicDensityField of the provided specie,
// the new particles are then appened to the vector 'queue'
// the magnetic field is necessary for the determination of the direction of the
// injected particles
// the weight_factor scales the time a particle contributes to a certain bin
+1 -9
View File
@@ -34,16 +34,12 @@ class Simulation {
void init(Parameter& parameter);
void start();
void finalize();
// cpu_syncs only included for debug purposes, e.g. only drawing decay particles
// at the 0th timestep
void processEvents(int events, const double beta_particle_weight);
void processEvents(int events);
void processDensityEvents(int particles_per_bin, const double weight_factor);
void processUntilTermination(particle::Particle& particle);
private:
std::vector<particle::Particle> determineInjectedParticles(RandomNumbers* random,
const double beta_particle_weight);
std::vector<particle::Particle> determineInjectedDensityParticles(
RandomNumbers* random,
const double weight_factor,
@@ -51,10 +47,6 @@ class Simulation {
std::map<std::string, double>& particleNumbers,
bool& all_bins_done);
// double meanFreePath(particle::Particle& particle, RandomNumbers* random,
// std::vector<double>& macroscopic_cross_sections_m);
// draw the individual collision times of the possible interactions and return the
// minimum of them. Also sets the "nextInteractionIndex" in the particle to the
// interaction of the chosen time.