Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc226a8d53 | ||
|
|
1f4314c527 | ||
|
|
1efcb58d35 | ||
|
|
30b0178e5f | ||
|
|
ab7c6f20cc |
@@ -49,7 +49,7 @@ class SimulationOutput {
|
||||
std::vector<OutputTask> tasks_density_fields_;
|
||||
std::vector<OutputTask> tasks_current_collector_;
|
||||
std::vector<OutputTask> tasks_deletion_logger_;
|
||||
OutputTask task_potential_; // no meta data written for now
|
||||
OutputTask task_potential_;
|
||||
|
||||
Hdf5Writer writer;
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ std::function<double(double)> Constant(double constant);
|
||||
|
||||
std::function<double(double)> Product(
|
||||
std::vector<std::function<double(double)>> functions);
|
||||
|
||||
std::function<double(double)> Exponential(double prefactor, double scale);
|
||||
}; // namespace D1ToD1
|
||||
|
||||
namespace D3ToD1 {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef GRAVITY_FIELD_GENERATOR_H
|
||||
#define GRAVITY_FIELD_GENERATOR_H
|
||||
|
||||
#include "simulation/electromagnetic_field.h"
|
||||
#include "simulation/parameter.h"
|
||||
|
||||
namespace generator {
|
||||
std::shared_ptr<GravityField> gravityField(json_t* object);
|
||||
|
||||
std::shared_ptr<GravityField> gravityField(Parameter& parameter);
|
||||
|
||||
};
|
||||
|
||||
#endif /* GRAVITY_FIELD_GENERATOR_H */
|
||||
@@ -23,9 +23,21 @@ class ElectricField {
|
||||
|
||||
class MagneticField {
|
||||
public:
|
||||
MagneticField(std::shared_ptr<VectorField> field);
|
||||
MagneticField(std::shared_ptr<VectorField> field,
|
||||
std::shared_ptr<VectorField> gradient);
|
||||
|
||||
CylinderVector value(const Coordinate& position) const;
|
||||
CylinderVector gradientValue(const Coordinate& position) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<VectorField> field_;
|
||||
std::shared_ptr<VectorField> gradient_;
|
||||
};
|
||||
|
||||
class GravityField {
|
||||
public:
|
||||
GravityField(std::shared_ptr<VectorField> field);
|
||||
CylinderVector value(const Coordinate& position) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<VectorField> field_;
|
||||
|
||||
@@ -9,7 +9,8 @@ class Mover {
|
||||
virtual void move(particle::Particle* particle,
|
||||
double mfp_m,
|
||||
ElectricField* electric_field,
|
||||
MagneticField* magnetic_field) = 0;
|
||||
MagneticField* magnetic_field,
|
||||
GravityField* gravity_field) = 0;
|
||||
};
|
||||
|
||||
class BorisMover : public Mover {
|
||||
@@ -19,7 +20,8 @@ class BorisMover : public Mover {
|
||||
void move(particle::Particle* particle,
|
||||
double mfp_m,
|
||||
ElectricField* electric_field,
|
||||
MagneticField* magnetic_field);
|
||||
MagneticField* magnetic_field,
|
||||
GravityField* gravity_field);
|
||||
|
||||
private:
|
||||
const double maximal_time_step_s_;
|
||||
@@ -37,14 +39,15 @@ class DriftMover : public Mover {
|
||||
void move(particle::Particle* particle,
|
||||
double mfp_m,
|
||||
ElectricField* electric_field,
|
||||
MagneticField* magnetic_field);
|
||||
MagneticField* magnetic_field,
|
||||
GravityField* gravity_field);
|
||||
|
||||
private:
|
||||
const double maximal_distance_m_;
|
||||
|
||||
blitz::TinyVector<double, 3> driftVelocity(
|
||||
const blitz::TinyVector<double, 3>& magnetic_field,
|
||||
const blitz::TinyVector<double, 3>& electric_field) const;
|
||||
const blitz::TinyVector<double, 3>& force_field_over_charge,
|
||||
const blitz::TinyVector<double, 3>& magnetic_field) const;
|
||||
};
|
||||
|
||||
#endif /* MOVER_H */
|
||||
|
||||
@@ -12,6 +12,7 @@ class RandomNumbers;
|
||||
class InteractionOutput;
|
||||
class MagneticField;
|
||||
class ElectricField;
|
||||
class GravityField;
|
||||
class Timer;
|
||||
class Injector;
|
||||
class SimulationOutput;
|
||||
@@ -57,6 +58,7 @@ class Simulation {
|
||||
|
||||
std::shared_ptr<MagneticField> magnetic_field_;
|
||||
std::shared_ptr<ElectricField> electric_field_;
|
||||
std::shared_ptr<GravityField> gravity_field_;
|
||||
|
||||
std::shared_ptr<PoissonSolver> poisson_solver_;
|
||||
|
||||
|
||||
@@ -25,6 +25,16 @@
|
||||
"Isotropic": {}
|
||||
}
|
||||
},
|
||||
"elastic_example3": {
|
||||
"Type": "ElasticScattering",
|
||||
"Target": "T",
|
||||
"CrossSection": {
|
||||
"PredefinedFunction": "eT_elastic_scattering"
|
||||
},
|
||||
"ScatteringAngleDistribution": {
|
||||
"Isotropic": {}
|
||||
}
|
||||
},
|
||||
"ionization_example1": {
|
||||
"Type": "ElectronIonization",
|
||||
"IonizationModel": "JanevNonDiss",
|
||||
@@ -46,6 +56,13 @@
|
||||
"OutgoingElectron": "e-",
|
||||
"OutgoingIon": "T+"
|
||||
},
|
||||
"ionization_example4": {
|
||||
"Type": "ElectronIonization",
|
||||
"IonizationModel": "JanevAtomic",
|
||||
"Target": "T",
|
||||
"OutgoingElectron": "e-",
|
||||
"OutgoingIon": "T+"
|
||||
},
|
||||
"excitation_example0": {
|
||||
"Type": "Excitation",
|
||||
"Target": "T2",
|
||||
@@ -141,12 +158,53 @@
|
||||
"Target": "T2",
|
||||
"ExcitationState": "england_rotational_j1_to_j3"
|
||||
},
|
||||
"excitation_example19": {
|
||||
"Type": "Excitation",
|
||||
"Target": "T",
|
||||
"ExcitationState": "janev_atomic_n2"
|
||||
},
|
||||
"excitation_example20": {
|
||||
"Type": "Excitation",
|
||||
"Target": "T",
|
||||
"ExcitationState": "janev_atomic_n3"
|
||||
},
|
||||
"excitation_example21": {
|
||||
"Type": "Excitation",
|
||||
"Target": "T",
|
||||
"ExcitationState": "janev_atomic_n4"
|
||||
},
|
||||
"excitation_example22": {
|
||||
"Type": "Excitation",
|
||||
"Target": "T",
|
||||
"ExcitationState": "janev_atomic_n5"
|
||||
},
|
||||
"recombination_example1": {
|
||||
"Type": "Recombination",
|
||||
"Target": "T+",
|
||||
"CrossSection": {
|
||||
"PredefinedFunction": "eTp_recombination_kotelnikov"
|
||||
}
|
||||
},
|
||||
"recombination_example2": {
|
||||
"Type": "Recombination",
|
||||
"Target": "T2+",
|
||||
"CrossSection": {
|
||||
"PredefinedFunction": "eT2p_recombination_janev"
|
||||
}
|
||||
},
|
||||
"recombination_example3": {
|
||||
"Type": "Recombination",
|
||||
"Target": "T3+",
|
||||
"CrossSection": {
|
||||
"PredefinedFunction": "eT3p_recombination_janev"
|
||||
}
|
||||
},
|
||||
"free_movement_example": {
|
||||
"Type": "FreeMovement"
|
||||
}
|
||||
},
|
||||
"T+ standart interactions": {
|
||||
"elastic scattering": {
|
||||
"elastic scattering1": {
|
||||
"Type": "ElasticScattering",
|
||||
"Target": "T2",
|
||||
"CrossSection": {
|
||||
@@ -156,6 +214,23 @@
|
||||
"Isotropic": {}
|
||||
}
|
||||
},
|
||||
"elastic scattering2": {
|
||||
"Type": "ElasticScattering",
|
||||
"Target": "T",
|
||||
"CrossSection": {
|
||||
"PredefinedFunction": "TpT_elastic_scattering_schultz"
|
||||
},
|
||||
"ScatteringAngleDistribution": {
|
||||
"Isotropic": {}
|
||||
}
|
||||
},
|
||||
"charge exchange": {
|
||||
"Type": "ChargeExchange",
|
||||
"Target": "T",
|
||||
"CrossSection": {
|
||||
"PredefinedFunction": "TpT_charge_exchange_janev"
|
||||
}
|
||||
},
|
||||
"clustering1": {
|
||||
"Type": "Clustering",
|
||||
"Target": "T2",
|
||||
@@ -172,6 +247,21 @@
|
||||
"PredefinedFunction": "TpT2_clustering_tertiary_ascendion_pasil"
|
||||
}
|
||||
},
|
||||
"clustering3": {
|
||||
"Type": "Clustering",
|
||||
"Target": "T",
|
||||
"Product": "T2+",
|
||||
"CrossSection": {
|
||||
"PredefinedFunction": "TpT_clustering_tertiary_janev"
|
||||
}
|
||||
},
|
||||
"recombination": {
|
||||
"Type": "Recombination",
|
||||
"Target": "e-",
|
||||
"CrossSection": {
|
||||
"PredefinedFunction": "eTp_recombination_kotelnikov"
|
||||
}
|
||||
},
|
||||
"free_movement_example": {
|
||||
"Type": "FreeMovement"
|
||||
}
|
||||
@@ -192,6 +282,13 @@
|
||||
"PredefinedFunction": "T2pT2_clustering_janev"
|
||||
}
|
||||
},
|
||||
"recombination": {
|
||||
"Type": "Recombination",
|
||||
"Target": "e-",
|
||||
"CrossSection": {
|
||||
"PredefinedFunction": "eT2p_recombination_janev"
|
||||
}
|
||||
},
|
||||
"free_movement_example": {
|
||||
"Type": "FreeMovement"
|
||||
}
|
||||
@@ -207,6 +304,13 @@
|
||||
"Isotropic": {}
|
||||
}
|
||||
},
|
||||
"recombination": {
|
||||
"Type": "Recombination",
|
||||
"Target": "e-",
|
||||
"CrossSection": {
|
||||
"PredefinedFunction": "eT3p_recombination_janev"
|
||||
}
|
||||
},
|
||||
"free_movement_example": {
|
||||
"Type": "FreeMovement"
|
||||
}
|
||||
|
||||
@@ -570,15 +570,60 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"GravityField": {
|
||||
"VectorField": {
|
||||
"VectorFieldFunctionInZ": {
|
||||
"zFunction": {
|
||||
"Constant3D": {
|
||||
"constant": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"PoissonSolver": {
|
||||
"UseInSimulation": "false"
|
||||
"BoundaryGeometry": {
|
||||
"Cylinder": {
|
||||
"Radius": {
|
||||
"value": 4.5,
|
||||
"unit": "cm"
|
||||
},
|
||||
"Height": {
|
||||
"value": 1600,
|
||||
"unit": "cm"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PositionBinning": {
|
||||
"CreateSameAs": [
|
||||
"GlobalPositionBinning"
|
||||
]
|
||||
},
|
||||
"Boundary": {
|
||||
"Top": {
|
||||
"type": "neumann",
|
||||
"value": 0
|
||||
},
|
||||
"Bottom": {
|
||||
"type": "dirichlet",
|
||||
"value": 0
|
||||
},
|
||||
"Hull": {
|
||||
"type": "dirichlet",
|
||||
"value": 0
|
||||
}
|
||||
},
|
||||
"TargetAccuracy": 1e-7,
|
||||
"NumCycles": 2e4,
|
||||
"Intervall": 1,
|
||||
"Offset": 9
|
||||
},
|
||||
"Simulation": {
|
||||
"SimulatedEvents": 1,
|
||||
"EventStride": 1
|
||||
},
|
||||
"Output": {
|
||||
"folder": "output",
|
||||
"folder": "output_",
|
||||
"filename": "test",
|
||||
"DensityFields": {
|
||||
"Species": "all",
|
||||
@@ -599,9 +644,13 @@
|
||||
],
|
||||
"Intervall": "EachSync",
|
||||
"OverwriteLast": "true"
|
||||
},
|
||||
"PoissonSolver": {
|
||||
"Intervall": "EachSync",
|
||||
"OverwriteLast": "true"
|
||||
}
|
||||
},
|
||||
"RandomNumbers": {
|
||||
"Seed": 1337
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,10 @@ std::function<double(double)> Product(
|
||||
return product;
|
||||
};
|
||||
}
|
||||
|
||||
std::function<double(double)> Exponential(double prefactor, double scale) {
|
||||
return [=](double x) { return prefactor * std::exp(scale * x); };
|
||||
}
|
||||
}; // namespace D1ToD1
|
||||
|
||||
namespace D3ToD1 {
|
||||
|
||||
@@ -71,6 +71,13 @@ std::function<double(double)> function1D(json_t* object) {
|
||||
}
|
||||
return D1ToD1::Product(functions);
|
||||
|
||||
} else if (json_object_by_path(object, {"Exponential"})) {
|
||||
DEBUG_LEVEL_2("Creating function1d: Exponential.");
|
||||
double prefactor = json_double(json_object_by_path(
|
||||
object, {"Exponential", {"prefactor"}}));
|
||||
double scale = json_double(json_object_by_path(
|
||||
object, {"Exponential", {"scale"}}));
|
||||
return D1ToD1::Exponential(prefactor, scale);
|
||||
} else {
|
||||
ERROR("This 1d to 1d function is not implemented.");
|
||||
return nullptr;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "generators/gravity_field_generator.h"
|
||||
|
||||
#include "generators/vector_field_generator.h"
|
||||
|
||||
namespace generator {
|
||||
|
||||
std::shared_ptr<GravityField> gravityField(json_t* object) {
|
||||
DEBUG_LEVEL_2("Generating gravity field.");
|
||||
return std::shared_ptr<GravityField>(new GravityField(
|
||||
buildVectorField(json_object_by_path(object, {"VectorField"}))));
|
||||
}
|
||||
|
||||
std::shared_ptr<GravityField> gravityField(Parameter& parameter) {
|
||||
return gravityField(
|
||||
json_object_by_path(parameter.jsonFile(), {"GravityField"}));
|
||||
}
|
||||
|
||||
};
|
||||
@@ -7,7 +7,8 @@ namespace generator {
|
||||
std::shared_ptr<MagneticField> magneticField(json_t* object) {
|
||||
DEBUG_LEVEL_2("Generating magnetic field.");
|
||||
return std::shared_ptr<MagneticField>(new MagneticField(
|
||||
buildVectorField(json_object_by_path(object, {"VectorField"}))));
|
||||
buildVectorField(json_object_by_path(object, {"VectorField"})),
|
||||
buildVectorField(json_object_by_path(object, {"GradientField"}))));
|
||||
}
|
||||
|
||||
std::shared_ptr<MagneticField> magneticField(Parameter& parameter) {
|
||||
|
||||
@@ -33,7 +33,7 @@ double buildMass(json_t* object) {
|
||||
} else if (json_object_by_path(object, {"value"})) {
|
||||
return json_double(json_object_by_path(object, {"value"}));
|
||||
} else {
|
||||
ERROR("The mass is not given correcty.");
|
||||
ERROR("The mass is not given correctly.");
|
||||
return 0.;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ std::shared_ptr<SimulationOutput> buildSimulationOutput(
|
||||
intervall = 1;
|
||||
}
|
||||
ASSERT_POSITIVE(&intervall,
|
||||
"The intervall for the poisson solver output must be positive");
|
||||
"The output intervall for the poisson solver output must be positive.");
|
||||
|
||||
bool overwrite_last = json_bool(
|
||||
json_object_by_path(object, {"PoissonSolver", "OverwriteLast"}));
|
||||
|
||||
@@ -16,9 +16,25 @@ void ElectricField::updateDynamicField(std::shared_ptr<VectorField> field) {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
MagneticField::MagneticField(std::shared_ptr<VectorField> field)
|
||||
: field_(field) {}
|
||||
MagneticField::MagneticField(std::shared_ptr<VectorField> field,
|
||||
std::shared_ptr<VectorField> gradient)
|
||||
: field_(field), gradient_(gradient) {}
|
||||
|
||||
CylinderVector MagneticField::value(const Coordinate& position) const {
|
||||
return field_->value(position);
|
||||
}
|
||||
}
|
||||
|
||||
CylinderVector MagneticField::gradientValue(const Coordinate& position) const {
|
||||
return gradient_->value(position);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
GravityField::GravityField(std::shared_ptr<VectorField> field):
|
||||
field_(field) {}
|
||||
|
||||
CylinderVector GravityField::value(const Coordinate& position) const {
|
||||
return field_->value(position);
|
||||
}
|
||||
|
||||
+44
-19
@@ -22,25 +22,29 @@ BorisMover::BorisMover(double maximal_time_step_s)
|
||||
void BorisMover::move(particle::Particle* particle,
|
||||
double mfp_m,
|
||||
ElectricField* electric_field,
|
||||
MagneticField* magnetic_field) {
|
||||
MagneticField* magnetic_field,
|
||||
GravityField* gravity_field) {
|
||||
double leftover_distance = mfp_m;
|
||||
|
||||
auto old_position = particle->position();
|
||||
double old_kinetic_energy = particle->kineticEnergy_eV();
|
||||
|
||||
if (old_kinetic_energy < 1E-9) {
|
||||
// Guard against small enegies taking up much time without contributing to
|
||||
// density
|
||||
return;
|
||||
}
|
||||
// if (old_kinetic_energy < 1E-9) {
|
||||
// DEBUG_LEVEL_2("Particle has too low an energy.");
|
||||
// // Guard against small enegies taking up much time without contributing to
|
||||
// // density
|
||||
// //return;
|
||||
// }
|
||||
|
||||
bool changed_position_bin = false;
|
||||
bool changed_energy_bin = false;
|
||||
bool left_simulation_domain = false;
|
||||
bool died_in_bin = false;
|
||||
|
||||
while (
|
||||
!(changed_position_bin || changed_energy_bin || left_simulation_domain) &&
|
||||
(leftover_distance > 0.)) {
|
||||
!(changed_position_bin || changed_energy_bin
|
||||
|| left_simulation_domain || died_in_bin) &&
|
||||
(leftover_distance > 0.)) {
|
||||
old_position = particle->position();
|
||||
old_kinetic_energy = particle->kineticEnergy_eV();
|
||||
|
||||
@@ -50,8 +54,13 @@ void BorisMover::move(particle::Particle* particle,
|
||||
electric_field->value(old_position).cartesianEntries(old_position);
|
||||
const blitz::TinyVector<double, 3> B =
|
||||
magnetic_field->value(old_position).cartesianEntries(old_position);
|
||||
const blitz::TinyVector<double, 3> g =
|
||||
gravity_field->value(old_position).cartesianEntries(old_position);
|
||||
|
||||
const blitz::TinyVector<double, 3> force_over_q =
|
||||
E + particle->mass_kg()/particle->charge_C()*g;
|
||||
|
||||
movementStep(particle, E, B, moved_distance);
|
||||
movementStep(particle, force_over_q, B, moved_distance);
|
||||
particle->increaseTimeAlive(maximal_time_step_s_);
|
||||
particle->increaseTimeInBin(maximal_time_step_s_);
|
||||
|
||||
@@ -68,6 +77,9 @@ void BorisMover::move(particle::Particle* particle,
|
||||
left_simulation_domain =
|
||||
particle->specie()->terminator()->leftSimulationDomain(particle);
|
||||
|
||||
died_in_bin =
|
||||
particle->specie()->terminator()->reachedMaxTimeAlive(particle);
|
||||
|
||||
leftover_distance -= moved_distance;
|
||||
}
|
||||
|
||||
@@ -172,7 +184,8 @@ DriftMover::DriftMover(double maximal_distance)
|
||||
void DriftMover::move(particle::Particle* particle,
|
||||
double mfp_m,
|
||||
ElectricField* electric_field,
|
||||
MagneticField* magnetic_field) {
|
||||
MagneticField* magnetic_field,
|
||||
GravityField* gravity_field) {
|
||||
double leftover_distance = mfp_m;
|
||||
|
||||
auto old_position = particle->position();
|
||||
@@ -195,9 +208,13 @@ void DriftMover::move(particle::Particle* particle,
|
||||
|
||||
old_kinetic_energy = particle->kineticEnergy_eV();
|
||||
|
||||
const blitz::TinyVector<double, 3> E =
|
||||
blitz::TinyVector<double, 3> force_over_charge =
|
||||
electric_field->value(old_position).cartesianEntries(old_position);
|
||||
|
||||
// gravity force / q
|
||||
force_over_charge += gravity_field->value(old_position).cartesianEntries(old_position)
|
||||
* particle->mass_kg() / particle->charge_C();
|
||||
|
||||
const blitz::TinyVector<double, 3> B =
|
||||
magnetic_field->value(old_position).cartesianEntries(old_position);
|
||||
const double B_norm = kinematic::norm(B);
|
||||
@@ -212,12 +229,20 @@ void DriftMover::move(particle::Particle* particle,
|
||||
kinematic::perpendicularVector(old_velocity.cartesianEntries(), B);
|
||||
const double v_perp_norm = kinematic::norm(v_perp);
|
||||
|
||||
const blitz::TinyVector<double, 3> v_drift = driftVelocity(B, E);
|
||||
// centrifugal and magnetic moment force / q
|
||||
// not sure if correct. It might be that the centrifugal force includes only the
|
||||
// perpendicular part of grad(B)
|
||||
force_over_charge += -(particle->mass_kg()/particle->charge_C() *
|
||||
(v_parallel_norm*v_parallel_norm + v_perp_norm*v_perp_norm/2) *
|
||||
magnetic_field->gradientValue(old_position).cartesianEntries(old_position) /
|
||||
B_norm);
|
||||
|
||||
const blitz::TinyVector<double, 3> v_drift = driftVelocity(force_over_charge, B);
|
||||
const double v_drift_norm = kinematic::norm(v_drift);
|
||||
|
||||
const double stepsize = std::min(leftover_distance, maximal_distance_m_);
|
||||
// guard against very large timesteps i.e. v ~ 0 -> timestep = Inf
|
||||
// should be a very rare case (but has happend)
|
||||
// should be a very rare case
|
||||
const double timestep = std::min(
|
||||
stepsize / (v_parallel_norm + v_perp_norm + v_drift_norm),
|
||||
max_time_alive);
|
||||
@@ -226,10 +251,10 @@ void DriftMover::move(particle::Particle* particle,
|
||||
v_parallel * timestep;
|
||||
const blitz::TinyVector<double, 3> movement_drift = v_drift * timestep;
|
||||
|
||||
const blitz::TinyVector<double, 3> E_parallel =
|
||||
kinematic::parallelVector(E, B);
|
||||
const blitz::TinyVector<double, 3> force_over_charge_parallel =
|
||||
kinematic::parallelVector(force_over_charge, B);
|
||||
const blitz::TinyVector<double, 3> dv_electric =
|
||||
timestep * particle->charge_C() * E_parallel / particle->mass_kg();
|
||||
timestep * particle->charge_C() * force_over_charge_parallel / particle->mass_kg();
|
||||
|
||||
if (v_perp_norm > SimConstants::compare_epsilon) {
|
||||
const double gyro_radius = particle->mass_kg() * v_perp_norm /
|
||||
@@ -291,8 +316,8 @@ void DriftMover::move(particle::Particle* particle,
|
||||
}
|
||||
|
||||
blitz::TinyVector<double, 3> DriftMover::driftVelocity(
|
||||
const blitz::TinyVector<double, 3>& magnetic_field,
|
||||
const blitz::TinyVector<double, 3>& electric_field) const {
|
||||
return blitz::cross(magnetic_field, electric_field) /
|
||||
const blitz::TinyVector<double, 3>& force_field_over_charge,
|
||||
const blitz::TinyVector<double, 3>& magnetic_field) const {
|
||||
return blitz::cross(force_field_over_charge, magnetic_field) /
|
||||
blitz::dot(magnetic_field, magnetic_field);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "generators/simulation_output_generator.h"
|
||||
#include "generators/species_generator.h"
|
||||
#include "generators/poisson_solver_generator.h"
|
||||
#include "generators/gravity_field_generator.h"
|
||||
|
||||
#include "tools/simulation_time.h"
|
||||
|
||||
@@ -39,6 +40,7 @@ Simulation::Simulation(std::string parameter_filename)
|
||||
void Simulation::init(Parameter& parameter) {
|
||||
magnetic_field_ = generator::magneticField(parameter);
|
||||
electric_field_ = generator::electricField(parameter);
|
||||
gravity_field_ = generator::gravityField(parameter);
|
||||
|
||||
DEBUG_LEVEL_0("Creating species.");
|
||||
generator::SpeciesBuilder builder(parameter);
|
||||
@@ -194,7 +196,7 @@ void Simulation::processUntilTermination(
|
||||
|
||||
SimulationTimer::eventStartPoint(std::string("Mover"));
|
||||
particle.specie()->mover()->move(&particle, mfp_m, electric_field_.get(),
|
||||
magnetic_field_.get());
|
||||
magnetic_field_.get(), gravity_field_.get());
|
||||
SimulationTimer::eventStopPoint(std::string("Mover"));
|
||||
|
||||
bool was_reflected = false;
|
||||
|
||||
Reference in New Issue
Block a user