Basic changes for time resolution.

Input from json still suboptimal.
This commit is contained in:
2024-05-14 09:23:52 +02:00
parent cac5e6ff5d
commit 77fa8d175a
12 changed files with 84 additions and 36 deletions
+5 -2
View File
@@ -35,7 +35,9 @@ class Injector {
std::shared_ptr<EventPositionDistribution> position_distribution,
std::shared_ptr<DriftVelocity> mother_drift_velocity);
std::vector<particle::Particle> rollNewParticles(std::mt19937* engine);
std::vector<particle::Particle> rollNewParticles(std::mt19937* engine,
const double current_time,
const int time_resolution_events);
double timePassed() const;
private:
@@ -48,7 +50,8 @@ class Injector {
std::mt19937* engine,
const Coordinate& position,
std::shared_ptr<species::TrackedSpecie> created_specie,
std::shared_ptr<VelocityDistribution> creation_velocity_distribution);
std::shared_ptr<VelocityDistribution> creation_velocity_distribution,
const double time_birth);
};
#endif /* INJECTOR_H */
+2 -1
View File
@@ -14,7 +14,8 @@ class Particle {
// Vector* velocity);
Particle(std::shared_ptr<species::TrackedSpecie> specie,
const Coordinate& position,
const Vector& velocity);
const Vector& velocity,
const double time_birth);
void position(const Coordinate& new_position);
CartesianCoordinate position() const;
+5 -3
View File
@@ -34,13 +34,15 @@ class Simulation {
void init(Parameter& parameter);
void start();
void finalize();
void processEvents(int events);
void processEvents(int events, std::vector<particle::Particle>& backup_queue,
const int time_resolution_events);
void processUntilTermination(particle::Particle& particle,
std::vector<particle::Particle>& particle_queue);
std::vector<particle::Particle>& particle_queue,
std::vector<particle::Particle>& backup_queue);
private:
std::vector<particle::Particle> determineInjectedParticles(
RandomNumbers* random);
RandomNumbers* random, const int time_resolution_events);
double meanFreePath(particle::Particle& particle, RandomNumbers* random);
+1 -1
View File
@@ -4,7 +4,7 @@
#include "simulation/particle.h"
class Geometry;
class DynamicDensityField;
class Terminator {
public:
Terminator(long int max_interactions,