Many, many more comments

This commit is contained in:
2024-12-04 17:15:04 +01:00
parent 8696517336
commit 03854339ca
100 changed files with 1702 additions and 49 deletions
+29
View File
@@ -8,41 +8,70 @@
#include "simulation/parameter.h"
#include "simulation/particle.h"
// defined in "simulation/random_numbers.h"
class RandomNumbers;
// defined in "simulation/interaction.h"
class InteractionOutput;
// defined in "simulation/electromagnetic_field.h"
class MagneticField;
class ElectricField;
// defined in "simulation/timer.h"
class Timer;
// defined in "simulation/injector.h"
class Injector;
// defined in "IO/simulation_output.h"
class SimulationOutput;
// defined in "simulation/cpu_synchronizer.h"
class CpuSynchronizer;
// defined in "simulation/species.h"
namespace species {
class Specie;
};
// defined in "simulation/interaction.h"
namespace interaction {
class InteractionOutput;
};
class Simulation {
public:
// Constructor: initialize everything using the json file at the path in parameter_filename
Simulation(std::string parameter_filename);
// function for initialization from Parameter object
void init(Parameter& parameter);
// function for main simulation loop
void start();
// function to finalize simulation
void finalize();
// process events until "events" number of beta decay chains have been
// simulated until completion
void processEvents(int events);
// process the Particle particle until it is terminated
// any interaction product created during the interactions during the propagation of
// particle are appened to the vector particle_queue
void processUntilTermination(particle::Particle& particle,
std::vector<particle::Particle>& particle_queue);
private:
// function to create particles from the injector (i.e. the event particles)
// also increases the time in the Timer object
std::vector<particle::Particle> determineInjectedParticles(
RandomNumbers* random);
// calculate the mean free path for the Particle particle
// the calculated target density scaled cross sections are then
// appened to the vector macroscopic_cross_sections_m to be used
// later in the interact function (to avoid an unneccessary recalculation)
double meanFreePath(particle::Particle& particle, RandomNumbers* random,
std::vector<double>& macroscopic_cross_sections_m);
// randomly chooses the interaction the particle will experience by
// using the values in the macroscopic_cross_sections_m vector (does NOT have to be normalized)
// as the relative weight for the corresponding interaction to occur
// afterwards perform the interaction and return the
// output of the as an InteractionOutput object
interaction::InteractionOutput interact(particle::Particle& particle,
RandomNumbers* random,
std::vector<double>& macroscopic_cross_sections_m);