Skip to content

Commit

Permalink
Merge branch 'development' into add_analysis_embedded_boundary_remova…
Browse files Browse the repository at this point in the history
…l_depth
  • Loading branch information
RemiLehe committed Nov 7, 2024
2 parents 66b029e + 3d68665 commit 901bc6d
Show file tree
Hide file tree
Showing 59 changed files with 1,912 additions and 221 deletions.
33 changes: 22 additions & 11 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
displayName: Cache Python Libraries

- bash: |
set -eu -o pipefail
set -o nounset errexit pipefail
cat /proc/cpuinfo | grep "model name" | sort -u
df -h
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries
Expand Down Expand Up @@ -146,25 +146,36 @@ jobs:
displayName: 'Install dependencies'
- bash: |
set -eu -o pipefail
# set options
set -o nounset errexit pipefail
# display disk space usage
df -h
# configure
export AMReX_CMAKE_FLAGS="-DAMReX_ASSERTIONS=ON -DAMReX_TESTING=ON"
cmake -S . -B build \
${AMReX_CMAKE_FLAGS} \
${WARPX_CMAKE_FLAGS} \
-DWarpX_TEST_CLEANUP=ON \
-DWarpX_TEST_FPETRAP=ON
export WARPX_TEST_FLAGS="-DWarpX_TEST_CLEANUP=ON -DWarpX_TEST_FPETRAP=ON -DWarpX_TEST_DEBUG=ON"
cmake -S . -B build \
${AMReX_CMAKE_FLAGS} \
${WARPX_CMAKE_FLAGS} \
${WARPX_TEST_FLAGS}
# build
cmake --build build -j 2
# display disk space usage
df -h
displayName: 'Build'
- bash: |
set -eu -o pipefail
# set options
set -o nounset errexit pipefail
# run tests (exclude pytest.AMReX when running Python tests)
ctest --test-dir build --output-on-failure -E AMReX
displayName: 'Test'
- bash: |
# set options
set -o nounset errexit pipefail
# find and print backtrace
find build/bin/ -type f -name "Backtrace*" \
-exec echo -e "\nBacktrace\n---------\n{}\n---------" \; \
-exec cat {} \;
displayName: 'Logs'
condition: always()
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: Bug report
about: Report a bug or unexpected behavior.
labels: [bug]
---

_Please remove any sensitive information (e.g., passwords, API keys) from your submission.
Please check the relevant boxes and fill in the specific versions or details for the relevant items.
Thank you for taking the time to report this issue. We will respond as soon as possible._

## Description
A clear and concise description of the bug.

## Expected behavior
What did you expect to happen when you encountered the issue?

## How to reproduce
Please provide (if available):
- WarpX inputs files
- PICMI Python files
- Python post-processing scripts

If you are unable to provide certain files or scripts, please describe the steps you took to encounter the issue.

Please minimize your inputs/scripts to be concise and focused on the issue.
For instance, make the simulation scripts as small and fast to run as possible.

## System information
Please check all relevant boxes and provide details.

- Operating system (name and version):
- [ ] Linux: e.g., Ubuntu 22.04 LTS
- [ ] macOS: e.g., macOS Monterey 12.4
- [ ] Windows: e.g., Windows 11 Pro
- Version of WarpX: e.g., latest, 24.10, etc.
- Installation method:
- [ ] Conda
- [ ] Spack
- [ ] PyPI
- [ ] Brew
- [ ] From source with CMake
- [ ] Module system on an HPC cluster
- Other dependencies: yes/no, describe
- Computational resources:
- [ ] MPI: e.g., 2 MPI processes
- [ ] OpenMP: e.g., 2 OpenMP threads
- [ ] CPU: e.g., 2 CPUs
- [ ] GPU: e.g., 2 GPUs (NVIDIA, AMD, etc.)

If you encountered the issue on an HPC cluster, please check our [HPC documentation](https://warpx.readthedocs.io/en/latest/install/hpc.html) to see if your HPC cluster is already supported.

## Steps taken so far
What troubleshooting steps have you taken so far, and what were the results?

Have you tried debugging the code, following the instructions in our [debugging documentation](https://warpx.readthedocs.io/en/latest/usage/workflows/debugging.html)?

## Additional information
If applicable, please add any additional information that may help explain the issue, such as log files (e.g., build logs, error logs, etc.), error messages (e.g., compiler errors, runtime errors, etc.), screenshots, or other relevant details.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Feature request
about: Suggest a new feature or enhancement.
labels: [enhancement]
---

_Please remove any sensitive information (e.g., passwords, API keys) from your submission.
Please check the relevant boxes and fill in the specific versions or details for the relevant items.
Thank you for taking the time to report this issue. We will respond as soon as possible._

## Context and motivation
Please provide a clear and concise description of the context that is prompting you to request a new feature. What problem are you trying to solve, and how will this feature help you achieve your goals?

## Proposed feature
Describe the feature you would like to add to WarpX in detail. Please include:
- A clear and concise description of the feature
- Any relevant technical requirements or specifications
- How you envision the feature being used

## Alternative solutions
Have you considered any alternative solutions or features that could achieve the same goal? If so, please describe them and explain why you believe the proposed feature is the best solution.

## Additional information
If applicable, please provide any additional information that may be relevant to the feature request, such as:
- Links to existing codes or implementations
- References to relevant publications or research
- Any specific use cases or scenarios where the feature would be particularly useful
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/installation-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Installation issue
about: Report an issue with installing or setting up WarpX.
labels: [install]
---

_Please remove any sensitive information (e.g., passwords, API keys) from your submission.
Please check the relevant boxes and fill in the specific versions or details for the relevant items.
Thank you for taking the time to report this issue. We will respond as soon as possible._

## Description
A clear and concise description of the issue.

## System information
- Operating system (name and version):
- [ ] Linux: e.g., Ubuntu 22.04 LTS
- [ ] macOS: e.g., macOS Monterey 12.4
- [ ] Windows: e.g., Windows 11 Pro
- Version of WarpX: e.g., latest, 24.10, etc.
- Installation method:
- [ ] Conda
- [ ] Spack
- [ ] PyPI
- [ ] Brew
- [ ] From source with CMake
- [ ] Module system on an HPC cluster
- Other dependencies: yes/no, describe
- Computational resources:
- [ ] CPU
- [ ] GPU: e.g., NVIDIA, AMD, etc.

If you encountered the issue on an HPC cluster, please check our [HPC documentation](https://warpx.readthedocs.io/en/latest/install/hpc.html) to see if your HPC cluster is already supported.

If you encountered the issue installing from source with CMake, please provide the output of the following steps:
1. buildsystem generation: output of `cmake --fresh -S . -B build` (include your specific build options, e.g., `-DWarpX_DIMS=3`)
2. project build: output of `cmake --build build` (include your specific build options, e.g., `-j 4`)

If applicable, please add any additional information about your software environment:
- [ ] CMake: e.g., 3.24.0
- [ ] C++ compiler: e.g., GNU 11.3 with NVCC 12.0.76
- [ ] Python: e.g., CPython 3.12
- [ ] MPI: e.g., OpenMPI 4.1.1
- [ ] FFTW: e.g., 3.3.10
- [ ] HDF5: e.g., 1.14.0
- [ ] ADIOS2: e.g., 2.10.0
- Other dependencies: yes/no, describe

## Additional information
If applicable, please add any additional information that may help explain the issue, such as log files (e.g., build logs, error logs, etc.), error messages (e.g., compiler errors, runtime errors, etc.), screenshots, or other relevant details.
2 changes: 1 addition & 1 deletion .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
which nvcc || echo "nvcc not in PATH!"
git clone https://github.com/AMReX-Codes/amrex.git ../amrex
cd ../amrex && git checkout --detach 92679babfc2cc66ca06ee591a80001db57c89878 && cd -
cd ../amrex && git checkout --detach 24.11 && 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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ repos:
# Python: Ruff linter & formatter
# https://docs.astral.sh/ruff/
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.1
rev: v0.7.2
hooks:
# Run the linter
- id: ruff
Expand Down
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Preamble ####################################################################
#
cmake_minimum_required(VERSION 3.24.0)
project(WarpX VERSION 24.10)
project(WarpX VERSION 24.11)

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

Expand Down Expand Up @@ -90,6 +90,13 @@ mark_as_advanced(WarpX_TEST_CLEANUP)
option(WarpX_TEST_FPETRAP "Run CI tests with FPE-trapping runtime parameters" OFF)
mark_as_advanced(WarpX_TEST_FPETRAP)

# Advanced option to run CI tests with the -g compile option
option(WarpX_TEST_DEBUG "Run CI tests with the -g compile option" OFF)
mark_as_advanced(WarpX_TEST_DEBUG)
if(WarpX_TEST_DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g1")
endif()

set(WarpX_DIMS_VALUES 1 2 3 RZ)
set(WarpX_DIMS 3 CACHE STRING "Simulation dimensionality <1;2;3;RZ>")
list(REMOVE_DUPLICATES WarpX_DIMS)
Expand Down
4 changes: 2 additions & 2 deletions Docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ def __init__(self, *args, **kwargs):
# built documents.
#
# The short X.Y version.
version = "24.10"
version = "24.11"
# The full version, including alpha/beta/rc tags.
release = "24.10"
release = "24.11"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
5 changes: 5 additions & 0 deletions Docs/source/highlights.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ Please see :ref:`this section <acknowledge_warpx_all_refs>`.
Nuclear Fusion and Plasma Confinement
*************************************

#. Scheffel J. and Jäderberg J. and Bendtz K. and Holmberg R. and Lindvall K.,
**Axial Confinement in the Novatron Mirror Machine**.
arXiv 2410.20134
`DOI:10.48550/arXiv.2410.20134 <https://doi.org/10.48550/arXiv.2410.20134>`__

#. Affolter M., Thompson R., Hepner S., Hayes E. C., Podolsky V., Borghei M., Carlsson J., Gargone A., Merthe D., McKee E., Langtry R.,
**The Orbitron: A crossed-field device for co-confinement of high energy ions and electrons**.
AIP Advances **14**, 085025, 2024.
Expand Down
31 changes: 31 additions & 0 deletions Docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,37 @@ Domain Boundary Conditions

* ``pec``: This option can be used to set a Perfect Electric Conductor at the simulation boundary. Please see the :ref:`PEC theory section <theory-bc-pec>` for more details. Note that PEC boundary is invalid at `r=0` for the RZ solver. Please use ``none`` option. This boundary condition does not work with the spectral solver.

* ``pec_insulator``: This option specifies a mixed perfect electric conductor and insulator boundary, where some part of the
boundary is PEC and some is insulator. In the insulator portion, the normal fields are extrapolated and the tangential fields
are either set to the specified value or extrapolated. The region that is insulator is specified using a spatially dependent expression with the insulator being in the area where the value of the expression is greater than zero.
The expressions are given for the low and high boundary on each axis, as listed below. The tangential fields are specified as
expressions that can depend on the location and time. The tangential fields are in two pairs, the electric fields and the
magnetic fields. In each pair, if one is specified, the other will be set to zero if not also specified.

* ``insulator.area_x_lo(y,z)``: For the lower x (or r) boundary, expression specifying the insulator location

* ``insulator.area_x_hi(y,z)``: For the upper x (or r) boundary, expression specifying the insulator location

* ``insulator.area_y_lo(x,z)``: For the lower y boundary, expression specifying the insulator location

* ``insulator.area_y_hi(x,z)``: For the upper y boundary, expression specifying the insulator location

* ``insulator.area_z_lo(x,y)``: For the lower z boundary, expression specifying the insulator location

* ``insulator.area_z_hi(x,y)``: For the upper z boundary, expression specifying the insulator location

* ``insulator.Ey_x_lo(y,z,t)``, ``insulator.Ez_x_lo(y,z,t)``, ``insulator.By_x_lo(y,z,t)``, ``insulator.Bz_x_lo(y,z,t)``: expressions of the tangential field values for the lower x (or r) boundary

* ``insulator.Ey_x_hi(y,z,t)``, ``insulator.Ez_x_hi(y,z,t)``, ``insulator.By_x_hi(y,z,t)``, ``insulator.Bz_x_hi(y,z,t)``: expressions of the tangential field values for the upper x (or r) boundary

* ``insulator.Ex_y_lo(x,z,t)``, ``insulator.Ez_y_lo(x,z,t)``, ``insulator.Bx_y_lo(x,z,t)``, ``insulator.Bz_y_lo(x,z,t)``: expressions of the tangential field values for the lower y boundary

* ``insulator.Ex_y_hi(x,z,t)``, ``insulator.Ez_y_hi(x,z,t)``, ``insulator.Bx_y_hi(x,z,t)``, ``insulator.Bz_y_hi(x,z,t)``: expressions of the tangential field values for the upper y boundary

* ``insulator.Ex_z_lo(x,y,t)``, ``insulator.Ey_z_lo(x,y,t)``, ``insulator.Bx_z_lo(x,y,t)``, ``insulator.By_z_lo(x,y,t)``: expressions of the tangential field values for the lower z boundary

* ``insulator.Ex_z_hi(x,y,t)``, ``insulator.Ey_z_hi(x,y,t)``, ``insulator.Bx_z_hi(x,y,t)``, ``insulator.By_z_hi(x,y,t)``: expressions of the tangential field values for the upper z boundary

* ``none``: No boundary condition is applied to the fields with the electromagnetic solver. This option must be used for the RZ-solver at `r=0`.

* ``neumann``: For the electrostatic multigrid solver, a Neumann boundary condition (with gradient of the potential equal to 0) will be applied on the specified boundary.
Expand Down
2 changes: 1 addition & 1 deletion Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function(add_warpx_test
if(WarpX_TEST_CLEANUP)
add_test(
NAME ${name}.cleanup
COMMAND ${CMAKE_COMMAND} -E rm -rf ${THIS_WORKING_DIR}
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/Examples/test_cleanup.cmake ${THIS_WORKING_DIR}
)
# test cleanup depends on test run
set_property(TEST ${name}.cleanup APPEND PROPERTY DEPENDS "${name}.run")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
fn = sys.argv[1]
ds = yt.load(fn)
ad = ds.all_data()
t_max = ds.current_time.item() # time of simulation
t_inj = 0.5e-8 # duration for which the flux injection was active

# Extract the dimensionality of the simulation
with open("./warpx_used_inputs", "r") as f:
Expand All @@ -52,7 +52,7 @@
emission_surface = 4 * np.pi * R**2 # in m^2
elif dims == "2D":
emission_surface = 2 * np.pi * R # in m
Ntot = flux * emission_surface * t_max
Ntot = flux * emission_surface * t_inj

# Parameters of the histogram
hist_bins = 50
Expand Down
2 changes: 2 additions & 0 deletions Examples/Tests/flux_injection/inputs_base_from_eb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ electron.inject_from_embedded_boundary = 1
electron.num_particles_per_cell = 100
electron.flux_profile = parse_flux_function
electron.flux_function(x,y,z,t) = "1."
electron.flux_tmin = 0.25e-8
electron.flux_tmax = 0.75e-8
electron.momentum_distribution_type = gaussianflux
electron.ux_th = 0.01
electron.uy_th = 0.01
Expand Down
10 changes: 10 additions & 0 deletions Examples/Tests/pec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,13 @@ add_warpx_test(
diags/diag1000020 # output
OFF # dependency
)

add_warpx_test(
test_2d_pec_field_insulator # name
2 # dims
2 # nprocs
inputs_test_2d_pec_field_insulator # inputs
analysis_default_regression.py # analysis
diags/diag1000010 # output
OFF # dependency
)
34 changes: 34 additions & 0 deletions Examples/Tests/pec/inputs_test_2d_pec_field_insulator
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Maximum number of time steps
max_step = 10

# number of grid points
amr.n_cell = 32 32
amr.blocking_factor = 16

# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
amr.max_level = 0

# Geometry
geometry.dims = 2
geometry.prob_lo = 0. 2.e-2 # physical domain
geometry.prob_hi = 1.e-2 3.e-2

# Boundary condition
boundary.field_lo = neumann periodic
boundary.field_hi = PECInsulator periodic

warpx.serialize_initial_conditions = 1

# Verbosity
warpx.verbose = 1

# CFL
warpx.cfl = 1.0

insulator.area_x_hi(y,z) = (2.25e-2 <= z and z <= 2.75e-2)
insulator.By_x_hi(y,z,t) = min(t/1.0e-12,1)*1.e1*3.3e-4

# Diagnostics
diagnostics.diags_names = diag1
diag1.intervals = 10
diag1.diag_type = Full
7 changes: 7 additions & 0 deletions Examples/test_cleanup.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# delete all test files except backtrace
file(GLOB test_files ${CMAKE_ARGV3}/*)
foreach(file ${test_files})
if(NOT ${file} MATCHES "Backtrace*")
execute_process(COMMAND ${CMAKE_COMMAND} -E rm -r ${file})
endif()
endforeach()
Loading

0 comments on commit 901bc6d

Please sign in to comment.