Added option whether particles should be stored

explicitly
This commit is contained in:
2025-09-09 10:49:57 +02:00
parent c57dd44dde
commit 641e26c10b
6 changed files with 70 additions and 43 deletions
+8
View File
@@ -59,6 +59,7 @@ class TrackedSpecie : public Specie {
std::string name,
double mass_kg,
double charge_C,
bool explicitly_stored,
std::shared_ptr<Mover> mover,
std::shared_ptr<Terminator> terminator,
std::shared_ptr<Reflector> reflector,
@@ -95,6 +96,8 @@ class TrackedSpecie : public Specie {
// getter for the raw pointer to the RandomIndex object
RandomIndex* randomIndex();
bool explicitlyStored();
private:
std::shared_ptr<DynamicDensityField> density_field_;
std::shared_ptr<VelocityDistribution> velocity_distribution_;
@@ -115,6 +118,11 @@ class TrackedSpecie : public Specie {
velocity_distribution_from_density_;
std::shared_ptr<RandomIndex> random_index_;
// should work if it changes from true -> false (after a restart)
// however, it should not work in the opposite case (in which the
// old density would be lost)
const bool explicitly_stored_;
};
class BackgroundSpecie : public Specie {