From c5409fc51efbcb124207be54547c9f66cb06af0c Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Wed, 3 Jan 2018 16:50:30 -0800 Subject: Added documentation for plotting the raw fields. --- Docs/source/running_cpp/parameters.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Docs/source/running_cpp/parameters.rst') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index cf03a04ad..57415c2b3 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -274,3 +274,20 @@ Diagnostics and output Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``. The time interval inbetween the lab-frame snapshots (where this time interval is expressed in the laboratory frame). + +* ``warpx.plot_raw_fields`` (`0` or `1`) + By default, the fields written in the plot files are averaged on the nodes. + When ```warpx.plot_raw_fields`` is `1`, then the raw (i.e. unaveraged) + fields are also saved in the plot files. + +* ``warpx.plot_raw_fields_guards`` (`0` or `1`) + Only used when ``warpx.plot_raw_fields`` is ``1``. + Whether to include the guard cells in the output of the raw fields. + +* ``warpx.plot_finepatch`` (`0` or `1`) + Only used when mesh refinement is activated and ``warpx.plot_raw_fields`` is ``1``. + Whether to output the data of the fine patch, in the plot files. + +* ``warpx.plot_crsepatch`` (`0` or `1`) + Only used when mesh refinement is activated and ``warpx.plot_raw_fields`` is ``1``. + Whether to output the data of the coarse patch, in the plot files. -- cgit v1.2.3 From 33b9f06a78f5e4f81404c0a18806d93d39be1f25 Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Thu, 4 Jan 2018 12:07:40 -0800 Subject: Add documentation on the parameter warpx.cfl --- Docs/source/running_cpp/parameters.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Docs/source/running_cpp/parameters.rst') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 57415c2b3..2d4f0f874 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -12,7 +12,6 @@ Overall simulation parameters * ``max_step`` (`integer`) The number of PIC cycles to perform. - * ``warpx.gamma_boost`` (`float`) The Lorentz factor of the boosted frame in which the simulation is run. (The corresponding Lorentz transformation is assumed to be along ``warpx.boost_direction``.) @@ -212,6 +211,10 @@ Laser initialization Numerics and algorithms ----------------------- +* ``warpx.cfl`` (`float`) + The ratio between the time step to be used in the simulation and + the CFL limit of the Maxwell solver. + * ``warpx.use_filter`` (`0 or 1`) Whether to smooth the charge and currents on the mesh, after depositing them from the macroparticles. This uses a bilinear filter -- cgit v1.2.3 From b9b4951ee5f7c3ab66dbc365f1a884fbc7fc9bce Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Thu, 4 Jan 2018 12:09:36 -0800 Subject: Update documentation on particle initialization --- Docs/source/running_cpp/parameters.rst | 41 +++++++++++++++++++++++-- Source/CustomDensityProb.cpp | 55 +++++++++++++++++++++++++++++----- 2 files changed, 86 insertions(+), 10 deletions(-) (limited to 'Docs/source/running_cpp/parameters.rst') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 2d4f0f874..540389f0f 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -90,6 +90,42 @@ Distribution across MPI ranks and parallelization Particle initialization ----------------------- +* ``particles.nspecies`` (`int`) + The number of species that will be used in the simulation. + +* ``particles.species_names`` (`strings`, separated by spaces) + The name of each species. This is then used in the rest of the input deck ; + in this documentation we use `` as a placeholder. + +* ``.charge`` (`float`) + The charge of one `physical` particle of this species. + +* ``.mass`` (`float`) + The mass of one `physical` particle of this species. + +* ``.injection_style`` (`string`) + Determines how the particles will be injected in the simulation. + The options are: + + * ``NUniformPerCell``: injection with a fixed number of particles + per cell, with particles being evenly-spaced in each direction within a cell. + This requires the additional parameter ``.num_particles_per_cell_each_dim``. + + * ``NRandomPerCell``: injection with a fixed number of particles + per cell, with particles being randomly distributed within each cell. + This requires the additional parameter ``.num_particles_per_cell``. + + * ``Gaussian_Beam``: + +Additional parameters for plasma injection (``NUniformPerCell`` and ``NRandomPerCell``) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Additional parameters for gaussian beams (``Gaussian_Beam``) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + Laser initialization -------------------- @@ -212,8 +248,9 @@ Numerics and algorithms ----------------------- * ``warpx.cfl`` (`float`) - The ratio between the time step to be used in the simulation and - the CFL limit of the Maxwell solver. + The ratio between the actual timestep that is used in the simulation + and the CFL limit. (e.g. for `warpx.cfl=1`, the timestep will be + exactly equal to the CFL limit.) * ``warpx.use_filter`` (`0 or 1`) Whether to smooth the charge and currents on the mesh, after depositing diff --git a/Source/CustomDensityProb.cpp b/Source/CustomDensityProb.cpp index 1df3d75ad..2f6005bc2 100644 --- a/Source/CustomDensityProb.cpp +++ b/Source/CustomDensityProb.cpp @@ -1,13 +1,52 @@ #include -#include +using namespace amrex; -#include +/// +/// This "custom" density profile just does constant +/// +Real CustomDensityProfile::getDensity(Real x, Real y, Real z) const { + const Real on_axis_density = params[0]; + const Real plasma_zmin = params[1]; + const Real plasma_zmax = params[2]; + const Real plasma_lramp_start = params[3]; + const Real plasma_lramp_end = params[4]; + const Real plasma_rcap = params[5]; + const Real plasma_rdownramp = params[6]; + const Real plasma_rchannel = params[7]; + static const Real re = 2.8178403227e-15; // Electron classical radius + static const Real pi = 3.14159265359; -amrex::Real CustomDensityProfile::getDensity(amrex::Real x, - amrex::Real y, - amrex::Real z) const -{ - amrex::Abort("If running with a custom density profile, you must supply a CustomDensityProb.cpp file"); - return 0.0; + Real r2 = x*x + y*y; + Real r = std::sqrt( r2 ); + + // Transverse part of the profile + Real nr; + if (r 4.) { + n = 4.; + } + + return on_axis_density*n; } -- cgit v1.2.3