137 lines
4.1 KiB
C++
Executable File
137 lines
4.1 KiB
C++
Executable File
#ifndef SPECIES_H
|
|
#define SPECIES_H
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "simulation/parameter.h"
|
|
|
|
class Mover;
|
|
class Terminator;
|
|
class Reflector;
|
|
class Injector;
|
|
class DensityField;
|
|
class DynamicDensityField;
|
|
class ConstantDensityField;
|
|
class DeletionLogger;
|
|
class CurrentCollector;
|
|
class VelocityDistribution;
|
|
class DriftVelocity;
|
|
|
|
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* velocityDistibution() = 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,
|
|
std::shared_ptr<Mover> mover,
|
|
std::shared_ptr<Terminator> terminator,
|
|
std::shared_ptr<Reflector> reflector,
|
|
std::shared_ptr<DynamicDensityField> density_field,
|
|
std::shared_ptr<VelocityDistribution> velocity_distribution,
|
|
std::shared_ptr<DriftVelocity> drift_velocity,
|
|
std::shared_ptr<DynamicDensityField> last_sync_density_field);
|
|
|
|
DensityField* densityField();
|
|
VelocityDistribution* velocityDistibution();
|
|
DriftVelocity* driftVelocity();
|
|
|
|
DynamicDensityField* dynamicDensityField();
|
|
DynamicDensityField* lastSyncDensityField();
|
|
Mover* mover();
|
|
Terminator* terminator();
|
|
Reflector* reflector();
|
|
|
|
DeletionLogger* deletionLogger();
|
|
void deletionLogger(std::shared_ptr<DeletionLogger> new_logger);
|
|
|
|
DeletionLogger* lastSyncDeletionLogger();
|
|
void lastSyncDeletionLogger(std::shared_ptr<DeletionLogger> new_logger);
|
|
|
|
CurrentCollector* currentCollector();
|
|
void currentCollector(std::shared_ptr<CurrentCollector> new_collector);
|
|
|
|
CurrentCollector* lastSyncCurrentCollector();
|
|
void lastSyncCurrentCollector(
|
|
std::shared_ptr<CurrentCollector> new_collector);
|
|
|
|
std::vector<std::shared_ptr<interaction::Interaction>> interactions();
|
|
void addInteraction(std::shared_ptr<interaction::Interaction> interaction);
|
|
|
|
private:
|
|
std::shared_ptr<DynamicDensityField> density_field_;
|
|
std::shared_ptr<VelocityDistribution> velocity_distribution_;
|
|
std::shared_ptr<DriftVelocity> drift_velocity_;
|
|
|
|
std::shared_ptr<Mover> mover_;
|
|
std::shared_ptr<Terminator> terminator_;
|
|
std::shared_ptr<Reflector> reflector_;
|
|
|
|
std::shared_ptr<DeletionLogger> deletion_logger_;
|
|
std::shared_ptr<CurrentCollector> current_collector_;
|
|
std::vector<std::shared_ptr<interaction::Interaction>> interactions_;
|
|
|
|
// fields to store the date of the last synchronization
|
|
// (after a synchronization the last_sync field and the non-last_sync field
|
|
// contain the same data)
|
|
std::shared_ptr<DynamicDensityField> last_sync_density_field_;
|
|
std::shared_ptr<DeletionLogger> last_sync_deletion_logger_;
|
|
std::shared_ptr<CurrentCollector> last_sync_current_collector_;
|
|
};
|
|
|
|
class BackgroundSpecie : public Specie {
|
|
public:
|
|
BackgroundSpecie(ImplementedSpecies type,
|
|
std::string name,
|
|
double mass_kg,
|
|
double charge_C,
|
|
std::shared_ptr<ConstantDensityField> density_field,
|
|
std::shared_ptr<VelocityDistribution> velocity_distribution,
|
|
std::shared_ptr<DriftVelocity> drift_velocity);
|
|
|
|
DensityField* densityField();
|
|
VelocityDistribution* velocityDistibution();
|
|
DriftVelocity* driftVelocity();
|
|
|
|
private:
|
|
std::shared_ptr<ConstantDensityField> density_field_;
|
|
std::shared_ptr<VelocityDistribution> velocity_distribution_;
|
|
std::shared_ptr<DriftVelocity> drift_velocity_;
|
|
};
|
|
|
|
}; // namespace species
|
|
|
|
#endif /* SPECIES_H */
|