Skip to content

Commit

Permalink
Merge branch 'development' into RecordingDataAtStation
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Jan 8, 2024
2 parents 7929feb + 42e8c56 commit a609f8e
Show file tree
Hide file tree
Showing 54 changed files with 444 additions and 432 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Checks: '
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-make-member-function-const,
-readability-named-parameter,
-readability-uppercase-literal-suffix
'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
which nvcc || echo "nvcc not in PATH!"
git clone https://github.com/AMReX-Codes/amrex.git ../amrex
cd ../amrex && git checkout --detach 75571e2dcbf2417529c5ed8e24113580e8e1f3f1 && cd -
cd ../amrex && git checkout --detach 24.01 && cd -
make COMP=gcc QED=FALSE USE_MPI=TRUE USE_GPU=TRUE USE_OMP=FALSE USE_PSATD=TRUE USE_CCACHE=TRUE -j 2
ccache -s
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Preamble ####################################################################
#
cmake_minimum_required(VERSION 3.20.0)
project(WarpX VERSION 23.12)
project(WarpX VERSION 24.01)

include(${WarpX_SOURCE_DIR}/cmake/WarpXFunctions.cmake)

Expand Down
4 changes: 2 additions & 2 deletions Docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def __init__(self, *args, **kwargs):
# built documents.
#
# The short X.Y version.
version = u'23.12'
version = u'24.01'
# The full version, including alpha/beta/rc tags.
release = u'23.12'
release = u'24.01'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
29 changes: 1 addition & 28 deletions Docs/source/usage/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ Plasma-Based Acceleration
examples/pwfa/README.rst
pwfa.rst

Coming soon:

* LWFA: External injection in the boosted frame
* LWFA: Ionization injection in the lab frame using a LASY data file
* PWFA: External injection in the boosted frame
* PWFA: Self-injection in the lab frame
* MR case?


Laser-Plasma Interaction
------------------------
Expand All @@ -43,11 +35,6 @@ Laser-Plasma Interaction
examples/laser_ion/README.rst
examples/plasma_mirror/README.rst

Coming soon:

* MVA (3D & RZ)
* MR for the planar example?


Particle Accelerator & Beam Physics
-----------------------------------
Expand All @@ -58,12 +45,6 @@ Particle Accelerator & Beam Physics
examples/gaussian_beam/README.rst
examples/beam-beam_collision/README.rst

Coming soon:

* Beam-Beam Collision
* Beam Transport or Injector
* Cathode/source


High Energy Astrophysical Plasma Physics
----------------------------------------
Expand All @@ -90,11 +71,6 @@ Nuclear Fusion

TODO

Coming soon:

* Microchannel
* Magnetically Confined Plasma with a Single Coil - Magnetic bottle: simple geometry with an external field


Fundamental Plasma Physics
--------------------------
Expand All @@ -105,9 +81,6 @@ Fundamental Plasma Physics
examples/langmuir/README.rst
examples/capacitive_discharge/README.rst

Coming soon:

* Expanding Sphere example

.. _examples-hybrid-model:

Expand Down Expand Up @@ -150,7 +123,7 @@ Manipulating fields via Python

.. note::

TODO: The section needs to be sorted into either science cases (above) or later sections (workflows and Python API details).
TODO: The section needs to be sorted into either science cases (above) or later sections (:ref:`workflows and Python API details <usage-python-extend>`).

An example of using Python to access the simulation charge density, solve the Poisson equation (using ``superLU``) and write the resulting electrostatic potential back to the simulation is given in the input file below. This example uses the ``fields.py`` module included in the ``pywarpx`` library.

Expand Down
19 changes: 18 additions & 1 deletion Docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,11 @@ Particle initialization
* ``<species>.do_field_ionization`` (`0` or `1`) optional (default `0`)
Do field ionization for this species (using the ADK theory).

* ``<species>.do_adk_correction`` (`0` or `1`) optional (default `0`)
Whether to apply the correction to the ADK theory proposed by Zhang, Lan and Lu in `Q. Zhang et al. (Phys. Rev. A 90, 043410, 2014) <https://doi.org/10.1103/PhysRevA.90.043410>`__.
If so, the probability of ionization is modified using an empirical model that should be more accurate in the regime of high electric fields.
Currently, this is only implemented for Hydrogen, although Argon is also available in the same reference.

* ``<species>.physical_element`` (`string`)
Only read if `do_field_ionization = 1`. Symbol of chemical element for
this species. Example: for Helium, use ``physical_element = He``.
Expand Down Expand Up @@ -1508,9 +1513,15 @@ Laser initialization
External fields
---------------

Grid initialization
Applied to the grid
^^^^^^^^^^^^^^^^^^^

The external fields defined with input parameters that start with ``warpx.B_ext_grid_init_`` or ``warpx.E_ext_grid_init_``
are applied to the grid directly. In particular, these fields can be seen in the diagnostics that output the fields on the grid.

- When using an **electromagnetic** field solver, these fields are applied to the grid at the beginning of the simulation, and serve as initial condition for the Maxwell solver.
- When using an **electrostatic** or **magnetostatic** field solver, these fields are added to the fields computed by the Poisson solver, at each timestep.

* ``warpx.B_ext_grid_init_style`` (string) optional
This parameter determines the type of initialization for the external
magnetic field. By default, the
Expand Down Expand Up @@ -1597,6 +1608,9 @@ Grid initialization
Applied to Particles
^^^^^^^^^^^^^^^^^^^^

The external fields defined with input parameters that start with ``warpx.B_ext_particle_init_`` or ``warpx.E_ext_particle_init_``
are applied to the particles directly, at each timestep. As a results, these fields **cannot** be seen in the diagnostics that output the fields on the grid.

* ``particles.E_ext_particle_init_style`` & ``particles.B_ext_particle_init_style`` (string) optional (default "none")
These parameters determine the type of the external electric and
magnetic fields respectively that are applied directly to the particles at every timestep.
Expand Down Expand Up @@ -1657,6 +1671,9 @@ Applied to Particles
Applied to Cold Relativistic Fluids
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The external fields defined with input parameters that start with ``warpx.B_ext_init_`` or ``warpx.E_ext_init_``
are applied to the fluids directly, at each timestep. As a results, these fields **cannot** be seen in the diagnostics that output the fields on the grid.

* ``<fluid_species_name>.E_ext_init_style`` & ``<fluid_species_name>.B_ext_init_style`` (string) optional (default "none")
These parameters determine the type of the external electric and
magnetic fields respectively that are applied directly to the cold relativistic fluids at every timestep.
Expand Down
114 changes: 52 additions & 62 deletions Examples/Physics_applications/beam-beam_collision/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ algo.particle_pusher = vay
#################################
########### PARTICLES ###########
#################################
particles.species_names = beam1 beam2 pho1 pho2 ele_nlbw1 pos_nlbw1 ele_nlbw2 pos_nlbw2 pho ele pos
particles.photon_species = pho1 pho2 pho
particles.species_names = beam1 beam2 pho1 pho2 ele1 pos1 ele2 pos2
particles.photon_species = pho1 pho2

beam1.species_type = electron
beam1.injection_style = NUniformPerCell
Expand Down Expand Up @@ -117,68 +117,58 @@ beam2.do_classical_radiation_reaction = 0
pho1.species_type = photon
pho1.injection_style = none
pho1.do_qed_breit_wheeler = 1
pho1.qed_breit_wheeler_ele_product_species = ele_nlbw1
pho1.qed_breit_wheeler_pos_product_species = pos_nlbw1
pho1.qed_breit_wheeler_ele_product_species = ele1
pho1.qed_breit_wheeler_pos_product_species = pos1

pho2.species_type = photon
pho2.injection_style = none
pho2.do_qed_breit_wheeler = 1
pho2.qed_breit_wheeler_ele_product_species = ele_nlbw2
pho2.qed_breit_wheeler_pos_product_species = pos_nlbw2

ele_nlbw1.species_type = electron
ele_nlbw1.injection_style = none
ele_nlbw1.self_fields_required_precision = 1e-11
ele_nlbw1.self_fields_max_iters = 10000
ele_nlbw1.do_qed_quantum_sync = 1
ele_nlbw1.qed_quantum_sync_phot_product_species = pho
ele_nlbw1.do_classical_radiation_reaction = 0

pos_nlbw1.species_type = positron
pos_nlbw1.injection_style = none
pos_nlbw1.self_fields_required_precision = 1e-11
pos_nlbw1.self_fields_max_iters = 10000
pos_nlbw1.do_qed_quantum_sync = 1
pos_nlbw1.qed_quantum_sync_phot_product_species = pho
pos_nlbw1.do_classical_radiation_reaction = 0

ele_nlbw2.species_type = electron
ele_nlbw2.injection_style = none
ele_nlbw2.self_fields_required_precision = 1e-11
ele_nlbw2.self_fields_max_iters = 10000
ele_nlbw2.do_qed_quantum_sync = 1
ele_nlbw2.qed_quantum_sync_phot_product_species = pho
ele_nlbw2.do_classical_radiation_reaction = 0

pos_nlbw2.species_type = positron
pos_nlbw2.injection_style = none
pos_nlbw2.self_fields_required_precision = 1e-11
pos_nlbw2.self_fields_max_iters = 10000
pos_nlbw2.do_qed_quantum_sync = 1
pos_nlbw2.qed_quantum_sync_phot_product_species = pho
pos_nlbw2.do_classical_radiation_reaction = 0

pho.species_type = photon
pho.injection_style = none
pho.do_qed_breit_wheeler = 1
pho.qed_breit_wheeler_ele_product_species = ele
pho.qed_breit_wheeler_pos_product_species = pos

ele.species_type = electron
ele.injection_style = none
ele.self_fields_required_precision = 1e-11
ele.self_fields_max_iters = 10000
ele.do_qed_quantum_sync = 1
ele.qed_quantum_sync_phot_product_species = pho
ele.do_classical_radiation_reaction = 0

pos.species_type = positron
pos.injection_style = none
pos.self_fields_required_precision = 1e-11
pos.self_fields_max_iters = 10000
pos.do_qed_quantum_sync = 1
pos.qed_quantum_sync_phot_product_species = pho
pos.do_classical_radiation_reaction = 0
pho2.qed_breit_wheeler_ele_product_species = ele2
pho2.qed_breit_wheeler_pos_product_species = pos2

ele1.species_type = electron
ele1.injection_style = none
ele1.self_fields_required_precision = 1e-11
ele1.self_fields_max_iters = 10000
ele1.do_qed_quantum_sync = 1
ele1.qed_quantum_sync_phot_product_species = pho1
ele1.do_classical_radiation_reaction = 0

pos1.species_type = positron
pos1.injection_style = none
pos1.self_fields_required_precision = 1e-11
pos1.self_fields_max_iters = 10000
pos1.do_qed_quantum_sync = 1
pos1.qed_quantum_sync_phot_product_species = pho1
pos1.do_classical_radiation_reaction = 0

ele2.species_type = electron
ele2.injection_style = none
ele2.self_fields_required_precision = 1e-11
ele2.self_fields_max_iters = 10000
ele2.do_qed_quantum_sync = 1
ele2.qed_quantum_sync_phot_product_species = pho2
ele2.do_classical_radiation_reaction = 0

pos2.species_type = positron
pos2.injection_style = none
pos2.self_fields_required_precision = 1e-11
pos2.self_fields_max_iters = 10000
pos2.do_qed_quantum_sync = 1
pos2.qed_quantum_sync_phot_product_species = pho2
pos2.do_classical_radiation_reaction = 0

pho1.species_type = photon
pho1.injection_style = none
pho1.do_qed_breit_wheeler = 1
pho1.qed_breit_wheeler_ele_product_species = ele1
pho1.qed_breit_wheeler_pos_product_species = pos1

pho2.species_type = photon
pho2.injection_style = none
pho2.do_qed_breit_wheeler = 1
pho2.qed_breit_wheeler_ele_product_species = ele2
pho2.qed_breit_wheeler_pos_product_species = pos2

#################################
############# QED ###############
Expand Down Expand Up @@ -225,10 +215,10 @@ diagnostics.diags_names = diag1
diag1.intervals = 0
diag1.diag_type = Full
diag1.write_species = 1
diag1.fields_to_plot = Ex Ey Ez Bx By Bz rho_beam1 rho_beam2 rho_ele_nlbw1 rho_pos_nlbw1 rho_ele_nlbw2 rho_pos_nlbw2 rho_ele rho_pos
diag1.fields_to_plot = Ex Ey Ez Bx By Bz rho_beam1 rho_beam2 rho_ele1 rho_pos1 rho_ele2 rho_pos2
diag1.format = openpmd
diag1.dump_last_timestep = 1
diag1.species = pho1 pho2 pho ele_nlbw1 pos_nlbw1 ele_nlbw2 pos_nlbw2 ele pos beam1 beam2
diag1.species = pho1 pho2 ele1 pos1 ele2 pos2 beam1 beam2

# REDUCED
warpx.reduced_diags_names = ParticleNumber ColliderRelevant_beam1_beam2
Expand Down
72 changes: 35 additions & 37 deletions Examples/Physics_applications/capacitive_discharge/analysis_dsmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,44 @@
fn = sys.argv[1]
test_name = os.path.split(os.getcwd())[1]

my_check = checksumAPI.evaluate_checksum(
test_name, fn, do_particles=True, rtol=0.01
)
my_check = checksumAPI.evaluate_checksum(test_name, fn, do_particles=True)

ref_density = np.array([
1.27953969e+14, 2.23553999e+14, 2.55384510e+14, 2.55663110e+14,
2.55805760e+14, 2.55812087e+14, 2.55813911e+14, 2.55754104e+14,
2.55929601e+14, 2.56085472e+14, 2.55932867e+14, 2.55828121e+14,
2.55901711e+14, 2.55985074e+14, 2.56182697e+14, 2.56446847e+14,
2.56483696e+14, 2.56301187e+14, 2.56245301e+14, 2.56797584e+14,
2.57257907e+14, 2.57023627e+14, 2.56500876e+14, 2.56106851e+14,
2.56283546e+14, 2.56723967e+14, 2.56960855e+14, 2.56825486e+14,
2.56674669e+14, 2.56567191e+14, 2.56310927e+14, 2.56361171e+14,
2.56692197e+14, 2.56743606e+14, 2.56653108e+14, 2.56883854e+14,
2.56763228e+14, 2.56343726e+14, 2.56385489e+14, 2.56570110e+14,
2.56538112e+14, 2.56472179e+14, 2.56322922e+14, 2.56195384e+14,
2.56474576e+14, 2.56764233e+14, 2.56533016e+14, 2.56257170e+14,
2.56362463e+14, 2.56363962e+14, 2.56311292e+14, 2.56678788e+14,
2.57061138e+14, 2.56785892e+14, 2.56406603e+14, 2.56334908e+14,
2.56120051e+14, 2.56003269e+14, 2.56132187e+14, 2.56329572e+14,
2.56535713e+14, 2.56708950e+14, 2.56661860e+14, 2.56448986e+14,
2.56386823e+14, 2.56233660e+14, 2.56137632e+14, 2.56206263e+14,
2.56364996e+14, 2.56483536e+14, 2.56308741e+14, 2.56447231e+14,
2.56896301e+14, 2.56691405e+14, 2.56170780e+14, 2.56122216e+14,
2.56427399e+14, 2.56897558e+14, 2.56928868e+14, 2.56659033e+14,
2.56749993e+14, 2.56952497e+14, 2.56798907e+14, 2.56377081e+14,
2.56453057e+14, 2.56796632e+14, 2.56944576e+14, 2.57248469e+14,
2.57279426e+14, 2.56849516e+14, 2.56601834e+14, 2.56850545e+14,
2.56953072e+14, 2.56442586e+14, 2.56329006e+14, 2.56790661e+14,
2.57083582e+14, 2.57075550e+14, 2.56719615e+14, 2.56220486e+14,
2.56222323e+14, 2.56547365e+14, 2.56499423e+14, 2.56434041e+14,
2.56378587e+14, 2.56249892e+14, 2.56380492e+14, 2.56504513e+14,
2.56337631e+14, 2.56204891e+14, 2.56325116e+14, 2.56297798e+14,
2.56112782e+14, 2.56054218e+14, 2.56320120e+14, 2.56580938e+14,
2.56446800e+14, 2.56267011e+14, 2.56372853e+14, 2.56617592e+14,
2.56630745e+14, 2.56615242e+14, 2.56625259e+14, 2.56561320e+14,
2.56640072e+14, 2.56693273e+14, 2.56613237e+14, 2.24169847e+14,
1.27683197e+14
1.27957355e+14, 2.23554080e+14, 2.55373436e+14, 2.55659492e+14,
2.55814670e+14, 2.55818418e+14, 2.55811882e+14, 2.55742272e+14,
2.55912888e+14, 2.56086072e+14, 2.55944486e+14, 2.55830183e+14,
2.55909337e+14, 2.56008609e+14, 2.56205930e+14, 2.56421940e+14,
2.56369990e+14, 2.56151020e+14, 2.55925823e+14, 2.55924941e+14,
2.56067211e+14, 2.56264104e+14, 2.56435035e+14, 2.56543804e+14,
2.56715146e+14, 2.56639305e+14, 2.56509438e+14, 2.56478881e+14,
2.56406748e+14, 2.56194832e+14, 2.56126186e+14, 2.56442221e+14,
2.56603784e+14, 2.56592554e+14, 2.56475838e+14, 2.56304135e+14,
2.56310993e+14, 2.56298883e+14, 2.56386742e+14, 2.56555670e+14,
2.56588013e+14, 2.56851444e+14, 2.56928531e+14, 2.56637559e+14,
2.56678652e+14, 2.56827322e+14, 2.56630197e+14, 2.56295404e+14,
2.56285079e+14, 2.56558116e+14, 2.56676094e+14, 2.56577780e+14,
2.56599749e+14, 2.56540500e+14, 2.56292984e+14, 2.56230350e+14,
2.56363607e+14, 2.56553909e+14, 2.56501054e+14, 2.56249684e+14,
2.56280268e+14, 2.56558208e+14, 2.56437837e+14, 2.56152650e+14,
2.56143349e+14, 2.56067330e+14, 2.56020624e+14, 2.56039223e+14,
2.56306096e+14, 2.56693084e+14, 2.56649778e+14, 2.56589778e+14,
2.56594097e+14, 2.56368788e+14, 2.56290090e+14, 2.56420940e+14,
2.56581419e+14, 2.56642649e+14, 2.56426887e+14, 2.56360122e+14,
2.56573424e+14, 2.56679138e+14, 2.56488767e+14, 2.56217444e+14,
2.56353118e+14, 2.56640765e+14, 2.56809490e+14, 2.56933226e+14,
2.56633538e+14, 2.56203430e+14, 2.56202958e+14, 2.56564020e+14,
2.56816347e+14, 2.56709830e+14, 2.56557382e+14, 2.56573904e+14,
2.56745541e+14, 2.56784430e+14, 2.56580054e+14, 2.56210130e+14,
2.56271415e+14, 2.56821160e+14, 2.56703292e+14, 2.56169296e+14,
2.56166549e+14, 2.56467777e+14, 2.56573240e+14, 2.56437594e+14,
2.56253730e+14, 2.56176123e+14, 2.56351125e+14, 2.56569916e+14,
2.56761101e+14, 2.56891411e+14, 2.56628312e+14, 2.56180062e+14,
2.56063564e+14, 2.56189728e+14, 2.56609454e+14, 2.57263643e+14,
2.57097673e+14, 2.56666761e+14, 2.56622585e+14, 2.56432378e+14,
2.56386718e+14, 2.56734491e+14, 2.57042448e+14, 2.24471147e+14,
1.27720853e+14
])

density_data = np.load( 'ion_density_case_1.npy' )
print(repr(density_data))
assert np.allclose(density_data, ref_density, rtol=0.01)
assert np.allclose(density_data, ref_density)
Loading

0 comments on commit a609f8e

Please sign in to comment.