Skip to content

Commit

Permalink
merge with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
RevathiJambunathan committed Sep 13, 2024
2 parents 81bfa54 + ece2c05 commit 4cd0c74
Show file tree
Hide file tree
Showing 74 changed files with 704 additions and 1,062 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CleanUpCache

on:
workflow_run:
workflows: [🧹 clang-tidy, 🔍 CodeQL, 🐧 CUDA, 🐧 HIP, 🐧 Intel, 🍏 macOS, 🐧 OpenMP]
workflows: [🧴 clang sanitizers, 🧹 clang-tidy, 🔍 CodeQL, 🐧 CUDA, 🐧 HIP, 🐧 Intel, 🍏 macOS, 🐧 OpenMP]
types:
- completed

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
which nvcc || echo "nvcc not in PATH!"
git clone https://github.com/AMReX-Codes/amrex.git ../amrex
cd ../amrex && git checkout --detach 216ce6f37de4b65be57fc1006b3457b4fc318e03 && cd -
cd ../amrex && git checkout --detach 4460afbbce250ac6b463ea2bee0d9930c5059d2f && cd -
make COMP=gcc QED=FALSE USE_MPI=TRUE USE_GPU=TRUE USE_OMP=FALSE USE_FFT=TRUE USE_CCACHE=TRUE -j 4
ccache -s
Expand Down
1 change: 0 additions & 1 deletion Docs/source/developers/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Implementation Details
initialization
diagnostics
moving_window
qed
portability
warning_logger
python
Expand Down
20 changes: 19 additions & 1 deletion Docs/source/developers/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@ For easier debugging, it can be convenient to run the tests on your local machin
ctest --test-dir build -E laser_acceleration
* Sometimes two or more tests share a large number of input parameters and differ by a small set of options.
Such tests typically also share a base string in their names.
For example, you can find three different tests named ``test_3d_langmuir_multi``, ``test_3d_langmuir_multi_nodal`` and ``test_3d_langmuir_multi_picmi``.
In such a case, if you wish to run the test ``test_3d_langmuir_multi`` only, this can be done again with the ``-R`` regular `expression filter <https://regex101.com>`__ via

.. code-block:: sh
ctest --test-dir build -R "test_3d_langmuir_multi\..*"
Note that filtering with ``-R "test_3d_langmuir_multi"`` would include the additional tests that have the same substring in their name and would not be sufficient to isolate a single test.
Note also that the escaping ``\.`` in the regular expression is necessary in order to take into account the fact that each test is automatically appended with the strings ``.run``, ``.analysis`` and possibly ``.cleanup``.

* Run only tests not labeled with the ``slow`` label:

.. code-block:: sh
ctest --test-dir build -LE slow
Once the execution of CTest is completed, you can find all files associated with each test in its corresponding directory under ``build/bin/``.
For example, if you run the single test ``test_3d_laser_acceleration``, you can find all files associated with this test in the directory ``build/bin/test_3d_laser_acceleration/``.

Expand Down Expand Up @@ -155,7 +173,7 @@ A new test can be added by adding a corresponding entry in ``CMakeLists.txt`` as
If you need a new Python package dependency for testing, please add it in `Regression/requirements.txt <https://github.com/ECP-WarpX/WarpX/blob/development/Regression/requirements.txt>`__.

Sometimes, two tests share a large number of input parameters. The shared input parameters can be collected in a "base" input file that can be passed as a runtime parameter in the actual test input files through the parameter ``FILE``.
Sometimes two or more tests share a large number of input parameters. The shared input parameters can be collected in a "base" input file that can be passed as a runtime parameter in the actual test input files through the parameter ``FILE``.

Naming conventions for automated tests
--------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions Docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ Theory
theory/amr
theory/boundary_conditions
theory/boosted_frame
theory/input_output
theory/collisions
theory/multiphysics_extensions
theory/kinetic_fluid_hybrid_model
theory/cold_fluid_model

Expand Down
16 changes: 15 additions & 1 deletion Docs/source/theory/boosted_frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,21 @@ The simulations of plasma accelerators from first principles are extremely compu

A first principle simulation of a short driver beam (laser or charged particles) propagating through a plasma that is orders of magnitude longer necessitates a very large number of time steps. Recasting the simulation in a frame of reference that is moving close to the speed of light in the direction of the driver beam leads to simulating a driver beam that appears longer propagating through a plasma that appears shorter than in the laboratory. Thus, this relativistic transformation of space and time reduces the disparity of scales, and thereby the number of time steps to complete the simulation, by orders of magnitude.

Even using a moving window, however, a full PIC simulation of a plasma accelerator can be extraordinarily demanding computationally, as many time steps are needed to resolve the crossing of the short driver beam with the plasma column. As it turns out, choosing an optimal frame of reference that travels close to the speed of light in the direction of the laser or particle beam (as opposed to the usual choice of the laboratory frame) enables speedups by orders of magnitude :cite:p:`bf-Vayprl07,bf-Vaypop2011`. This is a result of the properties of Lorentz contraction and dilation of space and time. In the frame of the laboratory, a very short driver (laser or particle) beam propagates through a much longer plasma column, necessitating millions to tens of millions of time steps for parameters in the range of the BELLA or FACET-II experiments. As sketched in :numref:`fig_Boosted_frame`, in a frame moving with the driver beam in the plasma at velocity :math:`v=\beta c` (where :math:`c` is the speed of light in vacuum), the beam length is now elongated by :math:`\approx(1+\beta)\gamma` while the plasma contracts by :math:`\gamma` (where :math:`\gamma=1/\sqrt{1-\beta^2}` is the relativistic factor associated with the frame velocity). The number of time steps that is needed to simulate a “longer” beam through a “shorter” plasma is now reduced by up to :math:`\approx(1+\beta) \gamma^2` (a detailed derivation of the speedup is given below).
Even using a moving window, however, a full PIC simulation of a plasma accelerator can be extraordinarily demanding computationally, as many time steps are needed to resolve the crossing of the short driver beam with the plasma column.
As it turns out, choosing an optimal frame of reference that travels close to the speed of light in the direction of the laser or particle beam (as opposed to the usual choice of the laboratory frame) enables speedups by orders of magnitude :cite:p:`bf-Vayprl07,bf-Vaypop2011`.
This is a result of the properties of Lorentz contraction and dilation of space and time.
In the frame of the laboratory, a very short driver (laser or particle) beam propagates through a much longer plasma column, necessitating millions to tens of millions of time steps for parameters in the range of the BELLA or FACET-II experiments.
As sketched in :numref:`fig_Boosted_frame`, in a frame moving with the driver beam in the plasma at velocity :math:`v=\beta c` (where :math:`c` is the speed of light in vacuum), the beam length is now elongated by :math:`\approx(1+\beta)\gamma` while the plasma contracts by :math:`\gamma` (where :math:`\gamma=1/\sqrt{1-\beta^2}` is the relativistic factor associated with the frame velocity)
The number of time steps that is needed to simulate a “longer” beam through a “shorter” plasma is now reduced by up to :math:`\approx(1+\beta) \gamma^2` (a detailed derivation of the speedup is given below).

.. note::

For additional reading on inputs and outputs in boosted frame simulations, consider the following pages:

.. toctree::
:maxdepth: 1

boosted_frame/input_output

The modeling of a plasma acceleration stage in a boosted frame
involves the fully electromagnetic modeling of a plasma propagating at near the speed of light, for which Numerical Cerenkov
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _theory-io:
.. _boosted_frame-io:

Inputs and Outputs
==================
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _theory-collisions:
.. _multiphysics-collisions:

Collisions
==========
Expand All @@ -8,7 +8,7 @@ including collisions between kinetic particles (Coulomb collisions, DSMC,
nuclear fusion) as well as collisions between kinetic particles and a fixed
(i.e. non-evolving) background species (MCC, background stopping).

.. _theory-collisions-mcc:
.. _multiphysics-collisions-mcc:

Background Monte Carlo Collisions (MCC)
---------------------------------------
Expand Down Expand Up @@ -52,7 +52,7 @@ for all scattering processes are evaluated at the energy as calculated above.

Once a particle is selected for a specific collision process, that process determines how the particle is scattered as outlined below.

.. _theory-collisions-dsmc:
.. _multiphysics-collisions-dsmc:

Direct Simulation Monte Carlo (DSMC)
------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions Docs/source/theory/multiphysics/ionization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. _multiphysics-ionization:

Ionization
==========

.. note::

This section will be added soon!
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _developers-qed:
.. _multiphysics-qed:

QED
====================
Quantum Electrodynamics (QED)
=============================

Quantum synchrotron
-------------------
Expand All @@ -28,7 +28,8 @@ electron-positron pairs can be created in vacuum in the function

``MultiParticleContainer::doQEDSchwinger`` in turn calls the function ``filterCreateTransformFromFAB``:

.. doxygenfunction:: filterCreateTransformFromFAB(DstTile&, DstTile&, const amrex::Box, const FABs&, const Index, const Index, FilterFunc&&, CreateFunc1&&, CreateFunc2&&, TransFunc&&)
Filter Create Transform Function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

``filterCreateTransformFromFAB`` proceeds in three steps.
In the filter phase, we loop on every cell and calculate the number of physical pairs created within
Expand Down
13 changes: 13 additions & 0 deletions Docs/source/theory/multiphysics_extensions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _theory-multiphysics:

Multi-Physics Extensions
========================

WarpX includes various extensions to the traditional PIC loop which enable it to model additional physics.

.. toctree::
:maxdepth: 1

multiphysics/collisions
multiphysics/ionization
multiphysics/qed
8 changes: 4 additions & 4 deletions Docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ Particle initialization
* ``particles.rigid_injected_species`` (`strings`, separated by spaces)
List of species injected using the rigid injection method. The rigid injection
method is useful when injecting a relativistic particle beam in boosted-frame
simulations; see the :ref:`input-output section <theory-io>` for more details.
simulations; see the :ref:`input-output section <boosted_frame-io>` for more details.
For species injected using this method, particles are translated along the `+z`
axis with constant velocity as long as their ``z`` coordinate verifies
``z<zinject_plane``. When ``z>zinject_plane``,
Expand Down Expand Up @@ -1953,7 +1953,7 @@ Collision models
----------------

WarpX provides several particle collision models, using varying degrees of approximation.
Details about the collision models can be found in the :ref:`theory section <theory-collisions>`.
Details about the collision models can be found in the :ref:`theory section <multiphysics-collisions>`.

* ``collisions.collision_names`` (`strings`, separated by spaces)
The name of each collision type.
Expand All @@ -1976,10 +1976,10 @@ Details about the collision models can be found in the :ref:`theory section <the
(e.g. ``<species_name>.species_type = 'deuterium'``)
- ``dsmc`` for pair-wise, non-Coulomb collisions between kinetic species.
This is a "direct simulation Monte Carlo" treatment of collisions between
kinetic species. See :ref:`DSMC section <theory-collisions-dsmc>`.
kinetic species. See :ref:`DSMC section <multiphysics-collisions-dsmc>`.
- ``background_mcc`` for collisions between particles and a neutral background.
This is a relativistic Monte Carlo treatment for particles colliding
with a neutral background gas. See :ref:`MCC section <theory-collisions-mcc>`.
with a neutral background gas. See :ref:`MCC section <multiphysics-collisions-mcc>`.
- ``background_stopping`` for slowing of ions due to collisions with electrons or ions.
This implements the approximate formulae as derived in Introduction to Plasma Physics,
from Goldston and Rutherford, section 14.2.
Expand Down
16 changes: 16 additions & 0 deletions Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,22 @@ function(add_warpx_test
endif()
endfunction()

# Add a CTest label to a WarpX test set.
#
# Labeling it here will add the label to the run test, its analysis and its cleanup.
#
# name: unique name of this test
# label: ctest LABELS property value to be added
#
function(label_warpx_test name label)
set(_test_names "${name}.run;${name}.analysis;${name}.cleanup")
foreach(_test_name IN LISTS _test_names)
if(TEST ${_test_name})
set_property(TEST ${_test_name} APPEND PROPERTY LABELS "${label}")
endif()
endforeach()
endfunction()

# Add tests (alphabetical order) ##############################################
#

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ add_warpx_test(
diags/diag1/ # output
OFF # dependency
)
label_warpx_test(test_3d_beam_beam_collision slow)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ my_constants.Lz = 180.0*clight/omegab
# for a full scale simulation use: nx, ny, nz = 512, 512, 1024
my_constants.nx = 64
my_constants.ny = 64
my_constants.nz = 128
my_constants.nz = 64


# TIME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ add_warpx_test(
diags/diag1000001 # output
OFF # dependency
)
label_warpx_test(test_1d_laser_acceleration_fluid_boosted slow)

add_warpx_test(
test_1d_laser_acceleration_picmi # name
Expand Down Expand Up @@ -140,3 +141,4 @@ add_warpx_test(
diags/diag1000010 # output
OFF # dependency
)
label_warpx_test(test_rz_laser_acceleration_picmi slow)
1 change: 1 addition & 0 deletions Examples/Tests/langmuir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ if(WarpX_FFT)
diags/diag1000040 # output
OFF # dependency
)
label_warpx_test(test_3d_langmuir_multi_psatd_vay_deposition_nodal slow)
endif()

add_warpx_test(
Expand Down
3 changes: 2 additions & 1 deletion Examples/Tests/nci_psatd_stability/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ if(WarpX_FFT)
2 # nprocs
inputs_test_rz_multiJ_psatd # inputs
analysis_default_regression.py # analysis
diags/diag1000050 # output
diags/diag1000025 # output
OFF # dependency
)
label_warpx_test(test_rz_multiJ_psatd slow)
endif()
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Iterations
max_step = 50
max_step = 25

# Domain
amr.n_cell = 64 128
amr.n_cell = 32 64
amr.max_level = 0
warpx.numprocs = 1 2

Expand Down Expand Up @@ -115,7 +115,7 @@ plasma_p.do_continuous_injection = 1

# Diagnostics
diagnostics.diags_names = diag1
diag1.intervals = 50
diag1.intervals = 25
diag1.diag_type = Full
diag1.fields_to_plot = Er Ez Bt jr jz rho rho_driver rho_plasma_e rho_plasma_p
diag1.species = driver plasma_e plasma_p
1 change: 1 addition & 0 deletions Examples/Tests/nodal_electrostatic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ add_warpx_test(
diags/diag1000010 # output
OFF # dependency
)
label_warpx_test(test_3d_nodal_electrostatic_solver slow)
1 change: 1 addition & 0 deletions Examples/Tests/ohm_solver_em_modes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ add_warpx_test(
diags/diag1000100 # output
OFF # dependency
)
label_warpx_test(test_rz_ohm_solver_em_modes_picmi slow)
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ add_warpx_test(
diags/diag1000100 # output
OFF # dependency
)
label_warpx_test(test_2d_ohm_solver_landau_damping_picmi slow)
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ add_warpx_test(
diags/diag1002500 # output
OFF # dependency
)
label_warpx_test(test_1d_ohm_solver_ion_beam_picmi slow)
1 change: 1 addition & 0 deletions Examples/Tests/particles_in_pml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ add_warpx_test(
diags/diag1000200 # output
OFF # dependency
)
label_warpx_test(test_3d_particles_in_pml_mr slow)
Loading

0 comments on commit 4cd0c74

Please sign in to comment.