diff options
Diffstat (limited to 'Docs/source/running_cpp/parameters.rst')
-rw-r--r-- | Docs/source/running_cpp/parameters.rst | 83 |
1 files changed, 82 insertions, 1 deletions
diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 08804bb9b..3498b8203 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -540,6 +540,38 @@ Laser initialization none of the parameters below are used when ``<laser_name>.parse_field_function=1``. Even though ``<laser_name>.wavelength`` and ``<laser_name>.e_max`` should be included in the laser function, they still have to be specified as they are used for numerical purposes. + - ``"from_txye_file"``: the electric field of the laser is read from an external binary file + whose format is explained below. It requires to provide the name of the binary file + setting the additional parameter ``<laser_name>.txye_file_name`` (string). It accepts an + optional parameter ``<laser_name>.time_chunk_size`` (int). This allows to read only + time_chunk_size timesteps from the binary file. New timesteps are read as soon as they are needed. + The default value is automatically set to the number of timesteps contained in the binary file + (i.e. only one read is performed at the beginning of the simulation). + The external binary file should provide E(x,y,t) on a rectangular (but non necessarily uniform) + grid. The code performs a bi-linear (in 2D) or tri-linear (in 3D) interpolation to set the field + values. x,y,t are meant to be in S.I. units, while the field value is meant to be multiplied by + ``<laser_name>.e_max`` (i.e. in most cases the maximum of abs(E(x,y,t)) should be 1, + so that the maximum field intensity can be set straightforwardly with ``<laser_name>.e_max``). + The binary file has to respect the following format: + + * flag to indicate if the grid is uniform or not (1 byte, 0 means non-uniform, !=0 means uniform) + + * np, number of timesteps (uint32_t, must be >=2) + + * nx, number of points along x (uint32_t, must be >=2) + + * ny, number of points along y (uint32_t, must be 1 for 2D simulations and >=2 for 3D simulations) + + * timesteps (double[2] if grid is uniform, double[np] otherwise) + + * x_coords (double[2] if grid is uniform, double[nx] otherwise) + + * y_coords (double[1] if 2D, double[2] if 3D & uniform grid, double[ny] if 3D & non uniform grid) + + * field_data (double[nt * nx * ny], with nt being the slowest coordinate). + + A file at this format can be generated from Python, see an example at ``Examples/Modules/laser_injection_from_file`` + * ``<laser_name>.profile_t_peak`` (`float`; in seconds) The time at which the laser reaches its peak intensity, at the position @@ -637,7 +669,56 @@ Laser initialization ``mirror_z_width < dz/cell_size``, the upper bound of the mirror is increased so that it contains at least ``mirror_z_npoints``. -* ``warpx.E_external_grid`` & ``warpx.B_external_grid`` (list of `int`) optional (default `0. 0. 0.`) +* ``warpx.B_ext_grid_init_style`` (string) optional (default is "default") + This parameter determines the type of initialization for the external + magnetic field. The "default" style initializes the + external magnetic field (Bx,By,Bz) to (0.0, 0.0, 0.0). + The string can be set to "constant" if a constant magnetic field is + required to be set at initialization. If set to "constant", then an + additional parameter, namely, ``warpx.B_external_grid`` must be specified. + If set to ``parse_B_ext_grid_function``, then a mathematical expression can + be used to initialize the external magnetic field on the grid. It + requires additional parameters in the input file, namely, + ``warpx.Bx_external_grid_function(x,y,z)``, + ``warpx.By_external_grid_function(x,y,z)``, + ``warpx.Bz_external_grid_function(x,y,z)`` to initialize the external + magnetic field for each of the three components on the grid. + Constants required in the expression can be set using ``my_constants``. + For example, if ``warpx.Bx_external_grid_function(x,y,z)=Bo*x + delta*(y + z)`` + then the constants `Bo` and `delta` required in the above equation + can be set using ``my_constants.Bo=`` and ``my_constants.delta=`` in the + input file. For a two-dimensional simulation, it is assumed that the first dimension is `x` and the second dimension in `z`, and the value of `y` is set to zero. + Note that the current implementation of the parser for external B-field + does not work with RZ and the code will abort with an error message. + +* ``warpx.E_ext_grid_init_style`` (string) optional (default is "default") + This parameter determines the type of initialization for the external + electric field. The "default" style initializes the + external electric field (Ex,Ey,Ez) to (0.0, 0.0, 0.0). + The string can be set to "constant" if a constant electric field is + required to be set at initialization. If set to "constant", then an + additional parameter, namely, ``warpx.E_external_grid`` must be specified + in the input file. + If set to ``parse_E_ext_grid_function``, then a mathematical expression can + be used to initialize the external magnetic field on the grid. It + required additional parameters in the input file, namely, + ``warpx.Ex_external_grid_function(x,y,z)``, + ``warpx.Ey_external_grid_function(x,y,z)``, + ``warpx.Ez_externail_grid_function(x,y,z)`` to initialize the external + electric field for each of the three components on the grid. + Constants required in the expression can be set using ``my_constants``. + For example, if ``warpx.Ex_external_grid_function(x,y,z)=Eo*x + delta*(y + z)`` + then the constants `Bo` and `delta` required in the above equation + can be set using ``my_constants.Eo=`` and ``my_constants.delta=`` in the + input file. For a two-dimensional simulation, it is assumed that the first + dimension is `x` and the second dimension in `z`, + and the value of `y` is set to zero. + Note that the current implementation of the parser for external E-field + does not work with RZ and the code will abort with an error message. + +* ``warpx.E_external_grid`` & ``warpx.B_external_grid`` (list of `int`) + required when ``warpx.B_ext_grid_init_style="parse_B_ext_grid_function"`` + and when ``warpx.E_ext_grid_init_style="parse_E_ext_grid_function"``, respectively. External uniform and constant electrostatic and magnetostatic field added to the grid at initialization. Use with caution as these fields are used for the field solver. In particular, do not use any other boundary condition |