Skip to content

Commit

Permalink
Merge branch 'development' into add_particle_boundary_none
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgrote committed May 29, 2024
2 parents ae2f3e3 + 0e41d93 commit b32cdab
Show file tree
Hide file tree
Showing 42 changed files with 504 additions and 510 deletions.
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 d857968968ae2cdf18f39ee50df96529e326ff39 && cd -
cd ../amrex && git checkout --detach 7ca419ebb90da60fefc01d8c1816846fff8638a5 && cd -
make COMP=gcc QED=FALSE USE_MPI=TRUE USE_GPU=TRUE USE_OMP=FALSE USE_PSATD=TRUE USE_CCACHE=TRUE -j 4
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 24.04)
project(WarpX VERSION 24.05)

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'24.04'
version = u'24.05'
# The full version, including alpha/beta/rc tags.
release = u'24.04'
release = u'24.05'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
88 changes: 44 additions & 44 deletions Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
## the initial number of protons and borons.
##
## The third test corresponds to a Maxwellian plasma with a 44 keV temperature. The alpha yield is
## directly compared to the analytical fits of W.M. Nevins and R. Swain, Nuclear Fusion, 40, 865
## (2000) for a thermal plasma.
## directly compared to the analytical fits of A. Tentori and F. Belloni, Nuclear Fusion, 63, 086001
## (2023) for a thermal plasma.
##
## The fourth test corresponds to a plasma with an extremely small boron density, so that all boron
## macroparticles should have disappeared by the end of the simulation, which we verify.
Expand Down Expand Up @@ -259,10 +259,10 @@ def check_isotropy(data, relative_tolerance):
def astrophysical_factor_lowE(E):
## E is in keV
## Returns astrophysical factor in MeV b using the low energy fit in the range E < 400 keV
## described in equation (2) of W.M. Nevins and R. Swain, Nuclear Fusion, 40, 865 (2000)
## described in equation (3) of A. Tentori and F. Belloni, Nuclear Fusion, 63, 086001 (2023)
C0 = 197.
C1 = 0.24
C2 = 2.31e-4
C1 = 0.269
C2 = 2.54e-4
AL = 1.82e4
EL = 148.
dEL = 2.35
Expand All @@ -271,12 +271,12 @@ def astrophysical_factor_lowE(E):
def astrophysical_factor_midE(E):
## E is in keV
## Returns astrophysical factor in MeV b using the mid energy fit in the range
## 400 keV < E < 642 keV described in equation (3) of W.M. Nevins and R. Swain,
## Nuclear Fusion, 40, 865 (2000)
D0 = 330.
D1 = 66.1
D2 = -20.3
D5 = -1.58
## 400 keV < E < 668 keV described in equation (4) of A. Tentori and F. Belloni,
## Nuclear Fusion, 63, 086001 (2023)
D0 = 346.
D1 = 150.
D2 = -59.9
D5 = -0.460
E_400 = 400.
E_100 = 100.
E_norm = (E - E_400)/E_100
Expand All @@ -285,29 +285,29 @@ def astrophysical_factor_midE(E):
def astrophysical_factor_highE(E):
## E is in keV
## Returns astrophysical factor in MeV b using the high energy fit in the range
## 642 keV < E < 3500 keV described in equation (4) of W.M. Nevins and R. Swain,
## Nuclear Fusion, 40, 865 (2000)
A0 = 2.57e6
A1 = 5.67e5
A2 = 1.34e5
A3 = 5.68e5
E0 = 581.3
E1 = 1083.
E2 = 2405.
E3 = 3344.
dE0 = 85.7
dE1 = 234.
dE2 = 138.
dE3 = 309.
B = 4.38
## 668 keV < E < 9760 keV described in equation (5) of A. Tentori and F. Belloni,
## Nuclear Fusion, 63, 086001 (2023)
A0 = 1.98e6
A1 = 3.89e6
A2 = 1.36e6
A3 = 3.71e6
E0 = 640.9
E1 = 1211.
E2 = 2340.
E3 = 3294.
dE0 = 85.5
dE1 = 414.
dE2 = 221.
dE3 = 351.
B = 0.381
return A0/((E-E0)**2 + dE0**2) + A1/((E-E1)**2 + dE1**2) + \
A2/((E-E2)**2 + dE2**2) + A3/((E-E3)**2 + dE3**2) + B

def astrophysical_factor(E):
## E is in keV
## Returns astrophysical factor in MeV b using the fits described in W.M. Nevins
## and R. Swain, Nuclear Fusion, 40, 865 (2000)
conditions = [E <= 400, E <= 642, E > 642]
## Returns astrophysical factor in MeV b using the fits described in A. Tentori
## and F. Belloni, Nuclear Fusion, 63, 086001 (2023)
conditions = [E <= 400, E <= 668, E > 668]
choices = [astrophysical_factor_lowE(E),
astrophysical_factor_midE(E),
astrophysical_factor_highE(E)]
Expand All @@ -316,20 +316,20 @@ def astrophysical_factor(E):
def pb_cross_section_buck_fit(E):
## E is in MeV
## Returns cross section in b using a power law fit of the data presented in Buck et al.,
## Nuclear Physics A, 398(2), 189-202 (1983) in the range E > 3.5 MeV.
E_start_fit = 3.5
## Nuclear Physics A, 398(2), 189-202 (1983) in the range E > 9.76 MeV.
E_start_fit = 9.76
## Cross section at E = E_start_fit = 3.5 MeV
cross_section_start_fit = 0.2168440845211521
cross_section_start_fit = 0.01277998
slope_fit = -2.661840717596765
return cross_section_start_fit*(E/E_start_fit)**slope_fit

def pb_cross_section(E):
## E is in keV
## Returns cross section in b using the fits described in W.M. Nevins and R. Swain,
## Nuclear Fusion, 40, 865 (2000) for E < 3.5 MeV and a power law fit of the data presented in
## Buck et al., Nuclear Physics A, 398(2), 189-202 (1983) for E > 3.5 MeV.
## Returns cross section in b using the fits described in A. Tentori and F. Belloni,
## Nucl. Fusion, 63, 086001 (2023) for E < 9.76 MeV otherwise returns a power law fit
## of the data in Buck et al., Nuclear Physics A, 398(2), 189-202 (1983)
E_MeV = E/1.e3
conditions = [E <= 3500, E > 3500]
conditions = [E <= 9760, E > 9760]
choices = [astrophysical_factor(E)/E_MeV * np.exp(-np.sqrt(E_Gamow_MeV / E_MeV)),
pb_cross_section_buck_fit(E_MeV)]
return np.select(conditions, choices)
Expand Down Expand Up @@ -598,13 +598,13 @@ def check_xy_isotropy(data):
def sigmav_thermal_fit_lowE_nonresonant(T):
## Temperature T is in keV
## Returns the nonresonant average of cross section multiplied by relative velocity in m^3/s,
## in the range T <= 70 keV, as described by equation 9 of W.M. Nevins and R. Swain,
## Nuclear Fusion, 40, 865 (2000).
## in the range T <= 70 keV, as described by equations 10-14 of A. Tentori and F. Belloni,
## Nuclear Fusion, 63, 086001 (2023).
E0 = (E_Gamow_keV/4.)**(1./3.) * T**(2./3.)
DE0 = 4.*np.sqrt(T*E0/3.)
C0 = 197.*1.e3
C1 = 0.24*1.e3
C2 = 2.31e-4*1.e3
C1 = 0.269*1.e3
C2 = 2.54e-4*1.e3
tau = 3.*E0/T
Seff = C0*(1.+5./(12.*tau)) + C1*(E0+35./36.*T) + C2*(E0**2 + 89./36.*E0*T)
## nonresonant sigma times vrel, in barn meter per second
Expand All @@ -615,21 +615,21 @@ def sigmav_thermal_fit_lowE_nonresonant(T):
def sigmav_thermal_fit_lowE_resonant(T):
## Temperature T is in keV
## Returns the resonant average of cross section multiplied by relative velocity in m^3/s,
## in the range T <= 70 keV, as described by equation 11 of W.M. Nevins and R. Swain,
## Nuclear Fusion, 40, 865 (2000).
## in the range T <= 70 keV, as described by equation 15 of A. Tentori and F. Belloni,
## Nuclear Fusion, 63, 086001 (2023).
return 5.41e-21 * np.exp(-148./T) / T**(3./2.)

def sigmav_thermal_fit_lowE(T):
## Temperature T is in keV
## Returns the average of cross section multiplied by relative velocity in m^3/s, using the
## fits described in section 3.1 of W.M. Nevins and R. Swain, Nuclear Fusion, 40, 865 (2000).
## fits described in section 2.2 of A. Tentori and F. Belloni, Nuclear Fusion, 63, 086001 (2023).
## The fits are valid for T <= 70 keV.
return sigmav_thermal_fit_lowE_nonresonant(T) + sigmav_thermal_fit_lowE_resonant(T)

def expected_alpha_thermal(T, proton_density, boron_density, dV, dt):
## Computes the expected number of produced alpha particles when the protons and borons follow
## a Maxwellian distribution with a temperature T, in keV. This uses the thermal fits described
## in W.M. Nevins and R. Swain, Nuclear Fusion, 40, 865 (2000).
## in A. Tentori and F. Belloni, Nuclear Fusion, 63, 086001 (2023).

## The fit used here is only valid in the range T <= 70 keV.
assert((T >=0) and (T<=70))
Expand Down
8 changes: 8 additions & 0 deletions Examples/Tests/scraping/analysis_rz.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ def n_scraped_particles( iteration ):
n_total = n_remaining[0]
assert np.all( n_scraped+n_remaining == n_total)

# Check that the particle IDs match between the initial iteration
# (all particles in the simulation domain) and the finall iteration (particles are either scraped or still in simulation box)
id_initial, = ts_full.get_particle(['id'], iteration=0)
id_final_scrape, = ts_scraping.get_particle(['id'], iteration=ts_scraping.iterations[0])
id_final_box, = ts_full.get_particle(['id'], iteration=ts_full.iterations[-1])
id_final = np.concatenate( (id_final_scrape, id_final_box))
assert np.all( np.sort(id_initial) == np.sort(id_final) ) # Sort because particles may not be in the same order

# Checksum test
test_name = os.path.split(os.getcwd())[1]
checksumAPI.evaluate_checksum(test_name, fn, do_particles=False)
60 changes: 44 additions & 16 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
WarpX Copyright (c) 2018, The Regents of the University of California, through Lawrence Berkeley National Laboratory, and Lawrence Livermore National Security, LLC, for the operation of Lawrence Livermore National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.


Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:


(1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

(3) Neither the name of the University of California, Lawrence Berkeley National Laboratory, Lawrence Livermore National Security, LLC, Lawrence Livermore National Laboratory, U.S. Dept. of Energy, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to Lawrence Berkeley National Laboratory, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form.
WarpX Copyright (c) 2018, The Regents of the University of California,
through Lawrence Berkeley National Laboratory, and Lawrence Livermore National
Security, LLC, for the operation of Lawrence Livermore National Laboratory
(subject to receipt of any required approvals from the U.S. Dept. of Energy).
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

(1) Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

(2) Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

(3) Neither the name of the University of California, Lawrence Berkeley
National Laboratory, U.S. Dept. of Energy nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.


THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

You are under no obligation whatsoever to provide any bug fixes, patches,
or upgrades to the features, functionality or performance of the source
code ("Enhancements") to anyone; however, if you choose to make your
Enhancements available either publicly, or directly to Lawrence Berkeley
National Laboratory, without imposing a separate written license agreement
for such Enhancements, then you hereby grant the following license: a
non-exclusive, royalty-free perpetual license to install, use, modify,
prepare derivative works, incorporate into other computer software,
distribute, and sublicense such enhancements or derivative works thereof,
in binary and source code form.
2 changes: 1 addition & 1 deletion Python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
package_data = {}

setup(name = 'pywarpx',
version = '24.04',
version = '24.05',
packages = ['pywarpx'],
package_dir = {'pywarpx': 'pywarpx'},
description = """Wrapper of WarpX""",
Expand Down
Loading

0 comments on commit b32cdab

Please sign in to comment.