#ifndef SPECIES_H #define SPECIES_H #include #include #include #include "simulation/parameter.h" class RandomIndex; class Mover; class Terminator; class Reflector; class Injector; class DensityField; class DynamicDensityField; class ConstantDensityField; class DeletionLogger; class CurrentCollector; class VelocityDistribution; class DriftVelocity; class PositionDistributionFromDensity; class VelocityDistributionFromDensityField; namespace interaction { class Interaction; }; namespace species { enum class ImplementedSpecies { T, T2, electron, Tplus, T2plus, T3plus }; class Specie { public: Specie(ImplementedSpecies type, std::string name, double mass_kg, double charge_C); double mass_kg() const; double charge_C() const; ImplementedSpecies type() const; std::string name() const; virtual DensityField* densityField() = 0; virtual VelocityDistribution* velocityDistribution() = 0; virtual DriftVelocity* driftVelocity() = 0; protected: const double mass_kg_; const double charge_C_; const ImplementedSpecies type_; const std::string name_; }; class TrackedSpecie : public Specie { public: TrackedSpecie(ImplementedSpecies type, std::string name, double mass_kg, double charge_C, bool explicitly_stored, std::shared_ptr mover, std::shared_ptr terminator, std::shared_ptr reflector, std::shared_ptr density_field, std::shared_ptr velocity_distribution, std::shared_ptr drift_velocity, std::shared_ptr density_for_drawing); DensityField* densityField(); VelocityDistribution* velocityDistribution(); DriftVelocity* driftVelocity(); DynamicDensityField* dynamicDensityField(); Mover* mover(); Terminator* terminator(); Reflector* reflector(); DeletionLogger* deletionLogger(); void deletionLogger(std::shared_ptr new_logger); DynamicDensityField* densityForDrawing(); CurrentCollector* currentCollector(); void currentCollector(std::shared_ptr new_collector); std::vector> interactions(); void addInteraction(std::shared_ptr interaction); // getter for the raw pointer to the positionDistributionFromDensity object PositionDistributionFromDensity* positionDistributionFromDensity(); // getter for the raw pointer to the VelocityDistributionFromDensityField object VelocityDistributionFromDensityField* velocityDistributionFromDensityField(); // getter for the raw pointer to the RandomIndex object RandomIndex* randomIndex(); bool explicitlyStored(); private: std::shared_ptr density_field_; std::shared_ptr velocity_distribution_; std::shared_ptr drift_velocity_; std::shared_ptr mover_; std::shared_ptr terminator_; std::shared_ptr reflector_; std::shared_ptr deletion_logger_; std::shared_ptr current_collector_; std::vector> interactions_; std::shared_ptr density_for_drawing_; std::shared_ptr position_distribution_from_density_; std::shared_ptr velocity_distribution_from_density_; std::shared_ptr 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 { public: BackgroundSpecie(ImplementedSpecies type, std::string name, double mass_kg, double charge_C, std::shared_ptr density_field, std::shared_ptr velocity_distribution, std::shared_ptr drift_velocity); DensityField* densityField(); VelocityDistribution* velocityDistribution(); DriftVelocity* driftVelocity(); private: std::shared_ptr density_field_; std::shared_ptr velocity_distribution_; std::shared_ptr drift_velocity_; }; }; // namespace species #endif /* SPECIES_H */