aboutsummaryrefslogtreecommitdiff
path: root/Source/PlasmaInjector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/PlasmaInjector.cpp')
-rw-r--r--Source/PlasmaInjector.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/Source/PlasmaInjector.cpp b/Source/PlasmaInjector.cpp
index 027bb5b57..82837730c 100644
--- a/Source/PlasmaInjector.cpp
+++ b/Source/PlasmaInjector.cpp
@@ -127,6 +127,21 @@ PlasmaInjector::PlasmaInjector(int ispecies, const std::string& name)
pp.query("ymax", ymax);
pp.query("zmax", zmax);
+ // get injection style
+ pp.get("injection_style", injection_style);
+ std::transform(injection_style.begin(),
+ injection_style.end(),
+ injection_style.begin(),
+ ::tolower);
+ if (injection_style == "python") {
+ return;
+ }
+ else if (not (injection_style == "nrandomnormal" or
+ injection_style == "nrandomuniformpercell" or
+ injection_style == "ndiagpercell")) {
+ StringParseAbortMessage("Injection style", injection_style);
+ }
+
// parse density information
std::string rho_prof_s;
pp.get("profile", rho_prof_s);
@@ -173,20 +188,6 @@ PlasmaInjector::PlasmaInjector(int ispecies, const std::string& name)
} else {
StringParseAbortMessage("Momentum distribution type", mom_dist_s);
}
-
- // get injection style
- pp.get("injection_style", injection_style);
- std::transform(injection_style.begin(),
- injection_style.end(),
- injection_style.begin(),
- ::tolower);
- if (injection_style == "nrandomnormal" or
- injection_style == "nrandomuniformpercell" or
- injection_style == "ndiagpercell") {
- return;
- } else {
- StringParseAbortMessage("Injection style", injection_style);
- }
}
void PlasmaInjector::getMomentum(vec3& u) {