Version 2, position dependent E/B, kinetic ions, boris mover, terminator
This commit is contained in:
Executable
+120
@@ -0,0 +1,120 @@
|
||||
#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 { 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);
|
||||
|
||||
DensityField* densityField();
|
||||
VelocityDistribution* velocityDistibution();
|
||||
DriftVelocity* driftVelocity();
|
||||
|
||||
DynamicDensityField* dynamicDensityField();
|
||||
Mover* mover();
|
||||
Terminator* terminator();
|
||||
Reflector* reflector();
|
||||
|
||||
DeletionLogger* deletionLogger();
|
||||
void deletionLogger(std::shared_ptr<DeletionLogger> new_logger);
|
||||
|
||||
CurrentCollector* currentCollector();
|
||||
void currentCollector(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_;
|
||||
};
|
||||
|
||||
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 */
|
||||
Reference in New Issue
Block a user