33std::string
P::mode = std::string(
"distribution");
48Distribution* (*P::distribution)(std::default_random_engine&) = NULL;
79 Readparameters::add(
"particles.input_filename_pattern",
"Printf() like pattern giving the field input filenames.",
80 std::string(
"bulk.%07i.vlsv"));
81 Readparameters::add(
"particles.output_filename_pattern",
"Printf() like pattern giving the particle output filenames.",
82 std::string(
"particles.%07i.vlsv"));
83 Readparameters::add(
"particles.mode",
"Mode to run the particle pusher in.",std::string(
"distribution"));
85 Readparameters::add(
"particles.init_x",
"Particle starting point, x-coordinate (meters).", 0);
86 Readparameters::add(
"particles.init_y",
"Particle starting point, y-coordinate (meters).", 0);
87 Readparameters::add(
"particles.init_z",
"Particle starting point, z-coordinate (meters).", 0);
91 Readparameters::add(
"particles.start_time",
"Simulation time (seconds) for particle start.",0);
92 Readparameters::add(
"particles.end_time",
"Simulation time (seconds) at which particle simulation stops.",0);
94 Readparameters::add(
"particles.V_field_name",
"Name of the Velocity data set in the input files",
"V");
95 Readparameters::add(
"particles.rho_field_name",
"Name of the Density data set in the input files",
"rho");
96 Readparameters::add(
"particles.divide_rhov_by_rho",
"Do the input file store rho_v and rho separately?",
false);
98 Readparameters::add(
"particles.distribution",
"Type of distribution function to sample particles from.",
99 std::string(
"maxwell"));
100 Readparameters::add(
"particles.temperature",
"Temperature of the particle distribution",1e6);
101 Readparameters::add(
"particles.particle_vel",
"Initial velocity of the particles (in the plasma rest frame)",0);
106 "What to do with particles that reach the x boundaries (DELETE/REFLECT/PERIODIC)",std::string(
"DELETE"));
108 "What to do with particles that reach the y boundaries (DELETE/REFLECT/PERIODIC)",std::string(
"PERIODIC"));
110 "What to do with particles that reach the z boundaries (DELETE/REFLECT/PERIODIC)",std::string(
"PERIODIC"));
113 Readparameters::add(
"particles.inner_boundary",
"Distance of the inner boundary from the coordinate centre (meters)",
115 Readparameters::add(
"particles.precipitation_start_x",
"X-Coordinate at which precipitation injection starts (meters)",
117 Readparameters::add(
"particles.precipitation_stop_x",
"X-Coordinate at which precipitation injection stops (meters)",
122 "Y-Coordinate of the bottom end of the parabola, at which shock reflection scenario particles are injected", 60e6);
124 "Y-Coordinate of the bottom end of the parabola, at which shock reflection scenario particles are injected", 60e6);
126 "Curvature scale of the injection parabola for the reflection scenario", 60e6);
128 "X-Coordinate of the tip of the injection parabola for the reflection scenario", 40e6);
130 "Distance from particle injection point at which particles are to be counted as 'reflected'", 10e6);
132 "Distance from particle injection point at which particles are to be counted as 'transmitted'", 10e6);
136 "X-Coordinate of the lower edge of particle injection region for the ipShock scenario", -1.e6);
138 "X-Coordinate of the upper edge of particle injection region for the ipShock scenario", 1.e6);
140 "Y-Coordinate of the lower edge of particle injection region for the ipShock scenario", -1.e6);
142 "Y-Coordinate of the upper edge of particle injection region for the ipShock scenario", 1.e6);
144 "Z-Coordinate of the lower edge of particle injection region for the ipShock scenario", -1.e6);
146 "Z-Coordinate of the upper edge of particle injection region for the ipShock scenario", 1.e6);
148 "X-Coordinate of threshold for where particles are counted as transmitted for the ipShock scenario", -10.e6);
150 "X-Coordinate of threshold for where particles are counted as reflected for the ipShock scenario", 10.e6);
170 if(
P::dt == 0 || P::end_time == P::start_time) {
171 std::cerr <<
"Error end_time == start_time! Won't do anything (and will probably crash now)." << std::endl;
181 std::string distribution_name;
184 std::map<std::string,
Distribution*(*)(std::default_random_engine&)> distribution_lookup;
190 if(distribution_lookup.find(distribution_name) == distribution_lookup.end()) {
191 std::cerr <<
"Error: particles.distribution value \"" << distribution_name
192 <<
"\" does not specify a valid distribution!" << std::endl;
195 P::distribution = distribution_lookup[distribution_name];
202 std::map<std::string,
Boundary*(*)(
int)> boundaryLookup;
206 std::string tempstring;
208 if(boundaryLookup.find(tempstring) == boundaryLookup.end()) {
209 std::cerr <<
"Error: invalid boundary condition \"" << tempstring <<
"\" in x-direction" << std::endl;
212 P::boundary_behaviour_x = boundaryLookup[tempstring](0);
215 if(boundaryLookup.find(tempstring) == boundaryLookup.end()) {
216 std::cerr <<
"Error: invalid boundary condition \"" << tempstring <<
"\" in y-direction" << std::endl;
219 P::boundary_behaviour_y = boundaryLookup[tempstring](1);
222 if(boundaryLookup.find(tempstring) == boundaryLookup.end()) {
223 std::cerr <<
"Error: invalid boundary condition \"" << tempstring <<
"\" in z-direction" << std::endl;
226 P::boundary_behaviour_z = boundaryLookup[tempstring](2);
238 Readparameters::get(
"particles.reflect_downstream_boundary", P::reflect_downstream_boundary);
Boundary * createBoundary(int dimension)
static void get(const std::string &name, std::string &value)
static void add(const std::string &name, const std::string &desc, const std::string &defValue)
Distribution * createDistribution(std::default_random_engine &rand)
static Real ipshock_transmit
static std::default_random_engine::result_type random_seed
static Boundary * boundary_behaviour_x
static std::string rho_field_name
static Real ipshock_reflect
static Real reflect_downstream_boundary
static Real precip_stop_x
static bool addParameters()
static Real reflect_y_scale
static Real precip_inner_boundary
static Real ipshock_inject_y1
static Boundary * boundary_behaviour_z
static std::string input_filename_pattern
static Real precip_start_x
static Real reflect_start_y
static Real ipshock_inject_z1
static Boundary * boundary_behaviour_y
static std::string output_filename_pattern
static Real reflect_x_offset
static bool divide_rhov_by_rho
static uint64_t num_particles
static bool getParameters()
static Real ipshock_inject_z0
static Real ipshock_inject_x1
static Real ipshock_inject_x0
static Real reflect_upstream_boundary
static Real ipshock_inject_y0
static std::string V_field_name
static Real reflect_stop_y