From 85d6218a3a8838521c495c12bf00942085bc3c8c Mon Sep 17 00:00:00 2001 From: Andrew Myers Date: Tue, 28 Mar 2017 11:11:12 -0700 Subject: updating the python-ctypes branch for recent changes in master --- Source/PlasmaInjector.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'Source/PlasmaInjector.cpp') 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) { -- cgit v1.2.3