From 57d69ac5a87b57da0e5128c3990491abf311d13b Mon Sep 17 00:00:00 2001 From: RevathiJambunathan Date: Thu, 9 Jan 2020 17:27:15 -0800 Subject: adding variables to read in EP parser for particles --- Docs/source/running_cpp/parameters.rst | 51 +++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 4 deletions(-) (limited to 'Docs/source/running_cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index c5d1600d3..b0387c4c1 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -446,10 +446,6 @@ Particle initialization this process (see "Lookup tables for QED modules" section below). **Implementation of this feature is in progress. It requires to compile with QED=TRUE** -* ``warpx.E_external_particle`` & ``warpx.B_external_particle`` (list of `float`) optional (default `0. 0. 0.`) - Two separate parameters which add a uniform E-field or B-field to each particle - which is then added to the field values gathered from the grid in the - PIC cycle. Laser initialization -------------------- @@ -692,6 +688,53 @@ Laser initialization the field solver. In particular, do not use any other boundary condition than periodic. +* ``warpx.B_ext_particle_init_style`` (string) optional (default is "default") + This parameter determines the type of initialization for the external + magnetic field that is applied directly to the particles at every timestep. + The "default" style sets the external B-field (Bx,By,Bz) to (0.0,0.0,0.0). + The string can be set to "constant" if a constant external B-field is applied + every timestep. If this parameter is set to "constant", then an additional + parameter, namely, ``warpx.B_external_particle`` must be specified in + the input file. + To parse a mathematical function for the external B-field, use the option + ``parse_B_ext_particle_function``. This option requires additional parameters + in the input file, namely, + ``warpx.Bx_external_particle_function(x,y,z)``, + ``warpx.By_external_particle_function(x,y,z)``, + ``warpx.Bz_external_particle_function(x,y,z)`` to apply the external B-field + on the particles. Constants required in the mathematical expression can be set + using ``my_constants``. For a two-dimensional simulation, it is assumed that + the first and second dimensions are `x` and `z`, respectively, and the + value of the `By` component is set to zero. + Note that the current implementation of the parser for B-field on particles + does not work with RZ and the code will abort with an error message. + +* ``warpx.E_ext_particle_init_style`` (string) optional (default is "default") + This parameter determines the type of initialization for the external + electric field that is applied directly to the particles at every timestep. + The "default" style set the external E-field (Ex,Ey,Ez) to (0.0,0.0,0.0). + The string can be set to "constant" if a cosntant external E-field is to be + used in the simulation at every timestep. If this parameter is set to "constant", + then an additional parameter, namely, ``warpx.E_external_particle`` must be + specified in the input file. + To parse a mathematical function for the external E-field, use the option + ``parse_E_ext_particle_function``. This option requires additional + parameters in the input file, namely, + ``warpx.Ex_external_particle_function(x,y,z)``, + ``warpx.Ey_external_particle_function(x,y,z)``, + ``warpx.Ez_external_particle_function(x,y,z)`` to apply the external E-field + on the particles. Constants required in the mathematical expression can be set + using ``my_constants``. For a two-dimensional simulation, similar to the B-field, + it is assumed that the first and second dimensions are `x` and `z`, respectively, + and the value of the `Ey` component is set to zero. + The current implementation of the parser for the E-field on particles does not work + with RZ and the code will abort with an error message. + +* ``warpx.E_external_particle`` & ``warpx.B_external_particle`` (list of `float`) optional (default `0. 0. 0.`) + Two separate parameters which add an externally applied uniform E-field or + B-field to each particle which is then added to the field values gathered + from the grid in the PIC cycle. + Collision initialization ------------------------ -- cgit v1.2.3 From cff3694f78d67ec174718a851796d604917f2895 Mon Sep 17 00:00:00 2001 From: RevathiJambunathan Date: Thu, 9 Jan 2020 17:38:01 -0800 Subject: removing EOL whitespace --- Docs/source/running_cpp/parameters.rst | 2 +- Source/WarpX.H | 12 ++++++------ Source/WarpX.cpp | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'Docs/source/running_cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index b0387c4c1..44217c017 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -698,7 +698,7 @@ Laser initialization the input file. To parse a mathematical function for the external B-field, use the option ``parse_B_ext_particle_function``. This option requires additional parameters - in the input file, namely, + in the input file, namely, ``warpx.Bx_external_particle_function(x,y,z)``, ``warpx.By_external_particle_function(x,y,z)``, ``warpx.Bz_external_particle_function(x,y,z)`` to apply the external B-field diff --git a/Source/WarpX.H b/Source/WarpX.H index 7b47ef765..26850e953 100644 --- a/Source/WarpX.H +++ b/Source/WarpX.H @@ -116,13 +116,13 @@ public: // EV parser for particles -- to delete comment // Parser for B_external on the particle - static std::string str_Bx_ext_particle_function; - static std::string str_By_ext_particle_function; - static std::string str_Bz_ext_particle_function; + static std::string str_Bx_ext_particle_function; + static std::string str_By_ext_particle_function; + static std::string str_Bz_ext_particle_function; // Parser for E_external on the particle - static std::string str_Ex_ext_particle_function; - static std::string str_Ey_ext_particle_function; - static std::string str_Ez_ext_particle_function; + static std::string str_Ex_ext_particle_function; + static std::string str_Ey_ext_particle_function; + static std::string str_Ez_ext_particle_function; // -- to delete comment // ParserWrapper for B_external on the particle diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index fd18a4fd9..9be46154c 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -350,14 +350,14 @@ WarpX::ReadParameters () // then the values for the external B on particles must // be provided in the input file. if (B_ext_particle_s == "constant") - pp.getarr("B_external_particle", B_external_particle); - + pp.getarr("B_external_particle", B_external_particle); + // if the input string for E_external on particles is "constant" // then the values for the external E on particles must // be provided in the input file. if (E_ext_particle_s == "constant") - pp.getarr("E_external_particle", E_external_particle); - + pp.getarr("E_external_particle", E_external_particle); + if (B_ext_particle_s == "parse_b_ext_particle_function") { // store the mathematical expression as string Store_parserString(pp, "Bx_external_particle_function(x,y,z)", @@ -383,14 +383,14 @@ WarpX::ReadParameters () str_Ey_ext_particle_function); Store_parserString(pp, "Ez_external_particle_function(x,y,z)", str_Ez_ext_particle_function); - + Ex_particle_parser.reset(new ParserWrapper( makeParser(str_Ex_ext_particle_function))); Ey_particle_parser.reset(new ParserWrapper( makeParser(str_Ey_ext_particle_function))); Ez_particle_parser.reset(new ParserWrapper( makeParser(str_Ez_ext_particle_function))); - } + } pp.query("do_moving_window", do_moving_window); if (do_moving_window) -- cgit v1.2.3 From 5f2c8f2c6940f46ee630248cf2737ba8036f169d Mon Sep 17 00:00:00 2001 From: RevathiJambunathan Date: Tue, 14 Jan 2020 11:40:13 -0800 Subject: changing docs to add time in EB parser for particles --- Docs/source/running_cpp/parameters.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Docs/source/running_cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 4fd60b8af..8bc3756e6 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -731,9 +731,9 @@ Laser initialization To parse a mathematical function for the external B-field, use the option ``parse_B_ext_particle_function``. This option requires additional parameters in the input file, namely, - ``warpx.Bx_external_particle_function(x,y,z)``, - ``warpx.By_external_particle_function(x,y,z)``, - ``warpx.Bz_external_particle_function(x,y,z)`` to apply the external B-field + ``warpx.Bx_external_particle_function(x,y,z,t)``, + ``warpx.By_external_particle_function(x,y,z,t)``, + ``warpx.Bz_external_particle_function(x,y,z,t)`` to apply the external B-field on the particles. Constants required in the mathematical expression can be set using ``my_constants``. For a two-dimensional simulation, it is assumed that the first and second dimensions are `x` and `z`, respectively, and the @@ -752,9 +752,9 @@ Laser initialization To parse a mathematical function for the external E-field, use the option ``parse_E_ext_particle_function``. This option requires additional parameters in the input file, namely, - ``warpx.Ex_external_particle_function(x,y,z)``, - ``warpx.Ey_external_particle_function(x,y,z)``, - ``warpx.Ez_external_particle_function(x,y,z)`` to apply the external E-field + ``warpx.Ex_external_particle_function(x,y,z,t)``, + ``warpx.Ey_external_particle_function(x,y,z,t)``, + ``warpx.Ez_external_particle_function(x,y,z,t)`` to apply the external E-field on the particles. Constants required in the mathematical expression can be set using ``my_constants``. For a two-dimensional simulation, similar to the B-field, it is assumed that the first and second dimensions are `x` and `z`, respectively, -- cgit v1.2.3 From c5d8298284709dbea9f2c764bf429872933de11c Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Thu, 23 Jan 2020 14:41:53 -0800 Subject: External particle fields: correct documentation --- Docs/source/running_cpp/parameters.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Docs/source/running_cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 5925d4d6b..0ee7740fa 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -724,20 +724,20 @@ Laser initialization the field solver. In particular, do not use any other boundary condition than periodic. -* ``warpx.B_ext_particle_init_style`` (string) optional (default is "default") +* ``particles.B_ext_particle_init_style`` (string) optional (default is "default") This parameter determines the type of initialization for the external magnetic field that is applied directly to the particles at every timestep. The "default" style sets the external B-field (Bx,By,Bz) to (0.0,0.0,0.0). The string can be set to "constant" if a constant external B-field is applied every timestep. If this parameter is set to "constant", then an additional - parameter, namely, ``warpx.B_external_particle`` must be specified in + parameter, namely, ``particles.B_external_particle`` must be specified in the input file. To parse a mathematical function for the external B-field, use the option ``parse_B_ext_particle_function``. This option requires additional parameters in the input file, namely, - ``warpx.Bx_external_particle_function(x,y,z,t)``, - ``warpx.By_external_particle_function(x,y,z,t)``, - ``warpx.Bz_external_particle_function(x,y,z,t)`` to apply the external B-field + ``particles.Bx_external_particle_function(x,y,z,t)``, + ``particles.By_external_particle_function(x,y,z,t)``, + ``particles.Bz_external_particle_function(x,y,z,t)`` to apply the external B-field on the particles. Constants required in the mathematical expression can be set using ``my_constants``. For a two-dimensional simulation, it is assumed that the first and second dimensions are `x` and `z`, respectively, and the @@ -745,20 +745,20 @@ Laser initialization Note that the current implementation of the parser for B-field on particles does not work with RZ and the code will abort with an error message. -* ``warpx.E_ext_particle_init_style`` (string) optional (default is "default") +* ``particles.E_ext_particle_init_style`` (string) optional (default is "default") This parameter determines the type of initialization for the external electric field that is applied directly to the particles at every timestep. The "default" style set the external E-field (Ex,Ey,Ez) to (0.0,0.0,0.0). The string can be set to "constant" if a cosntant external E-field is to be used in the simulation at every timestep. If this parameter is set to "constant", - then an additional parameter, namely, ``warpx.E_external_particle`` must be + then an additional parameter, namely, ``particles.E_external_particle`` must be specified in the input file. To parse a mathematical function for the external E-field, use the option ``parse_E_ext_particle_function``. This option requires additional parameters in the input file, namely, - ``warpx.Ex_external_particle_function(x,y,z,t)``, - ``warpx.Ey_external_particle_function(x,y,z,t)``, - ``warpx.Ez_external_particle_function(x,y,z,t)`` to apply the external E-field + ``particles.Ex_external_particle_function(x,y,z,t)``, + ``particles.Ey_external_particle_function(x,y,z,t)``, + ``particles.Ez_external_particle_function(x,y,z,t)`` to apply the external E-field on the particles. Constants required in the mathematical expression can be set using ``my_constants``. For a two-dimensional simulation, similar to the B-field, it is assumed that the first and second dimensions are `x` and `z`, respectively, @@ -766,7 +766,7 @@ Laser initialization The current implementation of the parser for the E-field on particles does not work with RZ and the code will abort with an error message. -* ``warpx.E_external_particle`` & ``warpx.B_external_particle`` (list of `float`) optional (default `0. 0. 0.`) +* ``particles.E_external_particle`` & ``particles.B_external_particle`` (list of `float`) optional (default `0. 0. 0.`) Two separate parameters which add an externally applied uniform E-field or B-field to each particle which is then added to the field values gathered from the grid in the PIC cycle. -- cgit v1.2.3