Version 2, position dependent E/B, kinetic ions, boris mover, terminator

This commit is contained in:
Jonas Kellerer
2022-10-21 10:09:19 +02:00
parent acc55cf003
commit 83fd2e5d7e
869 changed files with 1033204 additions and 3634436 deletions
+27
View File
@@ -0,0 +1,27 @@
#include "generators/mover_generator.h"
#include "simulation/errors.h"
namespace generator {
std::shared_ptr<Mover> buildMover(Parameter& parameter,
const json_path& path_to_mover) {
if (parameter.jsonObjectFromBase(
json_path_append(path_to_mover, {"Boris"}))) {
DEBUG_LEVEL_2("Creating mover: Boris.");
double max_timestep_length = parameter.doubleValue(json_path_append(
path_to_mover, {"Boris", "MaximalTimestepLength", "value"}));
return std::shared_ptr<Mover>(new BorisMover(max_timestep_length));
} else if (parameter.jsonObjectFromBase(
json_path_append(path_to_mover, {"Drift"}))) {
DEBUG_LEVEL_2("Creating mover: Drift.");
double maximal_moved_distance =
json_read_length(parameter.jsonObjectFromBase(json_path_append(
path_to_mover, {"Drift", "MaximalMovedDistance"})));
return std::make_shared<DriftMover>(maximal_moved_distance);
} else {
ERROR("This mover is not implemented");
return nullptr;
}
}
}; // namespace generator