Version 2, position dependent E/B, kinetic ions, boris mover, terminator
This commit is contained in:
Executable
+27
@@ -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
|
||||
Reference in New Issue
Block a user