Version 2, position dependent E/B, kinetic ions, boris mover, terminator
This commit is contained in:
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#include "generators/mass_generator.h"
|
||||
|
||||
#include "constants/physical_constants.h"
|
||||
#include "generators/species_generator.h"
|
||||
#include "simulation/errors.h"
|
||||
#include "simulation/jansson_additionals.h"
|
||||
#include "simulation/species.h"
|
||||
|
||||
namespace generator {
|
||||
|
||||
std::map<species::ImplementedSpecies, double> SpeciesMasses::mass_ = {
|
||||
{species::ImplementedSpecies::electron, SI::me},
|
||||
{species::ImplementedSpecies::T2, 6 * SI::mp + 2 * SI::me},
|
||||
{species::ImplementedSpecies::Tplus, 3 * SI::mp},
|
||||
{species::ImplementedSpecies::T2plus, 6 * SI::mp + SI::me},
|
||||
{species::ImplementedSpecies::T3plus, 9 * SI::mp + 2 * SI::me}};
|
||||
|
||||
double SpeciesMasses::mass(const species::ImplementedSpecies& species) {
|
||||
return mass_.at(species);
|
||||
}
|
||||
|
||||
double buildMass(json_t* object) {
|
||||
if (json_object_by_path(object, {"FromParticleType"})) {
|
||||
std::string name =
|
||||
json_string(json_object_by_path(object, {"FromParticleType"}));
|
||||
if (SpeciesAlias::isAlias(name)) {
|
||||
return SpeciesMasses::mass(SpeciesAlias::alias(name));
|
||||
} else {
|
||||
ERROR("This specie type is not known.");
|
||||
return 0.;
|
||||
}
|
||||
} 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.");
|
||||
return 0.;
|
||||
}
|
||||
}
|
||||
|
||||
}; // namespace generator
|
||||
Reference in New Issue
Block a user