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
+18
View File
@@ -11,28 +11,46 @@
namespace interaction {
// class to define the output of an interaction
class InteractionOutput {
public:
// Constructor: incident particle is not flagged for deletion
InteractionOutput();
// if new_decider is true then the incident particle of the interaction is
// flagged for deletion
void deleteCurrentParticle(bool new_decider);
// return if the incident particle is flagged for deletion
bool deleteCurrentParticle();
// add particles that are created (not the incident) particles to the InteractionOutput
void add(const particle::Particle& new_particle);
// return the vector of particles that have been created by an interactoin
std::vector<particle::Particle> newParticles();
private:
// flag if the incident particle should be deleted
bool delete_current_particle_;
// vector for the interaction products (no including the incident particle even if it's not
// destroyed by the interaction)
std::vector<particle::Particle> new_particles_;
};
// parent class for all interactions (cannot be instantiated)
class Interaction {
public:
// Constructor: takes a function describing the cross section of used for the interaction as a function of energy (in eV)
// a shared_ptr to the Specie of the target species
Interaction(std::function<double(double)> cross_section,
std::shared_ptr<species::Specie> target);
// return the value of the cross section at the energy (in eV) energy_eV in m^2
virtual double microscopicCrossSection(double energy_eV);
// calculate the density scaled cross section for the Particle particle
// interacting with the defined target Specie (returns cross section * target density) (units: m^-1)
// assumes that v_particle >> v_target
virtual double macroscopicCrossSection(particle::Particle& particle);
// pure virtual function defining the specifics of the actual interaction
virtual InteractionOutput performInteraction(particle::Particle& particle,
RandomNumbers* generator) = 0;