Version 2, position dependent E/B, kinetic ions, boris mover, terminator
This commit is contained in:
Executable
+131
@@ -0,0 +1,131 @@
|
||||
#include "simulation/species.h"
|
||||
|
||||
#include "simulation/current_collector.h"
|
||||
#include "simulation/density_field.h"
|
||||
#include "simulation/drift_velocity.h"
|
||||
#include "simulation/interaction.h"
|
||||
#include "simulation/logger.h"
|
||||
#include "simulation/mover.h"
|
||||
#include "simulation/parameter.h"
|
||||
#include "simulation/terminator.h"
|
||||
#include "simulation/velocity_distribution.h"
|
||||
|
||||
namespace species {
|
||||
|
||||
Specie::Specie(ImplementedSpecies type,
|
||||
std::string name,
|
||||
double mass_kg,
|
||||
double charge_C)
|
||||
: type_(type), name_(name), mass_kg_(mass_kg), charge_C_(charge_C) {}
|
||||
|
||||
double Specie::mass_kg() const {
|
||||
return mass_kg_;
|
||||
}
|
||||
double Specie::charge_C() const {
|
||||
return charge_C_;
|
||||
}
|
||||
ImplementedSpecies Specie::type() const {
|
||||
return type_;
|
||||
}
|
||||
std::string Specie::name() const {
|
||||
return name_;
|
||||
}
|
||||
|
||||
TrackedSpecie::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)
|
||||
: Specie(type, name, mass_kg, charge_C),
|
||||
mover_(mover),
|
||||
terminator_(terminator),
|
||||
reflector_(reflector),
|
||||
density_field_(density_field),
|
||||
deletion_logger_(std::shared_ptr<DeletionLogger>(nullptr)),
|
||||
current_collector_(std::shared_ptr<CurrentCollector>(nullptr)),
|
||||
velocity_distribution_(velocity_distribution),
|
||||
drift_velocity_(drift_velocity) {}
|
||||
|
||||
DensityField* TrackedSpecie::densityField() {
|
||||
return density_field_.get();
|
||||
}
|
||||
|
||||
VelocityDistribution* TrackedSpecie::velocityDistibution() {
|
||||
return velocity_distribution_.get();
|
||||
}
|
||||
DriftVelocity* TrackedSpecie::driftVelocity() {
|
||||
return drift_velocity_.get();
|
||||
}
|
||||
|
||||
DynamicDensityField* TrackedSpecie::dynamicDensityField() {
|
||||
return density_field_.get();
|
||||
}
|
||||
|
||||
Mover* TrackedSpecie::mover() {
|
||||
return mover_.get();
|
||||
}
|
||||
|
||||
Terminator* TrackedSpecie::terminator() {
|
||||
return terminator_.get();
|
||||
}
|
||||
|
||||
Reflector* TrackedSpecie::reflector() {
|
||||
return reflector_.get();
|
||||
}
|
||||
DeletionLogger* TrackedSpecie::deletionLogger() {
|
||||
return deletion_logger_.get();
|
||||
}
|
||||
|
||||
CurrentCollector* TrackedSpecie::currentCollector() {
|
||||
return current_collector_.get();
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<interaction::Interaction>>
|
||||
TrackedSpecie::interactions() {
|
||||
return interactions_;
|
||||
}
|
||||
|
||||
void TrackedSpecie ::addInteraction(
|
||||
std::shared_ptr<interaction::Interaction> interaction) {
|
||||
interactions_.push_back(interaction);
|
||||
}
|
||||
|
||||
void TrackedSpecie::deletionLogger(std::shared_ptr<DeletionLogger> new_logger) {
|
||||
deletion_logger_ = new_logger;
|
||||
}
|
||||
|
||||
void TrackedSpecie::currentCollector(
|
||||
std::shared_ptr<CurrentCollector> new_collector) {
|
||||
current_collector_ = new_collector;
|
||||
}
|
||||
|
||||
BackgroundSpecie::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)
|
||||
: Specie(type, name, mass_kg, charge_C),
|
||||
density_field_(density_field),
|
||||
velocity_distribution_(velocity_distribution),
|
||||
drift_velocity_(drift_velocity) {}
|
||||
|
||||
DensityField* BackgroundSpecie::densityField() {
|
||||
return density_field_.get();
|
||||
}
|
||||
VelocityDistribution* BackgroundSpecie::velocityDistibution() {
|
||||
return velocity_distribution_.get();
|
||||
}
|
||||
DriftVelocity* BackgroundSpecie::driftVelocity() {
|
||||
return drift_velocity_.get();
|
||||
}
|
||||
|
||||
} // namespace species
|
||||
Reference in New Issue
Block a user