diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index fa14902283c..6e9884966fe 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -9,6 +9,7 @@ pr: jobs: - job: + # FIXME remove unused variables variables: BLASPP_HOME: '/usr/local' CEI_SUDO: 'sudo' @@ -16,30 +17,33 @@ jobs: CMAKE_GENERATOR: 'Ninja' FFTW_HOME: '/usr' LAPACKPP_HOME: '/usr/local' - OMP_NUM_THREADS: 1 WARPX_CI_CCACHE: 'TRUE' - WARPX_CI_CLEAN_TESTS: 'TRUE' - WARPX_CI_NUM_MAKE_JOBS: 2 - WARPX_CI_OPENPMD: 'TRUE' - WARPX_CI_TMP: '/tmp/ci' + #WARPX_OPENPMD: 'TRUE' strategy: matrix: - cartesian1d: - WARPX_CI_REGULAR_CARTESIAN_1D: 'TRUE' - WARPX_CI_PSATD: 'FALSE' - cartesian2d: - WARPX_CI_REGULAR_CARTESIAN_2D: 'TRUE' - cartesian3d: - WARPX_CI_REGULAR_CARTESIAN_3D: 'TRUE' - single_precision: - WARPX_CI_SINGLE_PRECISION: 'TRUE' - rz_or_nompi: - WARPX_CI_RZ_OR_NOMPI: 'TRUE' - qed: - WARPX_CI_QED: 'TRUE' - embedded_boundary: - WARPX_CI_EB: 'TRUE' + # Cartesian 1D + cartesian_1d: + WARPX_CMAKE_FLAGS: -DWarpX_DIMS=1 -DWarpX_FFT=ON -DWarpX_PYTHON=ON + # Cartesian 2D + cartesian_2d: + WARPX_CMAKE_FLAGS: -DWarpX_DIMS=2 -DWarpX_FFT=ON -DWarpX_PYTHON=ON + # Cartesian 3D + cartesian_3d: + WARPX_CMAKE_FLAGS: -DWarpX_DIMS=3 -DWarpX_FFT=ON -DWarpX_PYTHON=ON + WARPX_HEFFTE: 'TRUE' + # Cylindrical RZ + cylindrical_rz: + WARPX_CMAKE_FLAGS: -DWarpX_DIMS=RZ -DWarpX_FFT=ON -DWarpX_PYTHON=ON + WARPX_RZ_FFT: 'TRUE' + # embedded boundaries + embedded_boundaries: + WARPX_CMAKE_FLAGS: -DWarpX_DIMS='1;2;3;RZ' -DWarpX_FFT=ON -DWarpX_PYTHON=ON -DWarpX_EB=ON + WARPX_RZ_FFT: 'TRUE' + # single precision + #single_precision: + # WARPX_CMAKE_FLAGS: -DWarpX_DIMS='1;2;3;RZ' -DWarpX_FFT=ON -DWarpX_PYTHON=ON -DWarpX_PRECISION=SINGLE + # WARPX_RZ_FFT: 'TRUE' # default: 60; maximum: 360 timeoutInMinutes: 240 @@ -51,9 +55,8 @@ jobs: - task: Cache@2 continueOnError: true inputs: - key: 'Ccache | "$(System.JobName)" | .azure-pipelines.yml | cmake/dependencies/AMReX.cmake | run_test.sh' + key: 'Ccache | "$(System.JobName)" | .azure-pipelines.yml | cmake/dependencies/AMReX.cmake' restoreKeys: | - Ccache | "$(System.JobName)" | .azure-pipelines.yml | cmake/dependencies/AMReX.cmake | run_test.sh Ccache | "$(System.JobName)" | .azure-pipelines.yml | cmake/dependencies/AMReX.cmake Ccache | "$(System.JobName)" | .azure-pipelines.yml path: /home/vsts/.ccache @@ -63,9 +66,8 @@ jobs: - task: Cache@2 continueOnError: true inputs: - key: 'Python3 | "$(System.JobName)" | .azure-pipelines.yml | run_test.sh' + key: 'Python3 | "$(System.JobName)" | .azure-pipelines.yml' restoreKeys: | - Python3 | "$(System.JobName)" | .azure-pipelines.yml | run_test.sh Python3 | "$(System.JobName)" | .azure-pipelines.yml path: /home/vsts/.local/lib/python3.8 cacheHitVar: PYTHON38_CACHE_RESTORED @@ -83,6 +85,8 @@ jobs: python3 python3-pandas python3-pip python3-venv python3-setuptools libblas-dev liblapack-dev ccache --set-config=max_size=10.0G python3 -m pip install --upgrade pip + python3 -m pip install --upgrade build + python3 -m pip install --upgrade packaging python3 -m pip install --upgrade setuptools python3 -m pip install --upgrade wheel python3 -m pip install --upgrade virtualenv @@ -92,25 +96,29 @@ jobs: export PATH="$HOME/.local/bin:$PATH" sudo curl -L -o /usr/local/bin/cmake-easyinstall https://raw.githubusercontent.com/ax3l/cmake-easyinstall/main/cmake-easyinstall sudo chmod a+x /usr/local/bin/cmake-easyinstall - if [ "${WARPX_CI_OPENPMD:-FALSE}" == "TRUE" ]; then - cmake-easyinstall --prefix=/usr/local \ - git+https://github.com/openPMD/openPMD-api.git@0.14.3 \ - -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DopenPMD_USE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI_TOOLS=OFF - python3 -m pip install --upgrade openpmd-api - fi - if [[ "${WARPX_CI_RZ_OR_NOMPI:-FALSE}" == "TRUE" ]]; then - cmake-easyinstall --prefix=/usr/local git+https://github.com/icl-utk-edu/blaspp.git \ + #if [ "${WARPX_OPENPMD:-FALSE}" == "TRUE" ]; then + # cmake-easyinstall --prefix=/usr/local \ + # git+https://github.com/openPMD/openPMD-api.git@0.14.3 \ + # -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \ + # -DCMAKE_VERBOSE_MAKEFILE=ON \ + # -DopenPMD_USE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI_TOOLS=OFF + # #python3 -m pip install --upgrade openpmd-api + #fi + if [ "${WARPX_RZ_FFT:-FALSE}" == "TRUE" ]; then + # BLAS++ + cmake-easyinstall --prefix=/usr/local \ + git+https://github.com/icl-utk-edu/blaspp.git \ -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \ -DCMAKE_CXX_STANDARD=17 \ -Duse_openmp=OFF -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON - cmake-easyinstall --prefix=/usr/local git+https://github.com/icl-utk-edu/lapackpp.git \ - -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \ - -DCMAKE_CXX_STANDARD=17 \ + # LAPACK++ + cmake-easyinstall --prefix=/usr/local \ + git+https://github.com/icl-utk-edu/lapackpp.git \ + -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \ + -DCMAKE_CXX_STANDARD=17 \ -Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON fi - if [[ "${WARPX_CI_REGULAR_CARTESIAN_3D:-FALSE}" == "TRUE" ]]; then + if [ "${WARPX_HEFFTE:-FALSE}" == "TRUE" ]; then cmake-easyinstall --prefix=/usr/local git+https://github.com/icl-utk-edu/heffte.git@v2.4.0 \ -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \ -DCMAKE_CXX_STANDARD=17 -DHeffte_ENABLE_DOXYGEN=OFF \ @@ -121,6 +129,15 @@ jobs: -DHeffte_ENABLE_MAGMA=OFF \ -DCMAKE_VERBOSE_MAKEFILE=ON fi + # Python modules required for test analysis + python3 -m pip install --upgrade -r Regression/requirements.txt + python3 -m pip cache purge + # external repositories required for test analysis + cd .. + git clone --depth 1 https://github.com/ECP-WarpX/warpx-data.git + # TODO select only specific datasets? + git clone --depth 1 https://github.com/openPMD/openPMD-example-datasets.git + cd - rm -rf ${CEI_TMP} df -h displayName: 'Install dependencies' @@ -128,7 +145,23 @@ jobs: - bash: | set -eu -o pipefail df -h - ./run_test.sh - rm -rf ${WARPX_CI_TMP} + + # 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 + + # build + cmake --build build -j 2 df -h - displayName: 'Build & test' + displayName: 'Build' + + - bash: | + set -eu -o pipefail + + # run tests (exclude pytest.AMReX when running Python tests) + ctest --test-dir build --output-on-failure -E AMReX + displayName: 'Test' diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index 8efcdc9a431..119a893eb72 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -68,10 +68,10 @@ jobs: #MPI implementations often leak memory export "ASAN_OPTIONS=detect_leaks=0" - mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_rz - mpirun -n 2 ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_1d - mpirun -n 2 ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_2d - mpirun -n 2 ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_3d + mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz + mpirun -n 2 ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration + mpirun -n 2 ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_base_2d + mpirun -n 2 ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_base_3d build_thread_sanitizer: name: Clang thread sanitizer @@ -149,14 +149,14 @@ jobs: export OMP_NUM_THREADS=2 - mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_rz warpx.serialize_initial_conditions = 0 - mpirun -n 2 ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_1d warpx.serialize_initial_conditions = 0 - mpirun -n 2 ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_2d warpx.serialize_initial_conditions = 0 - mpirun -n 2 ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_3d warpx.serialize_initial_conditions = 0 + mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz warpx.serialize_initial_conditions = 0 + mpirun -n 2 ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration warpx.serialize_initial_conditions = 0 + mpirun -n 2 ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_base_2d warpx.serialize_initial_conditions = 0 + mpirun -n 2 ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_base_3d warpx.serialize_initial_conditions = 0 git clone https://github.com/ECP-WarpX/warpx-data ../warpx-data cd Examples/Tests/embedded_circle ulimit -c unlimited - mpirun -n 2 ../../../build_EB/bin/warpx.2d inputs_2d warpx.serialize_initial_conditions = 0 + mpirun -n 2 ../../../build_EB/bin/warpx.2d inputs_test_2d_embedded_circle warpx.serialize_initial_conditions = 0 diff --git a/.github/workflows/insitu.yml b/.github/workflows/insitu.yml index d6184e64d28..be93dfb9beb 100644 --- a/.github/workflows/insitu.yml +++ b/.github/workflows/insitu.yml @@ -58,10 +58,10 @@ jobs: cmake --build build -j 4 - name: Test run: | - cp Examples/Physics_applications/laser_acceleration/inputs_3d . + cp Examples/Physics_applications/laser_acceleration/inputs_base_3d . cp Examples/Physics_applications/laser_acceleration/3d_ascent_actions.yaml ascent_actions.yaml mpiexec -n 2 ./build/bin/warpx.3d \ - inputs_3d \ + inputs_base_3d \ max_step = 40 \ diag1.intervals = 30:40:10 \ diag1.format = ascent @@ -101,10 +101,10 @@ jobs: cmake --build build -j 10 - name: 2D Test run: | - cp Examples/Tests/ionization/inputs_2d_rt . + cp Examples/Tests/ionization/inputs_test_2d_ionization_lab . cp Examples/Tests/ionization/catalyst_pipeline.py . mpiexec -n 2 ./build/bin/warpx.2d \ - inputs_2d_rt \ + inputs_test_2d_ionization_lab \ catalyst.script_paths = catalyst_pipeline.py\ catalyst.implementation = paraview\ diag1.intervals = 16\ @@ -112,15 +112,15 @@ jobs: diag1.format = catalyst - name: 3D Test run: | - cp Examples/Tests/electrostatic_sphere/inputs_3d . + cp Examples/Tests/electrostatic_sphere/inputs_base_3d . cp Examples/Tests/electrostatic_sphere/catalyst_pipeline.py . mpiexec -n 2 ./build/bin/warpx.3d \ - inputs_3d \ - catalyst.script_paths = catalyst_pipeline.py \ - catalyst.implementation = paraview \ - diagnostics.diags_names = diag1 \ - diag1.format = catalyst\ - diag1.intervals = 3 + inputs_base_3d \ + catalyst.script_paths = catalyst_pipeline.py \ + catalyst.implementation = paraview \ + diagnostics.diags_names = diag1 \ + diag1.format = catalyst\ + diag1.intervals = 3 - uses: actions/upload-artifact@v4 with: name: catalyst-test-artifacts diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 485a5229c6a..4d0b9ebe9c6 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -132,7 +132,7 @@ jobs: source /opt/intel/oneapi/setvars.sh set -e export OMP_NUM_THREADS=2 - Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py + Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py build_dpcc: name: oneAPI DPC++ SP diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 124d26fa7f7..596920a3911 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -84,4 +84,4 @@ jobs: source py-venv/bin/activate export OMP_NUM_THREADS=1 - mpirun -n 2 Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py + mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py diff --git a/.github/workflows/scripts/checkQEDTableGenerator.sh b/.github/workflows/scripts/checkQEDTableGenerator.sh index e14a7a2d6f2..a773015c6c7 100755 --- a/.github/workflows/scripts/checkQEDTableGenerator.sh +++ b/.github/workflows/scripts/checkQEDTableGenerator.sh @@ -29,7 +29,7 @@ export OMP_NUM_THREADS=2 # Generate QED lookup tables using WarpX # ./build/bin/warpx.2d \ - ./Examples/Tests/qed/quantum_synchrotron/inputs_2d \ + ./Examples/Tests/qed/inputs_test_2d_qed_quantum_sync \ qed_bw.lookup_table_mode = "generate" \ qed_bw.tab_dndt_chi_min = 0.01 \ qed_bw.tab_dndt_chi_max = 100.0 \ @@ -70,7 +70,7 @@ diff qs_table_dndt qs_table_tool_dndt # Run a WarpX simulation using the lookup tables generated by the external tool # ./build/bin/warpx.2d \ - ./Examples/Tests/qed/quantum_synchrotron/inputs_2d \ + ./Examples/Tests/qed/inputs_test_2d_qed_quantum_sync \ qed_bw.lookup_table_mode = "load" \ qed_bw.load_table_from = "bw_table_tool" \ qed_qs.lookup_table_mode = "load" \ diff --git a/.github/workflows/source.yml b/.github/workflows/source.yml index a1c29416b3e..143be1971fb 100644 --- a/.github/workflows/source.yml +++ b/.github/workflows/source.yml @@ -25,10 +25,8 @@ jobs: run: .github/workflows/source/hasTabs - name: End-of-Line whitespaces run: .github/workflows/source/hasEOLwhiteSpace - - name: Proper file names in Examples - run: .github/workflows/source/wrongFileNameInExamples - - name: Examples are tested - run: .github/workflows/source/inputsNotTested + - name: Check test input files + run: .github/workflows/source/check_inputs.py - name: Check that the test matrix for CI includes all tests run: .github/workflows/source/test_ci_matrix.sh - name: Doxygen diff --git a/.github/workflows/source/check_inputs.py b/.github/workflows/source/check_inputs.py new file mode 100755 index 00000000000..3cb2d8f735e --- /dev/null +++ b/.github/workflows/source/check_inputs.py @@ -0,0 +1,109 @@ +#! /usr/bin/env python3 + +import os +import re +import sys + +# mandatory prefixes for test names +testname_prefix = ["test_1d_", "test_2d_", "test_3d_", "test_rz_"] + +# collect all test names and test input filenames from CMakeLists.txt files +tests = [] +# walk through all files under Examples/, including subdirectories +for dirpath, dirnames, filenames in os.walk(top="./Examples"): + # loop over CMakeLists.txt files + for name in [filename for filename in filenames if filename == "CMakeLists.txt"]: + filepath = os.path.join(dirpath, name) + # open CMakeLists.txt file + with open(filepath) as f: + # loop over lines of CMakeLists.txt + for line in f: + # strip leading whitespaces + line = line.lstrip() + # find lines where 'add_warpx_test' is called + if re.match("add_warpx_test", line): + # strip leading whitespaces, remove end-of-line comments + testname = next(f).lstrip().split(" ")[0] + # skip lines related to other function arguments + # NOTE: update range call to reflect changes + # in the interface of 'add_warpx_test' + for _ in range(3): + next(f) + # strip leading whitespaces, remove end-of-line comments + testinput = next(f).lstrip().split(" ")[0] + # some Python input scripts are quoted + # to account for command-line arguments: + # strip initial quotation mark from string + if testinput.startswith('"'): + testinput = re.sub('"', "", testinput) + # extract filename from path + testinput = os.path.split(testinput)[1] + tests.append( + {"name": testname, "input": testinput, "path": filepath} + ) + +# check consistency of test names and test input filenames +print("\nCheck that test names and input names are correct...") +wrong_testname = False +wrong_testinput = False +for test in tests: + testname = test["name"].rstrip() + testinput = test["input"].rstrip() + testpath = test["path"].rstrip() + if not testname.startswith(tuple(testname_prefix)): + print(f"Wrong test name: {testname}") + print(f"(from {testpath})") + wrong_testname = True + # PICMI tests + if "picmi" in testname: + if not testname.endswith("_picmi") and not testname.endswith("_picmi_restart"): + print(f"Wrong test name: {testname}") + print(f"(from {testpath})") + wrong_testname = True + # restart tests + if "restart" in testname: + if not testname.endswith("_restart"): + print(f"Wrong test name: {testname}") + print(f"(from {testpath})") + wrong_testname = True + # test input file names + if ( + not testinput == f"inputs_{testname}" + and not testinput == f"inputs_{testname}.py" + ): + # we may be running a base input file/script or a restart PICMI test + if not testinput.startswith("inputs_base") and not testinput.endswith( + "_picmi.py" + ): + print(f"Wrong input name: {testinput}") + print(f"(from {testpath})") + wrong_testinput = True + +if wrong_testname: + print(f"NOTE: Test names must start with one of {testname_prefix}.") + print(" Test names must end with '_restart' for restart tests.") + print(" Test names must end with '_picmi' for PICMI tests.") +if wrong_testinput: + print("NOTE: Test input names must start with 'inputs_' followed by the test name.") + print(" Test input names must end with '.py' for PICMI tests.") + +# check that all input files in Examples/ are tested +print("\nCheck that all test input files are tested...") +missing_input = False +# walk through all files under Examples/, including subdirectories +for dirpath, dirnames, filenames in os.walk(top="./Examples"): + # loop over files starting with "inputs_test_" + for name in [ + filename for filename in filenames if filename.startswith("inputs_test_") + ]: + if name not in [test["input"] for test in tests]: + print(f"Input not tested: {os.path.join(dirpath, name)}") + missing_input = True + +if missing_input: + print("NOTE: All test input files must be tested.\n") +else: + print() + +if wrong_testname or wrong_testinput or missing_input: + sys.exit("FAILED\n") diff --git a/.github/workflows/source/inputsNotTested b/.github/workflows/source/inputsNotTested deleted file mode 100755 index 497d322a610..00000000000 --- a/.github/workflows/source/inputsNotTested +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -# Search input files in Examples/ and verify if all input files are tested - -set -eu -o pipefail - -ok=0 - -for file in $(find Examples -type f) -do - # Name of file without path - filename=$(basename $file) - # If file is an input file - if [[ ${filename:0:6 } =~ inputs ]] || - [[ ${filename:0:12} =~ PICMI_inputs ]] - then - cr=$'$' - file_cr="$file$cr" - # Search file name in test list - string_match=$(grep -m1 "$file_cr" Regression/WarpX-tests.ini || echo "") - # If match is empty, inputs examples is not tested - if [[ -z $string_match ]] - then - echo "$file is not tested!" - ok=1 - fi - fi -done - -if [ $ok -ne 0 ] -then - echo "" - echo "All files in Examples that start with one of" - echo " - inputs" - echo " - PICMI_inputs" - echo "must have an automated test." - echo "Please add a test in Regression/WarpX-tests.ini" - echo "for all files listed above." -fi - -exit $ok diff --git a/.github/workflows/source/wrongFileNameInExamples b/.github/workflows/source/wrongFileNameInExamples deleted file mode 100755 index 23ba1c7abb7..00000000000 --- a/.github/workflows/source/wrongFileNameInExamples +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -# -# Search inside Examples/ and check that file names start with -# inputs -# PICMI_inputs -# analysis -# README - -set -eu -o pipefail - -ok=0 -files=() - -for pathtofile in $(find Examples -type f) -do - file=$(basename $pathtofile) - if [[ ${file:0:6 } != inputs ]] && - [[ ${file:0:12} != PICMI_inputs ]] && - [[ ${file:0:8 } != analysis ]] && - [[ ${file:0:8 } != catalyst ]] && - [[ ${file: -4} != yaml ]] && - [[ ${file:0:4 } != plot ]] && - [[ ${file:0:6 } != README ]] - then - files+=($file) - echo "$pathtofile does not have a proper name!" - ok=1 - fi -done - -if [ $ok -ne 0 ] -then - echo "" - echo "Files in Examples/ must start with one of:" - echo " - inputs : for WarpX input files" - echo " - PICMI_inputs : for PICMI-compliant input scripts" - echo " - analysis : for scripts testing the accuracy of a test" - echo " - *.yaml : for third-party input, e.g. Ascent in situ visualization" - echo " - README : for readme files" - echo "" - echo "Please rename the file(s) to comply, or move to another folder" -fi - -exit $ok diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index bf6652e9c69..68d2b2156e9 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -39,8 +39,8 @@ jobs: -DWarpX_MPI=OFF \ -DWarpX_QED=OFF cmake --build build -j 4 - ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_3d - ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_rz + ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_base_3d + ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz ccache -s du -hs ~/.cache/ccache @@ -82,8 +82,8 @@ jobs: -DWarpX_QED_TOOLS=ON cmake --build build -j 4 - ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_1d - ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_2d + ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration + ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_base_2d ccache -s du -hs ~/.cache/ccache @@ -133,8 +133,8 @@ jobs: -DWarpX_QED_TABLE_GEN=ON cmake --build build -j 4 - ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_3d - ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_rz + ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_base_3d + ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz ccache -s du -hs ~/.cache/ccache @@ -210,7 +210,6 @@ jobs: cmake -S . -B build \ -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DWarpX_APP=OFF \ -DWarpX_FFT=ON \ -DWarpX_PYTHON=ON \ -DWarpX_QED_TABLE_GEN=ON @@ -222,4 +221,4 @@ jobs: - name: run pywarpx run: | export OMP_NUM_THREADS=1 - mpirun -n 2 Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py + mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3c0faaf3636..d6030743524 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -54,7 +54,7 @@ jobs: run: | $env:PATH += ';C:/Program Files (x86)/WarpX/bin/' - python3 Examples\Tests\gaussian_beam\PICMI_inputs_gaussian_beam.py + python3 Examples/Tests/gaussian_beam/inputs_test_3d_gaussian_beam_picmi.py # JSON writes are currently very slow (50min) with MSVC # --diagformat=openpmd @@ -118,5 +118,5 @@ jobs: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64 set "PATH=C:/Program Files (x86)/WarpX/bin/;%PATH%" - python3 Examples\Tests\gaussian_beam\PICMI_inputs_gaussian_beam.py --diagformat=openpmd + python3 Examples/Tests/gaussian_beam/inputs_test_3d_gaussian_beam_picmi.py --diagformat=openpmd if errorlevel 1 exit 1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 36e42433572..d20de57f81c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,14 @@ option(WarpX_QED_TABLE_GEN "QED table generation (requires PICSAR and Boost)" option(WarpX_QED_TOOLS "Build external tool to generate QED lookup tables (requires PICSAR and Boost)" OFF) +# Advanced option to automatically clean up CI test directories +option(WarpX_TEST_CLEANUP "Clean up CI test directories" OFF) +mark_as_advanced(WarpX_TEST_CLEANUP) + +# Advanced option to run CI tests with FPE-trapping runtime parameters +option(WarpX_TEST_FPETRAP "Run CI tests with FPE-trapping runtime parameters" OFF) +mark_as_advanced(WarpX_TEST_FPETRAP) + 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) @@ -188,7 +196,7 @@ if(WarpX_HEFFTE) endif() # this defined the variable BUILD_TESTING which is ON by default -#include(CTest) +include(CTest) # Dependencies ################################################################ @@ -787,12 +795,12 @@ endif() # Tests ####################################################################### # - -#if(BUILD_TESTING) -# enable_testing() -# -# add_test(...) -#endif() +if(BUILD_TESTING) + enable_testing() + if(WarpX_APP OR WarpX_PYTHON) + add_subdirectory(Examples) + endif() +endif() # Status Summary for Build Options ############################################ diff --git a/Docs/source/developers/testing.rst b/Docs/source/developers/testing.rst index c6a09d970df..fd57b61fa17 100644 --- a/Docs/source/developers/testing.rst +++ b/Docs/source/developers/testing.rst @@ -3,7 +3,7 @@ Testing the code ================ -When adding a new feature, you want to make sure that (i) you did not break the existing code and (ii) your contribution gives correct results. While existing capabilities are tested regularly remotely (when commits are pushed to an open PR on CI, and every night on local clusters), it can also be useful to run tests on your custom input file. This section details how to use both automated and custom tests. +When adding a new feature, you want to make sure that (i) you did not break the existing code and (ii) your contribution gives correct results. While the code is tested regularly remotely (on the cloud when commits are pushed to an open PR, and every night on local clusters), it can also be useful to run tests on your custom input file. This section details how to use both automated and custom tests. Continuous Integration in WarpX ------------------------------- @@ -11,31 +11,14 @@ Continuous Integration in WarpX Configuration ^^^^^^^^^^^^^ -Our regression tests are using the suite published and documented at `AMReX-Codes/regression_testing `__. +Our regression tests are run with `CTest `__, an executable that comes with CMake. -Most of the configuration of our regression tests happens in ``Regression/Warpx-tests.ini``. -We slightly modify this file in ``Regression/prepare_file_ci.py``. +The test suite is ready to run once you have configured and built WarpX with CMake, following the instructions that you find in our :ref:`Users ` or :ref:`Developers ` sections. -For example, if you like to change the compiler to compilation to build on Nvidia GPUs, modify this block to add ``-DWarpX_COMPUTE=CUDA``: +A test that requires a build option that was not configured and built will be skipped automatically. For example, if you configure and build WarpX in 1D only, any test of dimensionality other than 1D, which would require WarpX to be configured and built in the corresponding dimensionality, will be skipped automatically. -.. code-block:: ini - - [source] - dir = /home/regtester/AMReX_RegTesting/warpx - branch = development - cmakeSetupOpts = -DAMReX_ASSERTIONS=ON -DAMReX_TESTING=ON -DWarpX_COMPUTE=CUDA - -We also support changing compilation options via the usual :ref:`build environment variables `. -For instance, compiling with ``clang++ -Werror`` would be: - -.. code-block:: sh - - export CXX=$(which clang++) - export CXXFLAGS="-Werror" - - -Run Pre-Commit Tests Locally ----------------------------- +How to run pre-commit tests locally +----------------------------------- When proposing code changes to Warpx, we perform a couple of automated stylistic and correctness checks on the code change. You can run those locally before you push to save some time, install them once like this: @@ -47,97 +30,151 @@ You can run those locally before you push to save some time, install them once l See `pre-commit.com `__ and our ``.pre-commit-config.yaml`` file in the repository for more details. +How to run automated tests locally +---------------------------------- + +Once your new feature is ready, there are ways to check that you did not break anything. +WarpX has automated tests running every time a commit is pushed to an open pull request. +The input files and scripts used by the automated tests can be found in the `Examples `__ directory, either under `Physics_applications `__ or `Tests `__. + +For easier debugging, it can be convenient to run the tests on your local machine by executing CTest as illustrated in the examples below (where we assume that WarpX was configured and built in the directory ``build``): + +* List tests available for the current build options: + + .. code-block:: sh + + ctest --test-dir build -N + +* Run tests available for the current build options: + + .. code-block:: sh + + ctest --test-dir build + +* Run tests available for the current build options in parallel (while preserving existing dependencies between tests): + + .. code-block:: sh + + ctest --test-dir build -j 2 -Run the test suite locally +* Run tests available for the current build options and output anything outputted by the test program if the test should fail: + + .. code-block:: sh + + ctest --test-dir build --output-on-failure + +* Run tests available for the current build options with verbose output: + + .. code-block:: sh + + ctest --test-dir build --verbose + +* Run tests matching the regular expression ``laser_acceleration``: + + .. code-block:: sh + + ctest --test-dir build -R laser_acceleration + +* Run tests except those matching the regular expression ``laser_acceleration``: + + .. code-block:: sh + + ctest --test-dir build -E laser_acceleration + +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/``. + +If you modify the code base locally and want to assess the effects of your code changes on the automated tests, you need to first rebuild WarpX including your code changes and then rerun CTest. + +How to add automated tests -------------------------- -Once your new feature is ready, there are ways to check that you did not break anything. -WarpX has automated tests running every time a commit is added to an open pull request. -The list of automated tests is defined in `./Regression/WarpX-tests.ini `__. +As mentioned above, the input files and scripts used by the automated tests can be found in the `Examples `__ directory, either under `Physics_applications `__ or `Tests `__. -For easier debugging, it can be convenient to run the tests on your local machine by executing the script -`./run_test.sh `__ from WarpX's root folder, as illustrated in the examples below: +Each test directory must contain a file named ``CMakeLists.txt`` where all tests associated with the input files and scripts in that directory must be listed. -.. code-block:: sh +A new test can be added by adding a corresponding entry in ``CMakeLists.txt`` as illustrated in the examples below: - # Example: - # run all tests defined in ./Regression/WarpX-tests.ini - ./run_test.sh +* Add the **regular test** ``test_1d_laser_acceleration``: - # Example: - # run only the test named 'pml_x_yee' - ./run_test.sh pml_x_yee + .. code-block:: cmake - # Example: - # run only the tests named 'pml_x_yee', 'pml_x_ckc' and 'pml_x_psatd' - ./run_test.sh pml_x_yee pml_x_ckc pml_x_psatd + add_warpx_test( + test_1d_laser_acceleration # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_laser_acceleration # inputs + analysis.py # analysis + diags/diag1000100 # output (plotfile) + OFF # dependency + ) -Note that the script `./run_test.sh `__ runs the tests with the exact same compile-time options and runtime options used to run the tests remotely. +* Add the **PICMI test** ``test_2d_laser_acceleration_picmi``: -Moreover, the script `./run_test.sh `__ compiles all the executables that are necessary in order to run the chosen tests. -The default number of threads allotted for compiling is set with ``numMakeJobs = 8`` in `./Regression/WarpX-tests.ini `__. -However, when running the tests on a local machine, it is usually possible and convenient to allot more threads for compiling, in order to speed up the builds. -This can be accomplished by setting the environment variable ``WARPX_CI_NUM_MAKE_JOBS``, with the preferred number of threads that fits your local machine, e.g. ``export WARPX_CI_NUM_MAKE_JOBS=16`` (or less if your machine is smaller). -On public CI, we overwrite the value to ``WARPX_CI_NUM_MAKE_JOBS=2``, in order to avoid overloading the available remote resources. -Note that this will not change the number of threads used to run each test, but only the number of threads used to compile each executable necessary to run the tests. + .. code-block:: cmake -Once the execution of `./run_test.sh `__ is completed, you can find all the relevant files associated with each test in one single directory. -For example, if you run the single test ``pml_x_yee``, as shown above, on 04/30/2021, you can find all relevant files in the directory ``./test_dir/rt-WarpX/WarpX-tests/2021-04-30/pml_x_yee/``. -The content of this directory will look like the following (possibly including backtraces if the test crashed at runtime): + add_warpx_test( + test_2d_laser_acceleration_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_laser_acceleration_picmi.py # inputs + analysis.py # analysis + diags/diag1000100 # output (plotfile) + OFF # dependency + ) -.. code-block:: sh +* Add the **restart test** ``test_3d_laser_acceleration_restart``: + + .. code-block:: cmake + + add_warpx_test( + test_3d_laser_acceleration_restart # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_laser_acceleration_restart # inputs + analysis_default_restart.py # analysis + diags/diag1000100 # output (plotfile) + test_3d_laser_acceleration # dependency + ) - $ ls ./test_dir/rt-WarpX/WarpX-tests/2021-04-30/pml_x_yee/ - analysis_pml_yee.py # Python analysis script - inputs_2d # input file - main2d.gnu.TEST.TPROF.MTMPI.OMP.QED.ex # executable - pml_x_yee.analysis.out # Python analysis output - pml_x_yee.err.out # error output - pml_x_yee.make.out # build output - pml_x_yee_plt00000/ # data output (initialization) - pml_x_yee_plt00300/ # data output (last time step) - pml_x_yee.run.out # test output + Note that the restart has an explicit dependency, namely it can run only provided that the original test, from which the restart checkpoint files will be read, runs first. +* A more complex example. Add the **PICMI test** ``test_rz_laser_acceleration_picmi``, with custom command-line arguments ``--test`` and ``dir``, and openPMD time series output: -Add a test to the suite ------------------------ + .. code-block:: cmake -There are three steps to follow to add a new automated test (illustrated here for PML boundary conditions): + add_warpx_test( + test_rz_laser_acceleration_picmi # name + RZ # dims + 2 # nprocs + OFF # eb + "inputs_test_rz_laser_acceleration_picmi.py --test --dir 1" # inputs + analysis.py # analysis + diags/diag1/ # output (openPMD time series) + OFF # dependency + ) -* An input file for your test, in folder `Example/Tests/...`. For the PML test, the input file is at ``Examples/Tests/pml/inputs_2d``. You can also re-use an existing input file (even better!) and pass specific parameters at runtime (see below). -* A Python script that reads simulation output and tests correctness versus theory or calibrated results. For the PML test, see ``Examples/Tests/pml/analysis_pml_yee.py``. It typically ends with Python statement ``assert( error<0.01 )``. -* If you need a new Python package dependency for testing, add it in ``Regression/requirements.txt`` -* Add an entry to ``Regression/WarpX-tests.ini``, so that a WarpX simulation runs your test in the continuous integration process, and the Python script is executed to assess the correctness. For the PML test, the entry is +If you need a new Python package dependency for testing, please add it in `Regression/requirements.txt `__. -.. code-block:: +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``. - [pml_x_yee] - buildDir = . - inputFile = Examples/Tests/pml/inputs2d - runtime_params = warpx.do_dynamic_scheduling=0 algo.maxwell_solver=yee - dim = 2 - addToCompileString = - cmakeSetupOpts = -DWarpX_DIMS=2 - restartTest = 0 - useMPI = 1 - numprocs = 2 - useOMP = 1 - numthreads = 1 - compileTest = 0 - doVis = 0 - analysisRoutine = Examples/Tests/pml/analysis_pml_yee.py +Naming conventions for automated tests +-------------------------------------- -If you re-use an existing input file, you can add arguments to ``runtime_params``, like ``runtime_params = amr.max_level=1 amr.n_cell=32 512 max_step=100 plasma_e.zmin=-200.e-6``. +Note that we currently obey the following snake\_case naming conventions for test names and test input files (which make automation tasks easier, e.g., parsing visually, parsing through code, sorting alphabetically, filtering tests in CTest via ``-R``, etc.): -.. note:: +#. **Regular test names** start with the string ``test_1d_``, ``test_2d_``, ``test_3d_`` or ``test_rz_``, followed by a string that is descriptive of the test. For example, ``test_3d_laser_acceleration``. - If you added ``analysisRoutine = Examples/analysis_default_regression.py``, then run the new test case locally and add the :ref:`checksum ` file for the expected output. +#. **PICMI test names** start with the string ``test_1d_``, ``test_2d_``, ``test_3d_`` or ``test_rz_``, followed by a string that is descriptive of the test, and end with the string ``_picmi``. For example, ``test_3d_laser_acceleration_picmi``. -.. note:: +#. **Restart test names** end with the string ``_restart``. For example, ``test_3d_laser_acceleration_restart``. - We run those tests on our continuous integration services, which at the moment only have 2 virtual CPU cores. - Thus, make sure that the product of ``numprocs`` and ``numthreads`` for a test is ``<=2``. +#. **Test input files** start with the string ``inputs_`` followed by the test name. For example, ``inputs_test_3d_laser_acceleration`` or ``inputs_test_3d_laser_acceleration_picmi.py`` or ``inputs_test_3d_laser_acceleration_restart``. +#. **Base input files** (that is, files collecting input parameters shared between two or more tests) are typically named ``inputs_base_1d``, ``inputs_base_2d``, ``inputs_base_3d`` or ``inputs_base_rz``, possibly followed by additional strings if need be. Useful tool for plotfile comparison: ``fcompare`` ------------------------------------------------- diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt new file mode 100644 index 00000000000..f2898b557f4 --- /dev/null +++ b/Examples/CMakeLists.txt @@ -0,0 +1,237 @@ +# Configuration ############################################################### +# +if(WarpX_MPI) + # OpenMPI root guard: https://github.com/open-mpi/ompi/issues/4451 + if("$ENV{USER}" STREQUAL "root") + # calling even --help as root will abort and warn on stderr + execute_process( + COMMAND ${MPIEXEC_EXECUTABLE} --help + ERROR_VARIABLE MPIEXEC_HELP_TEXT + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(${MPIEXEC_HELP_TEXT} MATCHES "^.*allow-run-as-root.*$") + set(MPI_ALLOW_ROOT --allow-run-as-root) + endif() + endif() +endif() + +# Add a WarpX test set (with sub-tests) +# +# name: unique name of this test +# dims: 1,2,RZ,3 +# nprocs: 1 or 2 (maybe refactor later on to just depend on WarpX_MPI) +# eb: needs EB support? (temporary until handled as runtime parameter) +# inputs: inputs file or PICMI script, WarpX_MPI decides w/ or w/o MPI +# analysis: analysis script, always run without MPI +# output: output file(s) to analyze +# dependency: name of base test that must run first +# +function(add_warpx_test + name + dims + nprocs + eb + inputs + analysis + output + dependency +) + # cannot run MPI tests w/o MPI build + if(nprocs GREATER_EQUAL 2 AND NOT WarpX_MPI) + message(WARNING "${name}: cannot run MPI tests without MPI build") + return() + endif() + + # cannot run EB tests w/o EB build + if(eb AND NOT WarpX_EB) + message(WARNING "${name}: cannot run EB tests without EB build") + return() + endif() + + # do not run no-EB tests w/ EB build + if(NOT eb AND WarpX_EB) + return() + endif() + + # cannot run tests with unsupported geometry + if(NOT dims IN_LIST WarpX_DIMS) + return() + endif() + + # cannot run tests with unfulfilled dependencies + if(dependency AND NOT TEST ${dependency}.run) + return() + endif() + + # set dimension suffix + warpx_set_suffix_dims(SD ${dims}) + + # make a unique run directory + file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}) + set(THIS_WORKING_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}) + + # get input file/script and optional command-line arguments + separate_arguments(INPUTS_LIST UNIX_COMMAND "${inputs}") + list(GET INPUTS_LIST 0 INPUTS_FILE) + list(LENGTH INPUTS_LIST INPUTS_LIST_LENGTH) + if(INPUTS_LIST_LENGTH GREATER 1) + list(SUBLIST INPUTS_LIST 1 -1 INPUTS_ARGS) + list(JOIN INPUTS_ARGS " " INPUTS_ARGS) + else() + set(INPUTS_ARGS "") + endif() + + # get analysis script and optional command-line arguments + separate_arguments(ANALYSIS_LIST UNIX_COMMAND "${analysis}") + list(GET ANALYSIS_LIST 0 ANALYSIS_FILE) + cmake_path(SET ANALYSIS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${ANALYSIS_FILE}") + # TODO Enable lines below to handle command-line arguments + #list(LENGTH ANALYSIS_LIST ANALYSIS_LIST_LENGTH) + #if(ANALYSIS_LIST_LENGTH GREATER 1) + # list(SUBLIST ANALYSIS_LIST 1 -1 ANALYSIS_ARGS) + # list(JOIN ANALYSIS_ARGS " " ANALYSIS_ARGS) + #else() + # set(ANALYSIS_ARGS "") + #endif() + + # Python test? + set(python OFF) + if(${INPUTS_FILE} MATCHES ".*\.py$") + set(python ON) + cmake_path(SET INPUTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${INPUTS_FILE}") + endif() + + # cannot run Python tests w/o Python support + if(python AND NOT WarpX_PYTHON) + return() + endif() + + # set MPI executable + set(THIS_MPI_TEST_EXE + ${MPIEXEC_EXECUTABLE} + ${MPI_ALLOW_ROOT} + ${MPIEXEC_NUMPROC_FLAG} ${nprocs} + ${MPIEXEC_POSTFLAGS} + ${MPIEXEC_PREFLAGS} + ) + + # set Python executable + if(python) + set(THIS_Python_EXE ${Python_EXECUTABLE}) + else() + set(THIS_Python_EXE "") + endif() + + # test run + if(python) + # for argparse, do not pass command-line arguments as one quoted string + separate_arguments(INPUTS_ARGS UNIX_COMMAND "${INPUTS_ARGS}") + add_test( + NAME ${name}.run + COMMAND + ${THIS_MPI_TEST_EXE} + ${THIS_Python_EXE} + ${INPUTS_FILE} + ${INPUTS_ARGS} + WORKING_DIRECTORY ${THIS_WORKING_DIR} + ) + # FIXME Use helper function to handle Windows exceptions + set_property(TEST ${name}.run APPEND PROPERTY ENVIRONMENT "PYTHONPATH=$ENV{PYTHONPATH}:${CMAKE_PYTHON_OUTPUT_DIRECTORY}") + else() + # TODO Use these for Python tests too + set(runtime_params + "amrex.abort_on_unused_inputs = 1" + "amrex.throw_exception = 1" + "warpx.always_warn_immediately = 1" + "warpx.do_dynamic_scheduling = 0" + "warpx.serialize_initial_conditions = 1" + # FIXME should go before input file + #"warpx.abort_on_warning_threshold = low" + ) + set(runtime_params_fpetrap "") + if(WarpX_TEST_FPETRAP) + set(runtime_params_fpetrap + "amrex.fpe_trap_invalid = 1" + "amrex.fpe_trap_overflow = 1" + "amrex.fpe_trap_zero = 1" + ) + endif() + add_test( + NAME ${name}.run + COMMAND + ${THIS_MPI_TEST_EXE} + $ + ${INPUTS_FILE} + ${runtime_params} + ${runtime_params_fpetrap} + ${INPUTS_ARGS} + WORKING_DIRECTORY ${THIS_WORKING_DIR} + ) + endif() + + # AMReX ParmParse prefix: FILE = + set_property(TEST ${name}.run APPEND PROPERTY ENVIRONMENT "AMREX_INPUTS_FILE_PREFIX=${CMAKE_CURRENT_SOURCE_DIR}/") + + # run all tests with 1 OpenMP thread by default + set_property(TEST ${name}.run APPEND PROPERTY ENVIRONMENT "OMP_NUM_THREADS=1") + + if(python OR WIN32) + set(THIS_Python_SCRIPT_EXE ${Python_EXECUTABLE}) + else() + set(THIS_Python_SCRIPT_EXE "") + endif() + + # test analysis + if(analysis) + add_test( + NAME ${name}.analysis + COMMAND + ${THIS_Python_SCRIPT_EXE} ${ANALYSIS_FILE} + ${output} + WORKING_DIRECTORY ${THIS_WORKING_DIR} + ) + # test analysis depends on test run + set_property(TEST ${name}.analysis APPEND PROPERTY DEPENDS "${name}.run") + # FIXME Use helper function to handle Windows exceptions + set(PYTHONPATH "$ENV{PYTHONPATH}:${CMAKE_PYTHON_OUTPUT_DIRECTORY}") + # add paths for custom Python modules + set(PYTHONPATH "${PYTHONPATH}:${WarpX_SOURCE_DIR}/Regression/Checksum") + set(PYTHONPATH "${PYTHONPATH}:${WarpX_SOURCE_DIR}/Regression/PostProcessingUtils") + set(PYTHONPATH "${PYTHONPATH}:${WarpX_SOURCE_DIR}/Tools/Parser") + set(PYTHONPATH "${PYTHONPATH}:${WarpX_SOURCE_DIR}/Tools/PostProcessing") + set_property(TEST ${name}.analysis APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${PYTHONPATH}") + endif() + + # CI: remove test directory after run + if(WarpX_TEST_CLEANUP) + add_test( + NAME ${name}.cleanup + COMMAND ${CMAKE_COMMAND} -E rm -rf ${THIS_WORKING_DIR} + ) + # test cleanup depends on test run + set_property(TEST ${name}.cleanup APPEND PROPERTY DEPENDS "${name}.run") + if(analysis) + # test cleanup depends on test analysis + set_property(TEST ${name}.cleanup APPEND PROPERTY DEPENDS "${name}.analysis") + endif() + endif() + + # Do we depend on another test? + if(dependency) + # current test depends on dependency test run (and analysis) + set_property(TEST ${name}.run APPEND PROPERTY DEPENDS "${dependency}.run") + if(analysis) + set_property(TEST ${name}.run APPEND PROPERTY DEPENDS "${dependency}.analysis") + endif() + if(WarpX_TEST_CLEANUP) + # do not clean up dependency test before current test is completed + set_property(TEST ${dependency}.cleanup APPEND PROPERTY DEPENDS "${name}.cleanup") + endif() + endif() +endfunction() + +# Add tests (alphabetical order) ############################################## +# + +add_subdirectory(Tests) +add_subdirectory(Physics_applications) diff --git a/Examples/Physics_applications/CMakeLists.txt b/Examples/Physics_applications/CMakeLists.txt new file mode 100644 index 00000000000..e4f8565a140 --- /dev/null +++ b/Examples/Physics_applications/CMakeLists.txt @@ -0,0 +1,11 @@ +# Add tests (alphabetical order) ############################################## +# + +add_subdirectory(beam_beam_collision) +add_subdirectory(capacitive_discharge) +add_subdirectory(laser_acceleration) +add_subdirectory(laser_ion) +add_subdirectory(plasma_acceleration) +add_subdirectory(plasma_mirror) +add_subdirectory(spacecraft_charging) +add_subdirectory(uniform_plasma) diff --git a/Examples/Physics_applications/beam_beam_collision/CMakeLists.txt b/Examples/Physics_applications/beam_beam_collision/CMakeLists.txt new file mode 100644 index 00000000000..793675efaba --- /dev/null +++ b/Examples/Physics_applications/beam_beam_collision/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_beam_beam_collision # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_beam_beam_collision # inputs + analysis_default_openpmd_regression.py # analysis + diags/diag1/ # output + OFF # dependency +) diff --git a/Examples/Physics_applications/beam-beam_collision/README.rst b/Examples/Physics_applications/beam_beam_collision/README similarity index 100% rename from Examples/Physics_applications/beam-beam_collision/README.rst rename to Examples/Physics_applications/beam_beam_collision/README diff --git a/Examples/Physics_applications/beam_beam_collision/analysis_default_openpmd_regression.py b/Examples/Physics_applications/beam_beam_collision/analysis_default_openpmd_regression.py new file mode 120000 index 00000000000..73e5ec47001 --- /dev/null +++ b/Examples/Physics_applications/beam_beam_collision/analysis_default_openpmd_regression.py @@ -0,0 +1 @@ +../../analysis_default_openpmd_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/beam-beam_collision/inputs b/Examples/Physics_applications/beam_beam_collision/inputs_test_3d_beam_beam_collision similarity index 100% rename from Examples/Physics_applications/beam-beam_collision/inputs rename to Examples/Physics_applications/beam_beam_collision/inputs_test_3d_beam_beam_collision diff --git a/Examples/Physics_applications/capacitive_discharge/CMakeLists.txt b/Examples/Physics_applications/capacitive_discharge/CMakeLists.txt new file mode 100644 index 00000000000..4f67131556e --- /dev/null +++ b/Examples/Physics_applications/capacitive_discharge/CMakeLists.txt @@ -0,0 +1,58 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_background_mcc_picmi # name + 1 # dims + 2 # nprocs + OFF # eb + "inputs_base_1d_picmi.py --test --pythonsolver" # inputs + analysis_1d.py # analysis + diags/diag1000050 # output + OFF # dependency +) + +add_warpx_test( + test_1d_dsmc_picmi # name + 1 # dims + 2 # nprocs + OFF # eb + "inputs_base_1d_picmi.py --test --dsmc" # inputs + analysis_dsmc.py # analysis + diags/diag1000050 # output + OFF # dependency +) + +add_warpx_test( + test_2d_background_mcc # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_background_mcc # inputs + analysis_default_regression.py # analysis + diags/diag1000050 # output + OFF # dependency +) + +# FIXME: can we make this a single precision for now? +#add_warpx_test( +# test_2d_background_mcc_dp_psp # name +# 2 # dims +# 2 # nprocs +# OFF # eb +# inputs_test_2d_background_mcc_dp_psp # inputs +# analysis_default_regression.py # analysis +# diags/diag1000050 # output +# OFF # dependency +#) + +add_warpx_test( + test_2d_background_mcc_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_background_mcc_picmi.py # inputs + analysis_2d.py # analysis + diags/diag1000050 # output + OFF # dependency +) diff --git a/Examples/Physics_applications/capacitive_discharge/README.rst b/Examples/Physics_applications/capacitive_discharge/README similarity index 100% rename from Examples/Physics_applications/capacitive_discharge/README.rst rename to Examples/Physics_applications/capacitive_discharge/README diff --git a/Examples/Physics_applications/capacitive_discharge/analysis_2d.py b/Examples/Physics_applications/capacitive_discharge/analysis_2d.py index 21f5c7714c4..e9782fabe23 100755 --- a/Examples/Physics_applications/capacitive_discharge/analysis_2d.py +++ b/Examples/Physics_applications/capacitive_discharge/analysis_2d.py @@ -14,5 +14,5 @@ import checksumAPI my_check = checksumAPI.evaluate_checksum( - "background_mcc", "Python_background_mcc_plt000050", do_particles=True, rtol=5e-3 + "test_2d_background_mcc", "diags/diag1000050", do_particles=True, rtol=5e-3 ) diff --git a/Examples/Physics_applications/capacitive_discharge/analysis_default_regression.py b/Examples/Physics_applications/capacitive_discharge/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Physics_applications/capacitive_discharge/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_1d.py b/Examples/Physics_applications/capacitive_discharge/inputs_base_1d_picmi.py similarity index 97% rename from Examples/Physics_applications/capacitive_discharge/PICMI_inputs_1d.py rename to Examples/Physics_applications/capacitive_discharge/inputs_base_1d_picmi.py index 2477eaf68dd..3de88f3b3cb 100644 --- a/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_1d.py +++ b/Examples/Physics_applications/capacitive_discharge/inputs_base_1d_picmi.py @@ -359,14 +359,6 @@ def setup_run(self): # Add diagnostics for the CI test to be happy # ####################################################################### - if self.dsmc: - file_prefix = "Python_dsmc_1d_plt" - else: - if self.pythonsolver: - file_prefix = "Python_background_mcc_1d_plt" - else: - file_prefix = "Python_background_mcc_1d_tridiag_plt" - species = [self.electrons, self.ions] if self.dsmc: species.append(self.neutrals) @@ -374,16 +366,12 @@ def setup_run(self): species=species, name="diag1", period=0, - write_dir=".", - warpx_file_prefix=file_prefix, ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=self.grid, period=0, data_list=["rho_electrons", "rho_he_ions"], - write_dir=".", - warpx_file_prefix=file_prefix, ) self.sim.add_diagnostic(particle_diag) self.sim.add_diagnostic(field_diag) diff --git a/Examples/Physics_applications/capacitive_discharge/inputs_2d b/Examples/Physics_applications/capacitive_discharge/inputs_test_2d_background_mcc similarity index 98% rename from Examples/Physics_applications/capacitive_discharge/inputs_2d rename to Examples/Physics_applications/capacitive_discharge/inputs_test_2d_background_mcc index 2b11fd12978..e42e531c9e2 100644 --- a/Examples/Physics_applications/capacitive_discharge/inputs_2d +++ b/Examples/Physics_applications/capacitive_discharge/inputs_test_2d_background_mcc @@ -13,6 +13,7 @@ warpx.const_dt = 1.0/(400*freq) warpx.do_electrostatic = labframe warpx.self_fields_required_precision = 1e-06 warpx.use_filter = 0 +warpx.abort_on_warning_threshold = high amr.n_cell = 128 8 amr.max_grid_size = 128 diff --git a/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_2d.py b/Examples/Physics_applications/capacitive_discharge/inputs_test_2d_background_mcc_picmi.py similarity index 98% rename from Examples/Physics_applications/capacitive_discharge/PICMI_inputs_2d.py rename to Examples/Physics_applications/capacitive_discharge/inputs_test_2d_background_mcc_picmi.py index 094a9cc8881..7879239d5ce 100755 --- a/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_2d.py +++ b/Examples/Physics_applications/capacitive_discharge/inputs_test_2d_background_mcc_picmi.py @@ -311,16 +311,12 @@ def solve(self): particle_diag = picmi.ParticleDiagnostic( name="diag1", period=diagnostic_intervals, - write_dir=".", - warpx_file_prefix="Python_background_mcc_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=diagnostic_intervals, data_list=["rho_electrons", "rho_he_ions"], - write_dir=".", - warpx_file_prefix="Python_background_mcc_plt", ) ########################## diff --git a/Examples/Physics_applications/laser_acceleration/CMakeLists.txt b/Examples/Physics_applications/laser_acceleration/CMakeLists.txt new file mode 100644 index 00000000000..9f4a5f1dc58 --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/CMakeLists.txt @@ -0,0 +1,156 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_laser_acceleration # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_laser_acceleration # inputs + analysis_default_regression.py # analysis + diags/diag1000100 # output + OFF # dependency +) + +add_warpx_test( + test_1d_laser_acceleration_fluid # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_laser_acceleration_fluid # inputs + analysis_1d_fluid.py # analysis + diags/diag1040000 # output + OFF # dependency +) + +add_warpx_test( + test_1d_laser_acceleration_fluid_boosted # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_laser_acceleration_fluid_boosted # inputs + analysis_1d_fluid_boosted.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_1d_laser_acceleration_picmi # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_laser_acceleration_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000100 # output + OFF # dependency +) + +add_warpx_test( + test_2d_laser_acceleration_boosted # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_laser_acceleration_boosted # inputs + analysis_default_regression.py # analysis + diags/diag1000002 # output + OFF # dependency +) + +add_warpx_test( + test_2d_laser_acceleration_mr # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_laser_acceleration_mr # inputs + analysis_default_regression.py # analysis + diags/diag1000200 # output + OFF # dependency +) + +add_warpx_test( + test_2d_laser_acceleration_mr_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_laser_acceleration_mr_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000200 # output + OFF # dependency +) + +add_warpx_test( + test_2d_refined_injection # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_refined_injection # inputs + analysis_refined_injection.py # analysis + diags/diag1000200 # output + OFF # dependency +) + +add_warpx_test( + test_3d_laser_acceleration # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_laser_acceleration # inputs + analysis_default_openpmd_regression.py # analysis + diags/diag1/ # output + OFF # dependency +) + +add_warpx_test( + test_3d_laser_acceleration_picmi # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_laser_acceleration_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000100 # output + OFF # dependency +) + +add_warpx_test( + test_3d_laser_acceleration_single_precision_comms # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_laser_acceleration_single_precision_comms # inputs + analysis_default_openpmd_regression.py # analysis + diags/diag1/ # output + OFF # dependency +) + +add_warpx_test( + test_rz_laser_acceleration # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_laser_acceleration # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency +) + +add_warpx_test( + test_rz_laser_acceleration_opmd # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_laser_acceleration_opmd # inputs + analysis_openpmd_rz.py # analysis + diags/diag1/ # output + OFF # dependency +) + +add_warpx_test( + test_rz_laser_acceleration_picmi # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_laser_acceleration_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency +) diff --git a/Examples/Physics_applications/laser_acceleration/README.rst b/Examples/Physics_applications/laser_acceleration/README similarity index 100% rename from Examples/Physics_applications/laser_acceleration/README.rst rename to Examples/Physics_applications/laser_acceleration/README diff --git a/Examples/Physics_applications/laser_acceleration/analysis_1d_fluids.py b/Examples/Physics_applications/laser_acceleration/analysis_1d_fluid.py similarity index 100% rename from Examples/Physics_applications/laser_acceleration/analysis_1d_fluids.py rename to Examples/Physics_applications/laser_acceleration/analysis_1d_fluid.py diff --git a/Examples/Physics_applications/laser_acceleration/analysis_1d_fluids_boosted.py b/Examples/Physics_applications/laser_acceleration/analysis_1d_fluid_boosted.py similarity index 100% rename from Examples/Physics_applications/laser_acceleration/analysis_1d_fluids_boosted.py rename to Examples/Physics_applications/laser_acceleration/analysis_1d_fluid_boosted.py diff --git a/Examples/Physics_applications/laser_acceleration/analysis_default_openpmd_regression.py b/Examples/Physics_applications/laser_acceleration/analysis_default_openpmd_regression.py new file mode 120000 index 00000000000..73e5ec47001 --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/analysis_default_openpmd_regression.py @@ -0,0 +1 @@ +../../analysis_default_openpmd_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/laser_acceleration/analysis_default_regression.py b/Examples/Physics_applications/laser_acceleration/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/openpmd_rz/analysis_openpmd_rz.py b/Examples/Physics_applications/laser_acceleration/analysis_openpmd_rz.py similarity index 94% rename from Examples/Tests/openpmd_rz/analysis_openpmd_rz.py rename to Examples/Physics_applications/laser_acceleration/analysis_openpmd_rz.py index 13dcd0016a9..f136ffeb1d4 100755 --- a/Examples/Tests/openpmd_rz/analysis_openpmd_rz.py +++ b/Examples/Physics_applications/laser_acceleration/analysis_openpmd_rz.py @@ -1,9 +1,12 @@ #!/usr/bin/env python3 +import sys + import numpy as np import openpmd_api as io -series = io.Series("LaserAccelerationRZ_opmd_plt/openpmd_%T.h5", io.Access.read_only) +filename = sys.argv[1] +series = io.Series(f"{filename}/openpmd_%T.h5", io.Access.read_only) assert len(series.iterations) == 3, "improper number of iterations stored" diff --git a/Examples/Physics_applications/laser_acceleration/inputs_2d b/Examples/Physics_applications/laser_acceleration/inputs_base_2d similarity index 100% rename from Examples/Physics_applications/laser_acceleration/inputs_2d rename to Examples/Physics_applications/laser_acceleration/inputs_base_2d diff --git a/Examples/Physics_applications/laser_acceleration/inputs_3d b/Examples/Physics_applications/laser_acceleration/inputs_base_3d similarity index 100% rename from Examples/Physics_applications/laser_acceleration/inputs_3d rename to Examples/Physics_applications/laser_acceleration/inputs_base_3d diff --git a/Examples/Physics_applications/laser_acceleration/inputs_rz b/Examples/Physics_applications/laser_acceleration/inputs_base_rz similarity index 100% rename from Examples/Physics_applications/laser_acceleration/inputs_rz rename to Examples/Physics_applications/laser_acceleration/inputs_base_rz diff --git a/Examples/Physics_applications/laser_acceleration/inputs_1d b/Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration similarity index 100% rename from Examples/Physics_applications/laser_acceleration/inputs_1d rename to Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration diff --git a/Examples/Physics_applications/laser_acceleration/inputs_1d_fluids b/Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration_fluid similarity index 100% rename from Examples/Physics_applications/laser_acceleration/inputs_1d_fluids rename to Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration_fluid diff --git a/Examples/Physics_applications/laser_acceleration/inputs_1d_fluids_boosted b/Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration_fluid_boosted similarity index 100% rename from Examples/Physics_applications/laser_acceleration/inputs_1d_fluids_boosted rename to Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration_fluid_boosted diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py b/Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration_picmi.py similarity index 95% rename from Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py rename to Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration_picmi.py index 328817c7b49..b7b86b47821 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py +++ b/Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration_picmi.py @@ -82,16 +82,12 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=100, - write_dir=".", - warpx_file_prefix="Python_LaserAcceleration_1d_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=100, data_list=diag_field_list, - write_dir=".", - warpx_file_prefix="Python_LaserAcceleration_1d_plt", ) # Set up simulation diff --git a/Examples/Physics_applications/laser_acceleration/inputs_2d_boost b/Examples/Physics_applications/laser_acceleration/inputs_test_2d_laser_acceleration_boosted similarity index 98% rename from Examples/Physics_applications/laser_acceleration/inputs_2d_boost rename to Examples/Physics_applications/laser_acceleration/inputs_test_2d_laser_acceleration_boosted index c2aa92c3634..1997054e885 100644 --- a/Examples/Physics_applications/laser_acceleration/inputs_2d_boost +++ b/Examples/Physics_applications/laser_acceleration/inputs_test_2d_laser_acceleration_boosted @@ -1,9 +1,9 @@ ################################# ######### BOX PARAMETERS ######## ################################# -max_step = 2700 +max_step = 300 #2700 # stop_time = 1.9e-12 -amr.n_cell = 128 1024 +amr.n_cell = 64 512 #128 1024 amr.max_grid_size = 64 amr.blocking_factor = 32 amr.max_level = 0 diff --git a/Examples/Physics_applications/laser_acceleration/inputs_test_2d_laser_acceleration_mr b/Examples/Physics_applications/laser_acceleration/inputs_test_2d_laser_acceleration_mr new file mode 100644 index 00000000000..5a98fa590ee --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/inputs_test_2d_laser_acceleration_mr @@ -0,0 +1,2 @@ +# base input parameters +FILE = inputs_base_2d diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py b/Examples/Physics_applications/laser_acceleration/inputs_test_2d_laser_acceleration_mr_picmi.py similarity index 96% rename from Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py rename to Examples/Physics_applications/laser_acceleration/inputs_test_2d_laser_acceleration_mr_picmi.py index 5e961fea826..8d112c0ac09 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py +++ b/Examples/Physics_applications/laser_acceleration/inputs_test_2d_laser_acceleration_mr_picmi.py @@ -117,16 +117,12 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=200, - write_dir=".", - warpx_file_prefix="Python_LaserAccelerationMR_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=200, data_list=diag_field_list, - write_dir=".", - warpx_file_prefix="Python_LaserAccelerationMR_plt", ) # Set up simulation diff --git a/Examples/Physics_applications/laser_acceleration/inputs_test_2d_refined_injection b/Examples/Physics_applications/laser_acceleration/inputs_test_2d_refined_injection new file mode 100644 index 00000000000..ed836e87e6b --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/inputs_test_2d_refined_injection @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +amr.ref_ratio_vect = 2 1 +warpx.refine_plasma = 1 diff --git a/Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration b/Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration new file mode 100644 index 00000000000..7665a846eef --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration @@ -0,0 +1,2 @@ +# base input parameters +FILE = inputs_base_3d diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py b/Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py similarity index 96% rename from Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py rename to Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py index 4a736b7cc2b..999c92600e2 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py +++ b/Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py @@ -117,16 +117,12 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=100, - write_dir=".", - warpx_file_prefix="Python_LaserAcceleration_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=100, data_list=diag_field_list, - write_dir=".", - warpx_file_prefix="Python_LaserAcceleration_plt", ) # Set up simulation diff --git a/Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_single_precision_comms b/Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_single_precision_comms new file mode 100644 index 00000000000..99155ed0ecc --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_single_precision_comms @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +warpx.do_single_precision_comms = 1 diff --git a/Examples/Physics_applications/laser_acceleration/inputs_test_rz_laser_acceleration b/Examples/Physics_applications/laser_acceleration/inputs_test_rz_laser_acceleration new file mode 100644 index 00000000000..5879688b00a --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/inputs_test_rz_laser_acceleration @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_rz + +# test input parameters +diag1.dump_rz_modes = 1 +warpx.abort_on_warning_threshold = high diff --git a/Examples/Physics_applications/laser_acceleration/inputs_test_rz_laser_acceleration_opmd b/Examples/Physics_applications/laser_acceleration/inputs_test_rz_laser_acceleration_opmd new file mode 100644 index 00000000000..16a84950996 --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/inputs_test_rz_laser_acceleration_opmd @@ -0,0 +1,9 @@ +# base input parameters +FILE = inputs_base_rz + +# test input parameters +diag1.fields_to_plot = Er Bt Bz jr jt jz rho part_per_cell part_per_grid rho_beam rho_electrons +diag1.format = openpmd +diag1.openpmd_backend = h5 +max_step = 20 +warpx.abort_on_warning_threshold = high diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py b/Examples/Physics_applications/laser_acceleration/inputs_test_rz_laser_acceleration_picmi.py similarity index 96% rename from Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py rename to Examples/Physics_applications/laser_acceleration/inputs_test_rz_laser_acceleration_picmi.py index c19dc09dcb1..cfbf9879ed4 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py +++ b/Examples/Physics_applications/laser_acceleration/inputs_test_rz_laser_acceleration_picmi.py @@ -116,8 +116,6 @@ period=10, data_list=diag_field_list, warpx_dump_rz_modes=1, - write_dir=".", - warpx_file_prefix="Python_LaserAccelerationRZ_plt", ) diag_particle_list = ["weighting", "momentum"] particle_diag = picmi.ParticleDiagnostic( @@ -125,8 +123,6 @@ period=10, species=[electrons, beam], data_list=diag_particle_list, - write_dir=".", - warpx_file_prefix="Python_LaserAccelerationRZ_plt", ) # Set up simulation diff --git a/Examples/Physics_applications/laser_ion/CMakeLists.txt b/Examples/Physics_applications/laser_ion/CMakeLists.txt new file mode 100644 index 00000000000..ba51e4d1398 --- /dev/null +++ b/Examples/Physics_applications/laser_ion/CMakeLists.txt @@ -0,0 +1,24 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_laser_ion_acc # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_laser_ion_acc # inputs + analysis_default_openpmd_regression.py # analysis + diags/diag1/ # output + OFF # dependency +) + +add_warpx_test( + test_2d_laser_ion_acc_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_laser_ion_acc_picmi.py # inputs + analysis_default_openpmd_regression.py # analysis + diags/diag1/ # output + OFF # dependency +) diff --git a/Examples/Physics_applications/laser_ion/README.rst b/Examples/Physics_applications/laser_ion/README similarity index 100% rename from Examples/Physics_applications/laser_ion/README.rst rename to Examples/Physics_applications/laser_ion/README diff --git a/Examples/Physics_applications/laser_ion/analysis_default_openpmd_regression.py b/Examples/Physics_applications/laser_ion/analysis_default_openpmd_regression.py new file mode 120000 index 00000000000..73e5ec47001 --- /dev/null +++ b/Examples/Physics_applications/laser_ion/analysis_default_openpmd_regression.py @@ -0,0 +1 @@ +../../analysis_default_openpmd_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/laser_ion/inputs_2d b/Examples/Physics_applications/laser_ion/inputs_test_2d_laser_ion_acc similarity index 100% rename from Examples/Physics_applications/laser_ion/inputs_2d rename to Examples/Physics_applications/laser_ion/inputs_test_2d_laser_ion_acc diff --git a/Examples/Physics_applications/laser_ion/PICMI_inputs_2d.py b/Examples/Physics_applications/laser_ion/inputs_test_2d_laser_ion_acc_picmi.py similarity index 98% rename from Examples/Physics_applications/laser_ion/PICMI_inputs_2d.py rename to Examples/Physics_applications/laser_ion/inputs_test_2d_laser_ion_acc_picmi.py index e268d1d6c69..04f9111ec5f 100755 --- a/Examples/Physics_applications/laser_ion/PICMI_inputs_2d.py +++ b/Examples/Physics_applications/laser_ion/inputs_test_2d_laser_ion_acc_picmi.py @@ -140,9 +140,8 @@ # Diagnostics particle_diag = picmi.ParticleDiagnostic( - name="Python_LaserIonAcc2d_plt", + name="diag1", period=100, - write_dir="./diags", warpx_format="openpmd", warpx_openpmd_backend="h5", # demonstration of a spatial and momentum filter @@ -154,12 +153,11 @@ for ncell_comp, cr in zip([nx, nz], coarsening_ratio): ncell_field.append(int(ncell_comp / cr)) field_diag = picmi.FieldDiagnostic( - name="Python_LaserIonAcc2d_plt", + name="diag1", grid=grid, period=100, number_of_cells=ncell_field, data_list=["B", "E", "J", "rho", "rho_electrons", "rho_hydrogen"], - write_dir="./diags", warpx_format="openpmd", warpx_openpmd_backend="h5", ) @@ -167,7 +165,6 @@ particle_fw_diag = picmi.ParticleDiagnostic( name="openPMDfw", period=100, - write_dir="./diags", warpx_format="openpmd", warpx_openpmd_backend="h5", warpx_plot_filter_function="(uz>=0) * (x<1.0e-6) * (x>-1.0e-6)", @@ -176,7 +173,6 @@ particle_bw_diag = picmi.ParticleDiagnostic( name="openPMDbw", period=100, - write_dir="./diags", warpx_format="openpmd", warpx_openpmd_backend="h5", warpx_plot_filter_function="(uz<0)", diff --git a/Examples/Physics_applications/plasma_acceleration/CMakeLists.txt b/Examples/Physics_applications/plasma_acceleration/CMakeLists.txt new file mode 100644 index 00000000000..ec3e4b09563 --- /dev/null +++ b/Examples/Physics_applications/plasma_acceleration/CMakeLists.txt @@ -0,0 +1,90 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_plasma_acceleration_picmi # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_plasma_acceleration_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1001000 # output + OFF # dependency +) + +add_warpx_test( + test_2d_plasma_acceleration_boosted # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_plasma_acceleration_boosted # inputs + analysis_default_regression.py # analysis + diags/diag1000020 # output + OFF # dependency +) + +add_warpx_test( + test_2d_plasma_acceleration_mr # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_plasma_acceleration_mr # inputs + analysis_default_regression.py # analysis + diags/diag1000400 # output + OFF # dependency +) + +add_warpx_test( + test_2d_plasma_acceleration_mr_momentum_conserving # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_plasma_acceleration_mr_momentum_conserving # inputs + analysis_default_regression.py # analysis + diags/diag1000400 # output + OFF # dependency +) + +add_warpx_test( + test_3d_plasma_acceleration_boosted # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_plasma_acceleration_boosted # inputs + analysis_default_regression.py # analysis + diags/diag1000005 # output + OFF # dependency +) + +add_warpx_test( + test_3d_plasma_acceleration_boosted_hybrid # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_plasma_acceleration_boosted_hybrid # inputs + analysis_default_regression.py # analysis + diags/diag1000025 # output + OFF # dependency +) + +add_warpx_test( + test_3d_plasma_acceleration_mr_picmi # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_plasma_acceleration_mr_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000002 # output + OFF # dependency +) + +add_warpx_test( + test_3d_plasma_acceleration_picmi # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_plasma_acceleration_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency +) diff --git a/Examples/Physics_applications/plasma_acceleration/README.rst b/Examples/Physics_applications/plasma_acceleration/README similarity index 100% rename from Examples/Physics_applications/plasma_acceleration/README.rst rename to Examples/Physics_applications/plasma_acceleration/README diff --git a/Examples/Physics_applications/plasma_acceleration/analysis_default_regression.py b/Examples/Physics_applications/plasma_acceleration/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Physics_applications/plasma_acceleration/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/plasma_acceleration/inputs_2d b/Examples/Physics_applications/plasma_acceleration/inputs_base_2d similarity index 96% rename from Examples/Physics_applications/plasma_acceleration/inputs_2d rename to Examples/Physics_applications/plasma_acceleration/inputs_base_2d index 7e11ae7b3de..769e1ebce37 100644 --- a/Examples/Physics_applications/plasma_acceleration/inputs_2d +++ b/Examples/Physics_applications/plasma_acceleration/inputs_base_2d @@ -1,11 +1,12 @@ ################################# ####### GENERAL PARAMETERS ###### ################################# -stop_time = 3.7e-12 -amr.n_cell = 64 128 +#stop_time = 3.7e-12 +max_step = 400 +amr.n_cell = 32 512 #64 128 amr.max_grid_size = 128 amr.blocking_factor = 32 -amr.max_level = 0 +amr.max_level = 1 geometry.dims = 2 geometry.prob_lo = -125.e-6 -149.e-6 geometry.prob_hi = 125.e-6 1.e-6 diff --git a/Examples/Physics_applications/plasma_acceleration/inputs_3d_boost b/Examples/Physics_applications/plasma_acceleration/inputs_base_3d similarity index 99% rename from Examples/Physics_applications/plasma_acceleration/inputs_3d_boost rename to Examples/Physics_applications/plasma_acceleration/inputs_base_3d index 2264872ec43..66debc4f99f 100644 --- a/Examples/Physics_applications/plasma_acceleration/inputs_3d_boost +++ b/Examples/Physics_applications/plasma_acceleration/inputs_base_3d @@ -2,7 +2,7 @@ ####### GENERAL PARAMETERS ###### ################################# stop_time = 3.93151387287e-11 -amr.n_cell = 32 32 256 +amr.n_cell = 64 64 128 #32 32 256 amr.max_grid_size = 64 amr.blocking_factor = 32 amr.max_level = 0 diff --git a/Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration_1d.py b/Examples/Physics_applications/plasma_acceleration/inputs_test_1d_plasma_acceleration_picmi.py similarity index 96% rename from Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration_1d.py rename to Examples/Physics_applications/plasma_acceleration/inputs_test_1d_plasma_acceleration_picmi.py index 7bb08bc2e8e..4bde8cb1343 100755 --- a/Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration_1d.py +++ b/Examples/Physics_applications/plasma_acceleration/inputs_test_1d_plasma_acceleration_picmi.py @@ -78,8 +78,6 @@ grid=grid, period=max_steps, data_list=["Ex", "Ey", "Ez", "Jx", "Jy", "Jz", "part_per_cell"], - write_dir=".", - warpx_file_prefix="Python_PlasmaAcceleration1d_plt", ) part_diag = picmi.ParticleDiagnostic( diff --git a/Examples/Physics_applications/plasma_acceleration/inputs_2d_boost b/Examples/Physics_applications/plasma_acceleration/inputs_test_2d_plasma_acceleration_boosted similarity index 98% rename from Examples/Physics_applications/plasma_acceleration/inputs_2d_boost rename to Examples/Physics_applications/plasma_acceleration/inputs_test_2d_plasma_acceleration_boosted index 76dcd3ee286..5d65649353c 100644 --- a/Examples/Physics_applications/plasma_acceleration/inputs_2d_boost +++ b/Examples/Physics_applications/plasma_acceleration/inputs_test_2d_plasma_acceleration_boosted @@ -1,8 +1,8 @@ ################################# ####### GENERAL PARAMETERS ###### ################################# -max_step = 2500 -amr.n_cell = 64 640 +max_step = 20 #2500 +amr.n_cell = 64 256 #64 640 amr.max_grid_size = 128 amr.blocking_factor = 32 amr.max_level = 0 diff --git a/Examples/Physics_applications/plasma_acceleration/inputs_test_2d_plasma_acceleration_mr b/Examples/Physics_applications/plasma_acceleration/inputs_test_2d_plasma_acceleration_mr new file mode 100644 index 00000000000..5a98fa590ee --- /dev/null +++ b/Examples/Physics_applications/plasma_acceleration/inputs_test_2d_plasma_acceleration_mr @@ -0,0 +1,2 @@ +# base input parameters +FILE = inputs_base_2d diff --git a/Examples/Physics_applications/plasma_acceleration/inputs_test_2d_plasma_acceleration_mr_momentum_conserving b/Examples/Physics_applications/plasma_acceleration/inputs_test_2d_plasma_acceleration_mr_momentum_conserving new file mode 100644 index 00000000000..c21068325a0 --- /dev/null +++ b/Examples/Physics_applications/plasma_acceleration/inputs_test_2d_plasma_acceleration_mr_momentum_conserving @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.field_gathering = momentum-conserving diff --git a/Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_boosted b/Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_boosted new file mode 100644 index 00000000000..62abe8e9df8 --- /dev/null +++ b/Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_boosted @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +max_step = 5 diff --git a/Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_boosted_hybrid b/Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_boosted_hybrid new file mode 100644 index 00000000000..3c085b64b1b --- /dev/null +++ b/Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_boosted_hybrid @@ -0,0 +1,7 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +max_step = 25 +warpx.do_current_centering = 0 +warpx.grid_type = hybrid diff --git a/Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration_mr.py b/Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_mr_picmi.py similarity index 97% rename from Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration_mr.py rename to Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_mr_picmi.py index df5e9e9808c..9eb640ade95 100755 --- a/Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration_mr.py +++ b/Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_mr_picmi.py @@ -89,8 +89,6 @@ grid=grid, period=2, data_list=["Ex", "Ey", "Ez", "Jx", "Jy", "Jz", "part_per_cell"], - write_dir=".", - warpx_file_prefix="Python_PlasmaAccelerationMR_plt", ) part_diag = picmi.ParticleDiagnostic( diff --git a/Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration.py b/Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_picmi.py similarity index 97% rename from Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration.py rename to Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_picmi.py index 596f6962618..d5b99dbed97 100755 --- a/Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration.py +++ b/Examples/Physics_applications/plasma_acceleration/inputs_test_3d_plasma_acceleration_picmi.py @@ -84,8 +84,6 @@ grid=grid, period=max_steps, data_list=["Ex", "Ey", "Ez", "Jx", "Jy", "Jz", "part_per_cell"], - write_dir=".", - warpx_file_prefix="Python_PlasmaAcceleration_plt", ) part_diag = picmi.ParticleDiagnostic( diff --git a/Examples/Physics_applications/plasma_mirror/CMakeLists.txt b/Examples/Physics_applications/plasma_mirror/CMakeLists.txt new file mode 100644 index 00000000000..b90e775a4b5 --- /dev/null +++ b/Examples/Physics_applications/plasma_mirror/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_plasma_mirror # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_plasma_mirror # inputs + analysis_default_regression.py # analysis + diags/diag1000020 # output + OFF # dependency +) diff --git a/Examples/Physics_applications/plasma_mirror/README.rst b/Examples/Physics_applications/plasma_mirror/README similarity index 100% rename from Examples/Physics_applications/plasma_mirror/README.rst rename to Examples/Physics_applications/plasma_mirror/README diff --git a/Examples/Physics_applications/plasma_mirror/analysis_default_regression.py b/Examples/Physics_applications/plasma_mirror/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Physics_applications/plasma_mirror/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/plasma_mirror/inputs_2d b/Examples/Physics_applications/plasma_mirror/inputs_test_2d_plasma_mirror similarity index 98% rename from Examples/Physics_applications/plasma_mirror/inputs_2d rename to Examples/Physics_applications/plasma_mirror/inputs_test_2d_plasma_mirror index 714af80affe..c2c67fe928c 100644 --- a/Examples/Physics_applications/plasma_mirror/inputs_2d +++ b/Examples/Physics_applications/plasma_mirror/inputs_test_2d_plasma_mirror @@ -1,8 +1,8 @@ ################################# ####### GENERAL PARAMETERS ###### ################################# -max_step = 1000 -amr.n_cell = 1024 512 +max_step = 20 #1000 +amr.n_cell = 256 128 #1024 512 amr.max_grid_size = 128 amr.blocking_factor = 32 amr.max_level = 0 diff --git a/Examples/Physics_applications/spacecraft_charging/CMakeLists.txt b/Examples/Physics_applications/spacecraft_charging/CMakeLists.txt new file mode 100644 index 00000000000..181304e9193 --- /dev/null +++ b/Examples/Physics_applications/spacecraft_charging/CMakeLists.txt @@ -0,0 +1,15 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) +add_warpx_test( + test_rz_spacecraft_charging_picmi # name + RZ # dims + 2 # nprocs + ON # eb + inputs_test_rz_spacecraft_charging_picmi.py # inputs + analysis.py # analysis + diags/diag1/ # output + OFF # dependency +) +endif() diff --git a/Examples/Physics_applications/spacecraft_charging/analysis.py b/Examples/Physics_applications/spacecraft_charging/analysis.py index 11374d9fc95..6528a3bde65 100755 --- a/Examples/Physics_applications/spacecraft_charging/analysis.py +++ b/Examples/Physics_applications/spacecraft_charging/analysis.py @@ -30,7 +30,7 @@ test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, filename, output_format="openpmd") -ts = OpenPMDTimeSeries("./spacecraft_charging_plt") +ts = OpenPMDTimeSeries(filename) dt = 1.27e-8 t = [] phi = [] diff --git a/Examples/Physics_applications/spacecraft_charging/PICMI_inputs_rz.py b/Examples/Physics_applications/spacecraft_charging/inputs_test_rz_spacecraft_charging_picmi.py similarity index 98% rename from Examples/Physics_applications/spacecraft_charging/PICMI_inputs_rz.py rename to Examples/Physics_applications/spacecraft_charging/inputs_test_rz_spacecraft_charging_picmi.py index b44158284fe..e3bc888f600 100644 --- a/Examples/Physics_applications/spacecraft_charging/PICMI_inputs_rz.py +++ b/Examples/Physics_applications/spacecraft_charging/inputs_test_rz_spacecraft_charging_picmi.py @@ -262,8 +262,6 @@ def compute_actual_charge_on_spacecraft(): period=diagnostic_interval, data_list=["Er", "Ez", "phi", "rho", "rho_electrons", "rho_protons"], warpx_format="openpmd", - write_dir=".", - warpx_file_prefix="spacecraft_charging_plt", ) part_diag = picmi.ParticleDiagnostic( @@ -271,8 +269,6 @@ def compute_actual_charge_on_spacecraft(): period=diagnostic_interval, species=[electrons, protons], warpx_format="openpmd", - write_dir=".", - warpx_file_prefix="spacecraft_charging_plt", ) part_scraping_boundary_diag = picmi.ParticleBoundaryScrapingDiagnostic( diff --git a/Examples/Physics_applications/uniform_plasma/CMakeLists.txt b/Examples/Physics_applications/uniform_plasma/CMakeLists.txt new file mode 100644 index 00000000000..f654dc79063 --- /dev/null +++ b/Examples/Physics_applications/uniform_plasma/CMakeLists.txt @@ -0,0 +1,35 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_uniform_plasma # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_uniform_plasma # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency +) + +add_warpx_test( + test_3d_uniform_plasma # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_uniform_plasma # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency +) + +add_warpx_test( + test_3d_uniform_plasma_restart # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_uniform_plasma_restart # inputs + analysis_default_restart.py # analysis + diags/diag1000010 # output + test_3d_uniform_plasma # dependency +) diff --git a/Examples/Physics_applications/uniform_plasma/README.rst b/Examples/Physics_applications/uniform_plasma/README similarity index 100% rename from Examples/Physics_applications/uniform_plasma/README.rst rename to Examples/Physics_applications/uniform_plasma/README diff --git a/Examples/Physics_applications/uniform_plasma/analysis_default_regression.py b/Examples/Physics_applications/uniform_plasma/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Physics_applications/uniform_plasma/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/uniform_plasma/analysis_default_restart.py b/Examples/Physics_applications/uniform_plasma/analysis_default_restart.py new file mode 120000 index 00000000000..0459986eebc --- /dev/null +++ b/Examples/Physics_applications/uniform_plasma/analysis_default_restart.py @@ -0,0 +1 @@ +../../analysis_default_restart.py \ No newline at end of file diff --git a/Examples/Physics_applications/uniform_plasma/inputs_3d b/Examples/Physics_applications/uniform_plasma/inputs_base_3d similarity index 100% rename from Examples/Physics_applications/uniform_plasma/inputs_3d rename to Examples/Physics_applications/uniform_plasma/inputs_base_3d diff --git a/Examples/Physics_applications/uniform_plasma/inputs_2d b/Examples/Physics_applications/uniform_plasma/inputs_test_2d_uniform_plasma similarity index 100% rename from Examples/Physics_applications/uniform_plasma/inputs_2d rename to Examples/Physics_applications/uniform_plasma/inputs_test_2d_uniform_plasma diff --git a/Examples/Physics_applications/uniform_plasma/inputs_test_3d_uniform_plasma b/Examples/Physics_applications/uniform_plasma/inputs_test_3d_uniform_plasma new file mode 100644 index 00000000000..7665a846eef --- /dev/null +++ b/Examples/Physics_applications/uniform_plasma/inputs_test_3d_uniform_plasma @@ -0,0 +1,2 @@ +# base input parameters +FILE = inputs_base_3d diff --git a/Examples/Physics_applications/uniform_plasma/inputs_test_3d_uniform_plasma_restart b/Examples/Physics_applications/uniform_plasma/inputs_test_3d_uniform_plasma_restart new file mode 100644 index 00000000000..4711ece3843 --- /dev/null +++ b/Examples/Physics_applications/uniform_plasma/inputs_test_3d_uniform_plasma_restart @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_test_3d_uniform_plasma + +# test input parameters +amr.restart = "../test_3d_uniform_plasma/diags/chk000006" diff --git a/Examples/Tests/CMakeLists.txt b/Examples/Tests/CMakeLists.txt new file mode 100644 index 00000000000..108a28a6539 --- /dev/null +++ b/Examples/Tests/CMakeLists.txt @@ -0,0 +1,78 @@ +# Add tests (alphabetical order) ############################################## +# + +add_subdirectory(accelerator_lattice) +add_subdirectory(boosted_diags) +add_subdirectory(boundaries) +add_subdirectory(btd_rz) +add_subdirectory(collider_relevant_diags) +add_subdirectory(collision) +add_subdirectory(diff_lumi_diag) +add_subdirectory(divb_cleaning) +add_subdirectory(dive_cleaning) +add_subdirectory(electrostatic_dirichlet_bc) +add_subdirectory(electrostatic_sphere) +add_subdirectory(electrostatic_sphere_eb) +add_subdirectory(embedded_boundary_cube) +add_subdirectory(embedded_boundary_diffraction) +add_subdirectory(embedded_boundary_python_api) +add_subdirectory(embedded_boundary_rotated_cube) +add_subdirectory(embedded_circle) +add_subdirectory(energy_conserving_thermal_plasma) +add_subdirectory(field_probe) +add_subdirectory(flux_injection) +add_subdirectory(gaussian_beam) +add_subdirectory(implicit) +add_subdirectory(initial_distribution) +add_subdirectory(initial_plasma_profile) +add_subdirectory(ionization) +add_subdirectory(ion_stopping) +add_subdirectory(langmuir) +add_subdirectory(langmuir_fluids) +add_subdirectory(larmor) +add_subdirectory(laser_injection) +add_subdirectory(laser_injection_from_file) +add_subdirectory(laser_on_fine) +add_subdirectory(load_external_field) +add_subdirectory(magnetostatic_eb) +add_subdirectory(maxwell_hybrid_qed) +add_subdirectory(nci_fdtd_stability) +add_subdirectory(nci_psatd_stability) +add_subdirectory(nodal_electrostatic) +add_subdirectory(nuclear_fusion) +add_subdirectory(ohm_solver_em_modes) +add_subdirectory(ohm_solver_ion_beam_instability) +add_subdirectory(ohm_solver_ion_Landau_damping) +add_subdirectory(ohm_solver_magnetic_reconnection) +add_subdirectory(open_bc_poisson_solver) +add_subdirectory(particle_boundary_interaction) +add_subdirectory(particle_boundary_process) +add_subdirectory(particle_boundary_scrape) +add_subdirectory(particle_data_python) +add_subdirectory(particle_fields_diags) +add_subdirectory(particle_pusher) +add_subdirectory(particle_thermal_boundary) +add_subdirectory(particles_in_pml) +add_subdirectory(pass_mpi_communicator) +add_subdirectory(pec) +add_subdirectory(photon_pusher) +add_subdirectory(plasma_lens) +add_subdirectory(pml) +add_subdirectory(point_of_contact_eb) +add_subdirectory(projection_divb_cleaner) +add_subdirectory(python_wrappers) +add_subdirectory(qed) +add_subdirectory(radiation_reaction) +add_subdirectory(reduced_diags) +add_subdirectory(relativistic_space_charge_initialization) +add_subdirectory(repelling_particles) +add_subdirectory(resampling) +add_subdirectory(restart) +add_subdirectory(restart_eb) +add_subdirectory(rigid_injection) +add_subdirectory(scraping) +add_subdirectory(silver_mueller) +add_subdirectory(single_particle) +add_subdirectory(space_charge_initialization) +add_subdirectory(subcycling) +add_subdirectory(vay_deposition) diff --git a/Examples/Tests/accelerator_lattice/CMakeLists.txt b/Examples/Tests/accelerator_lattice/CMakeLists.txt new file mode 100644 index 00000000000..7fc6b4dc8e4 --- /dev/null +++ b/Examples/Tests/accelerator_lattice/CMakeLists.txt @@ -0,0 +1,35 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_hard_edged_quadrupoles # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_hard_edged_quadrupoles # inputs + analysis.py # analysis + diags/diag1000050 # output + OFF # dependency +) + +add_warpx_test( + test_3d_hard_edged_quadrupoles_boosted # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_hard_edged_quadrupoles_boosted # inputs + analysis.py # analysis + diags/diag1000050 # output + OFF # dependency +) + +add_warpx_test( + test_3d_hard_edged_quadrupoles_moving # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_hard_edged_quadrupoles_moving # inputs + analysis.py # analysis + diags/diag1000050 # output + OFF # dependency +) diff --git a/Examples/Tests/AcceleratorLattice/analysis.py b/Examples/Tests/accelerator_lattice/analysis.py similarity index 100% rename from Examples/Tests/AcceleratorLattice/analysis.py rename to Examples/Tests/accelerator_lattice/analysis.py diff --git a/Examples/Tests/AcceleratorLattice/inputs_quad_3d b/Examples/Tests/accelerator_lattice/inputs_test_3d_hard_edged_quadrupoles similarity index 100% rename from Examples/Tests/AcceleratorLattice/inputs_quad_3d rename to Examples/Tests/accelerator_lattice/inputs_test_3d_hard_edged_quadrupoles diff --git a/Examples/Tests/AcceleratorLattice/inputs_quad_boosted_3d b/Examples/Tests/accelerator_lattice/inputs_test_3d_hard_edged_quadrupoles_boosted similarity index 100% rename from Examples/Tests/AcceleratorLattice/inputs_quad_boosted_3d rename to Examples/Tests/accelerator_lattice/inputs_test_3d_hard_edged_quadrupoles_boosted diff --git a/Examples/Tests/AcceleratorLattice/inputs_quad_moving_3d b/Examples/Tests/accelerator_lattice/inputs_test_3d_hard_edged_quadrupoles_moving similarity index 100% rename from Examples/Tests/AcceleratorLattice/inputs_quad_moving_3d rename to Examples/Tests/accelerator_lattice/inputs_test_3d_hard_edged_quadrupoles_moving diff --git a/Examples/Tests/boosted_diags/CMakeLists.txt b/Examples/Tests/boosted_diags/CMakeLists.txt new file mode 100644 index 00000000000..f0a6ceaf397 --- /dev/null +++ b/Examples/Tests/boosted_diags/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_laser_acceleration_btd # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_laser_acceleration_btd # inputs + analysis.py # analysis + diags/diag1000003 # output + OFF # dependency +) diff --git a/Examples/Tests/boosted_diags/inputs_3d b/Examples/Tests/boosted_diags/inputs_test_3d_laser_acceleration_btd similarity index 100% rename from Examples/Tests/boosted_diags/inputs_3d rename to Examples/Tests/boosted_diags/inputs_test_3d_laser_acceleration_btd diff --git a/Examples/Tests/boundaries/CMakeLists.txt b/Examples/Tests/boundaries/CMakeLists.txt new file mode 100644 index 00000000000..928b4b95071 --- /dev/null +++ b/Examples/Tests/boundaries/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_particle_boundaries # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_particle_boundaries # inputs + analysis.py # analysis + diags/diag1000008 # output + OFF # dependency +) diff --git a/Examples/Tests/boundaries/inputs_3d b/Examples/Tests/boundaries/inputs_test_3d_particle_boundaries similarity index 100% rename from Examples/Tests/boundaries/inputs_3d rename to Examples/Tests/boundaries/inputs_test_3d_particle_boundaries diff --git a/Examples/Tests/btd_rz/CMakeLists.txt b/Examples/Tests/btd_rz/CMakeLists.txt new file mode 100644 index 00000000000..15a01eb1680 --- /dev/null +++ b/Examples/Tests/btd_rz/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_rz_btd # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_btd # inputs + analysis.py # analysis + diags/diag1000289 # output + OFF # dependency +) diff --git a/Examples/Tests/btd_rz/analysis_BTD_laser_antenna.py b/Examples/Tests/btd_rz/analysis.py similarity index 100% rename from Examples/Tests/btd_rz/analysis_BTD_laser_antenna.py rename to Examples/Tests/btd_rz/analysis.py diff --git a/Examples/Tests/btd_rz/inputs_rz_z_boosted_BTD b/Examples/Tests/btd_rz/inputs_test_rz_btd similarity index 100% rename from Examples/Tests/btd_rz/inputs_rz_z_boosted_BTD rename to Examples/Tests/btd_rz/inputs_test_rz_btd diff --git a/Examples/Tests/collider_relevant_diags/CMakeLists.txt b/Examples/Tests/collider_relevant_diags/CMakeLists.txt new file mode 100644 index 00000000000..ad999477507 --- /dev/null +++ b/Examples/Tests/collider_relevant_diags/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_collider_diagnostics # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_collider_diagnostics # inputs + analysis.py # analysis + diags/diag1000001 # output + OFF # dependency +) diff --git a/Examples/Tests/collider_relevant_diags/analysis_multiple_particles.py b/Examples/Tests/collider_relevant_diags/analysis.py similarity index 99% rename from Examples/Tests/collider_relevant_diags/analysis_multiple_particles.py rename to Examples/Tests/collider_relevant_diags/analysis.py index ab624bdac7e..f6eb9de124f 100755 --- a/Examples/Tests/collider_relevant_diags/analysis_multiple_particles.py +++ b/Examples/Tests/collider_relevant_diags/analysis.py @@ -61,7 +61,7 @@ def dL_dt(): return lumi -input_dict = parse_input_file("inputs_3d_multiple_particles") +input_dict = parse_input_file("warpx_used_inputs") Ex, Ey, Ez = [float(w) for w in input_dict["particles.E_external_particle"]] Bx, By, Bz = [float(w) for w in input_dict["particles.B_external_particle"]] diff --git a/Examples/Tests/collider_relevant_diags/inputs_3d_multiple_particles b/Examples/Tests/collider_relevant_diags/inputs_test_3d_collider_diagnostics similarity index 99% rename from Examples/Tests/collider_relevant_diags/inputs_3d_multiple_particles rename to Examples/Tests/collider_relevant_diags/inputs_test_3d_collider_diagnostics index 1efc68c33b0..d88e0b767d6 100644 --- a/Examples/Tests/collider_relevant_diags/inputs_3d_multiple_particles +++ b/Examples/Tests/collider_relevant_diags/inputs_test_3d_collider_diagnostics @@ -18,6 +18,7 @@ geometry.prob_lo = 0 0 0 geometry.prob_hi = 8 8 8 particles.do_tiling = 0 warpx.use_filter = 0 +warpx.abort_on_warning_threshold = high ################################# ######## BOUNDARY CONDITION ##### diff --git a/Examples/Tests/collision/CMakeLists.txt b/Examples/Tests/collision/CMakeLists.txt new file mode 100644 index 00000000000..4293ba248e7 --- /dev/null +++ b/Examples/Tests/collision/CMakeLists.txt @@ -0,0 +1,68 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_collision_z # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_collision_z # inputs + analysis_collision_1d.py # analysis + diags/diag1000600 # output + OFF # dependency +) + +add_warpx_test( + test_2d_collision_xz # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_collision_xz # inputs + analysis_collision_2d.py # analysis + diags/diag1000150 # output + OFF # dependency +) + +add_warpx_test( + test_2d_collision_xz_picmi # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_collision_xz_picmi.py # inputs + analysis_collision_2d.py # analysis + diags/diag1000150 # output + OFF # dependency +) + +add_warpx_test( + test_3d_collision_iso # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_collision_iso # inputs + analysis_collision_3d_isotropization.py # analysis + diags/diag1000100 # output + OFF # dependency +) + +add_warpx_test( + test_3d_collision_xyz # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_collision_xyz # inputs + analysis_collision_3d.py # analysis + diags/diag1000150 # output + OFF # dependency +) + +add_warpx_test( + test_rz_collision # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_collision # inputs + analysis_collision_rz.py # analysis + diags/diag1000150 # output + OFF # dependency +) diff --git a/Examples/Tests/collision/analysis_collision_2d.py b/Examples/Tests/collision/analysis_collision_2d.py index 92153f0870e..7e1d74001a3 100755 --- a/Examples/Tests/collision/analysis_collision_2d.py +++ b/Examples/Tests/collision/analysis_collision_2d.py @@ -35,6 +35,8 @@ sys.path.insert(1, "../../../../warpx/Regression/Checksum/") import checksumAPI +test_name = os.path.split(os.getcwd())[1] + tolerance = 0.001 ng = 64 @@ -62,6 +64,11 @@ # Collect all output files in fn_list (names match pattern prefix + arbitrary number) fn_list = glob.glob(prefix + "*[0-9]") +print(last_fn) +print(last_it) +print(prefix) +print(fn_list) + error = 0.0 nt = 0 for fn in fn_list: @@ -87,7 +94,7 @@ # The second part of the analysis is not done for the Python test # since the particle filter function is not accessible from PICMI yet -if "Python" in last_fn: +if "picmi" in test_name: exit() ## In the second part of the test, we verify that the diagnostic particle filter function works as @@ -114,5 +121,4 @@ last_fn, random_filter_fn, random_fraction, dim, species_name ) -test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, last_fn) diff --git a/Examples/Tests/collision/inputs_1d b/Examples/Tests/collision/inputs_test_1d_collision_z similarity index 100% rename from Examples/Tests/collision/inputs_1d rename to Examples/Tests/collision/inputs_test_1d_collision_z diff --git a/Examples/Tests/collision/inputs_2d b/Examples/Tests/collision/inputs_test_2d_collision_xz similarity index 100% rename from Examples/Tests/collision/inputs_2d rename to Examples/Tests/collision/inputs_test_2d_collision_xz diff --git a/Examples/Tests/collision/PICMI_inputs_2d.py b/Examples/Tests/collision/inputs_test_2d_collision_xz_picmi.py similarity index 94% rename from Examples/Tests/collision/PICMI_inputs_2d.py rename to Examples/Tests/collision/inputs_test_2d_collision_xz_picmi.py index 2a66bea5046..f1b3e8d3b28 100755 --- a/Examples/Tests/collision/PICMI_inputs_2d.py +++ b/Examples/Tests/collision/inputs_test_2d_collision_xz_picmi.py @@ -102,16 +102,12 @@ ######### DIAGNOSTICS ########### ################################# -particle_diag = picmi.ParticleDiagnostic( - name="diag1", period=10, write_dir=".", warpx_file_prefix="Python_collisionXZ_plt" -) +particle_diag = picmi.ParticleDiagnostic(name="diag1", period=10) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=10, data_list=[], - write_dir=".", - warpx_file_prefix="Python_collisionXZ_plt", ) ################################# diff --git a/Examples/Tests/collision/inputs_3d_isotropization b/Examples/Tests/collision/inputs_test_3d_collision_iso similarity index 100% rename from Examples/Tests/collision/inputs_3d_isotropization rename to Examples/Tests/collision/inputs_test_3d_collision_iso diff --git a/Examples/Tests/collision/inputs_3d b/Examples/Tests/collision/inputs_test_3d_collision_xyz similarity index 100% rename from Examples/Tests/collision/inputs_3d rename to Examples/Tests/collision/inputs_test_3d_collision_xyz diff --git a/Examples/Tests/collision/inputs_rz b/Examples/Tests/collision/inputs_test_rz_collision similarity index 100% rename from Examples/Tests/collision/inputs_rz rename to Examples/Tests/collision/inputs_test_rz_collision diff --git a/Examples/Tests/diff_lumi_diag/CMakeLists.txt b/Examples/Tests/diff_lumi_diag/CMakeLists.txt new file mode 100644 index 00000000000..2385a758fb6 --- /dev/null +++ b/Examples/Tests/diff_lumi_diag/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_diff_lumi_diag # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_diff_lumi_diag # inputs + analysis.py # analysis + diags/diag1000080 # output + OFF # dependency +) diff --git a/Examples/Tests/diff_lumi_diag/inputs b/Examples/Tests/diff_lumi_diag/inputs_test_3d_diff_lumi_diag similarity index 100% rename from Examples/Tests/diff_lumi_diag/inputs rename to Examples/Tests/diff_lumi_diag/inputs_test_3d_diff_lumi_diag diff --git a/Examples/Tests/divb_cleaning/CMakeLists.txt b/Examples/Tests/divb_cleaning/CMakeLists.txt new file mode 100644 index 00000000000..f0a8162212f --- /dev/null +++ b/Examples/Tests/divb_cleaning/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_divb_cleaning # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_divb_cleaning # inputs + analysis.py # analysis + diags/diag1000400 # output + OFF # dependency +) diff --git a/Examples/Tests/divb_cleaning/analysis.py b/Examples/Tests/divb_cleaning/analysis.py index 1692d14b632..e534e5b0d59 100755 --- a/Examples/Tests/divb_cleaning/analysis.py +++ b/Examples/Tests/divb_cleaning/analysis.py @@ -24,8 +24,8 @@ fn = sys.argv[1] # Load yt data -ds_old = yt.load("divb_cleaning_3d_plt000398") -ds_mid = yt.load("divb_cleaning_3d_plt000399") +ds_old = yt.load("diags/diag1000398") +ds_mid = yt.load("diags/diag1000399") ds_new = yt.load(fn) # this is the last plotfile ad_old = ds_old.covering_grid( diff --git a/Examples/Tests/divb_cleaning/inputs_3d b/Examples/Tests/divb_cleaning/inputs_test_3d_divb_cleaning similarity index 100% rename from Examples/Tests/divb_cleaning/inputs_3d rename to Examples/Tests/divb_cleaning/inputs_test_3d_divb_cleaning diff --git a/Examples/Tests/dive_cleaning/CMakeLists.txt b/Examples/Tests/dive_cleaning/CMakeLists.txt new file mode 100644 index 00000000000..1e72305b673 --- /dev/null +++ b/Examples/Tests/dive_cleaning/CMakeLists.txt @@ -0,0 +1,24 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_dive_cleaning # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_dive_cleaning # inputs + analysis.py # analysis + diags/diag1000128 # output + OFF # dependency +) + +add_warpx_test( + test_3d_dive_cleaning # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_dive_cleaning # inputs + analysis.py # analysis + diags/diag1000128 # output + OFF # dependency +) diff --git a/Examples/Tests/dive_cleaning/inputs_test_2d_dive_cleaning b/Examples/Tests/dive_cleaning/inputs_test_2d_dive_cleaning new file mode 100644 index 00000000000..48cabee4495 --- /dev/null +++ b/Examples/Tests/dive_cleaning/inputs_test_2d_dive_cleaning @@ -0,0 +1,35 @@ +max_step = 128 +amr.n_cell = 64 64 +amr.max_grid_size = 32 +amr.max_level = 0 + +geometry.prob_lo = -50.e-6 -50.e-6 +geometry.prob_hi = 50.e-6 50.e-6 +geometry.dims = 2 + +boundary.field_lo = pml pml +boundary.field_hi = pml pml + +warpx.do_dive_cleaning = 1 +warpx.use_filter = 0 + +# Order of particle shape factors +algo.particle_shape = 1 + +particles.species_names = beam +beam.charge = -q_e +beam.mass = 1.e30 +beam.injection_style = "gaussian_beam" +beam.x_rms = 2.e-6 +beam.y_rms = 2.e-6 +beam.z_rms = 2.e-6 +beam.x_m = 0. +beam.y_m = 0. +beam.z_m = 0.e-6 +beam.npart = 20000 +beam.q_tot = -1.e-20 +beam.momentum_distribution_type = "at_rest" + +diagnostics.diags_names = diag1 +diag1.intervals = 8 +diag1.diag_type = Full diff --git a/Examples/Tests/dive_cleaning/inputs_3d b/Examples/Tests/dive_cleaning/inputs_test_3d_dive_cleaning similarity index 100% rename from Examples/Tests/dive_cleaning/inputs_3d rename to Examples/Tests/dive_cleaning/inputs_test_3d_dive_cleaning index c3f83ddbdd9..3f22a2206cf 100644 --- a/Examples/Tests/dive_cleaning/inputs_3d +++ b/Examples/Tests/dive_cleaning/inputs_test_3d_dive_cleaning @@ -3,9 +3,9 @@ amr.n_cell = 64 64 64 amr.max_grid_size = 32 amr.max_level = 0 -geometry.dims = 3 geometry.prob_lo = -50.e-6 -50.e-6 -50.e-6 geometry.prob_hi = 50.e-6 50.e-6 50.e-6 +geometry.dims = 3 boundary.field_lo = pml pml pml boundary.field_hi = pml pml pml diff --git a/Examples/Tests/electrostatic_dirichlet_bc/CMakeLists.txt b/Examples/Tests/electrostatic_dirichlet_bc/CMakeLists.txt new file mode 100644 index 00000000000..93e837d4b59 --- /dev/null +++ b/Examples/Tests/electrostatic_dirichlet_bc/CMakeLists.txt @@ -0,0 +1,24 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_dirichlet_bc # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_dirichlet_bc # inputs + analysis.py # analysis + diags/diag1000100 # output + OFF # dependency +) + +add_warpx_test( + test_2d_dirichlet_bc_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_dirichlet_bc_picmi.py # inputs + analysis.py # analysis + diags/diag1000100 # output + OFF # dependency +) diff --git a/Examples/Tests/electrostatic_dirichlet_bc/analysis.py b/Examples/Tests/electrostatic_dirichlet_bc/analysis.py index 91e84fd8864..82fe061c3a8 100755 --- a/Examples/Tests/electrostatic_dirichlet_bc/analysis.py +++ b/Examples/Tests/electrostatic_dirichlet_bc/analysis.py @@ -18,9 +18,7 @@ import numpy as np import yt -files = sorted(glob.glob("dirichletbc_plt*"))[1:] -if len(files) == 0: - files = sorted(glob.glob("Python_dirichletbc_plt*"))[1:] +files = sorted(glob.glob("diags/diag1*"))[1:] assert len(files) > 0 times = np.ones(len(files)) diff --git a/Examples/Tests/electrostatic_dirichlet_bc/inputs_2d b/Examples/Tests/electrostatic_dirichlet_bc/inputs_test_2d_dirichlet_bc similarity index 93% rename from Examples/Tests/electrostatic_dirichlet_bc/inputs_2d rename to Examples/Tests/electrostatic_dirichlet_bc/inputs_test_2d_dirichlet_bc index d501dac7d0c..46b00819926 100644 --- a/Examples/Tests/electrostatic_dirichlet_bc/inputs_2d +++ b/Examples/Tests/electrostatic_dirichlet_bc/inputs_test_2d_dirichlet_bc @@ -1,5 +1,6 @@ max_step = 100 warpx.verbose = 0 +warpx.abort_on_warning_threshold = medium warpx.const_dt = 7.5e-10 warpx.do_electrostatic = labframe warpx.self_fields_required_precision = 1e-06 diff --git a/Examples/Tests/electrostatic_dirichlet_bc/PICMI_inputs_2d.py b/Examples/Tests/electrostatic_dirichlet_bc/inputs_test_2d_dirichlet_bc_picmi.py similarity index 90% rename from Examples/Tests/electrostatic_dirichlet_bc/PICMI_inputs_2d.py rename to Examples/Tests/electrostatic_dirichlet_bc/inputs_test_2d_dirichlet_bc_picmi.py index 5a1c531fe3a..0c30e84d781 100755 --- a/Examples/Tests/electrostatic_dirichlet_bc/PICMI_inputs_2d.py +++ b/Examples/Tests/electrostatic_dirichlet_bc/inputs_test_2d_dirichlet_bc_picmi.py @@ -58,16 +58,12 @@ # diagnostics ########################## -particle_diag = picmi.ParticleDiagnostic( - name="diag1", period=4, write_dir=".", warpx_file_prefix="Python_dirichletbc_plt" -) +particle_diag = picmi.ParticleDiagnostic(name="diag1", period=4) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=4, data_list=["phi"], - write_dir=".", - warpx_file_prefix="Python_dirichletbc_plt", ) ########################## diff --git a/Examples/Tests/electrostatic_sphere/CMakeLists.txt b/Examples/Tests/electrostatic_sphere/CMakeLists.txt new file mode 100644 index 00000000000..e80beb08e97 --- /dev/null +++ b/Examples/Tests/electrostatic_sphere/CMakeLists.txt @@ -0,0 +1,57 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_electrostatic_sphere # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_electrostatic_sphere # inputs + analysis_electrostatic_sphere.py # analysis + diags/diag1000030 # output + OFF # dependency +) + +add_warpx_test( + test_3d_electrostatic_sphere_lab_frame # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_electrostatic_sphere_lab_frame # inputs + analysis_electrostatic_sphere.py # analysis + diags/diag1000030 # output + OFF # dependency +) + +add_warpx_test( + test_3d_electrostatic_sphere_lab_frame_mr_emass_10 # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_electrostatic_sphere_lab_frame_mr_emass_10 # inputs + analysis_electrostatic_sphere.py # analysis + diags/diag1000002 # output + OFF # dependency +) + +add_warpx_test( + test_3d_electrostatic_sphere_rel_nodal # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_electrostatic_sphere_rel_nodal # inputs + analysis_electrostatic_sphere.py # analysis + diags/diag1000030 # output + OFF # dependency +) + +add_warpx_test( + test_rz_electrostatic_sphere # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_electrostatic_sphere # inputs + analysis_electrostatic_sphere.py # analysis + diags/diag1000030 # output + OFF # dependency +) diff --git a/Examples/Tests/electrostatic_sphere/analysis_electrostatic_sphere.py b/Examples/Tests/electrostatic_sphere/analysis_electrostatic_sphere.py index 4acd868a148..33842058b0b 100755 --- a/Examples/Tests/electrostatic_sphere/analysis_electrostatic_sphere.py +++ b/Examples/Tests/electrostatic_sphere/analysis_electrostatic_sphere.py @@ -34,12 +34,13 @@ yt.funcs.mylog.setLevel(0) # Open plotfile specified in command line +test_name = os.path.split(os.getcwd())[1] filename = sys.argv[1] ds = yt.load(filename) t_max = ds.current_time.item() # time of simulation # Parse test name and check if particle_shape = 4 is used -emass_10 = True if re.search("emass_10", filename) else False +emass_10 = True if re.search("emass_10", test_name) else False if emass_10: l2_tolerance = 0.096 @@ -193,5 +194,4 @@ def return_energies(iteration): ) # Check conservation of energy # Checksum regression analysis -test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/electrostatic_sphere/inputs_3d b/Examples/Tests/electrostatic_sphere/inputs_base_3d similarity index 100% rename from Examples/Tests/electrostatic_sphere/inputs_3d rename to Examples/Tests/electrostatic_sphere/inputs_base_3d diff --git a/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere b/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere new file mode 100644 index 00000000000..d89395e9d74 --- /dev/null +++ b/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +warpx.abort_on_warning_threshold = medium diff --git a/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere_lab_frame b/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere_lab_frame new file mode 100644 index 00000000000..da97ae8afe7 --- /dev/null +++ b/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere_lab_frame @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +diag2.electron.variables = x y z ux uy uz w phi +warpx.do_electrostatic = labframe diff --git a/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere_lab_frame_mr_emass_10 b/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere_lab_frame_mr_emass_10 new file mode 100644 index 00000000000..481cc65f030 --- /dev/null +++ b/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere_lab_frame_mr_emass_10 @@ -0,0 +1,13 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +amr.max_level = 1 +amr.ref_ratio_vect = 2 2 2 +diag2.electron.variables = x y z ux uy uz w +electron.mass = 10 +max_step = 2 +warpx.abort_on_warning_threshold = medium +warpx.do_electrostatic = labframe +warpx.fine_tag_hi = 0.5 0.5 0.5 +warpx.fine_tag_lo = -0.5 -0.5 -0.5 diff --git a/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere_rel_nodal b/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere_rel_nodal new file mode 100644 index 00000000000..96bff8aa9c7 --- /dev/null +++ b/Examples/Tests/electrostatic_sphere/inputs_test_3d_electrostatic_sphere_rel_nodal @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +warpx.abort_on_warning_threshold = medium +warpx.grid_type = collocated diff --git a/Examples/Tests/electrostatic_sphere/inputs_rz b/Examples/Tests/electrostatic_sphere/inputs_test_rz_electrostatic_sphere similarity index 96% rename from Examples/Tests/electrostatic_sphere/inputs_rz rename to Examples/Tests/electrostatic_sphere/inputs_test_rz_electrostatic_sphere index 2b6151e6d8c..a1c71c58fc3 100644 --- a/Examples/Tests/electrostatic_sphere/inputs_rz +++ b/Examples/Tests/electrostatic_sphere/inputs_test_rz_electrostatic_sphere @@ -11,6 +11,7 @@ boundary.field_hi = pec pec warpx.const_dt = 1e-6 warpx.do_electrostatic = labframe warpx.use_filter = 0 +warpx.abort_on_warning_threshold = medium particles.species_names = electron diff --git a/Examples/Tests/electrostatic_sphere_eb/CMakeLists.txt b/Examples/Tests/electrostatic_sphere_eb/CMakeLists.txt new file mode 100644 index 00000000000..ad5e8974225 --- /dev/null +++ b/Examples/Tests/electrostatic_sphere_eb/CMakeLists.txt @@ -0,0 +1,67 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_3d_electrostatic_sphere_eb # name + 3 # dims + 2 # nprocs + ON # eb + inputs_test_3d_electrostatic_sphere_eb # inputs + analysis.py # analysis + diags/diag1000001 # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_3d_electrostatic_sphere_eb_mixed_bc # name + 3 # dims + 2 # nprocs + ON # eb + inputs_test_3d_electrostatic_sphere_eb_mixed_bc # inputs + analysis_default_regression.py # analysis + diags/diag1000001 # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_3d_electrostatic_sphere_eb_picmi # name + 3 # dims + 2 # nprocs + ON # eb + inputs_test_3d_electrostatic_sphere_eb_picmi.py # inputs + analysis.py # analysis + diags/diag1000002 # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_rz_electrostatic_sphere_eb # name + RZ # dims + 2 # nprocs + ON # eb + inputs_test_rz_electrostatic_sphere_eb # inputs + analysis_rz.py # analysis + diags/diag1000001 # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_rz_electrostatic_sphere_eb_mr # name + RZ # dims + 2 # nprocs + ON # eb + inputs_test_rz_electrostatic_sphere_eb_mr # inputs + analysis_rz_mr.py # analysis + diags/diag1/ # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/electrostatic_sphere_eb/analysis_default_regression.py b/Examples/Tests/electrostatic_sphere_eb/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/electrostatic_sphere_eb/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/electrostatic_sphere_eb/inputs_3d b/Examples/Tests/electrostatic_sphere_eb/inputs_test_3d_electrostatic_sphere_eb similarity index 96% rename from Examples/Tests/electrostatic_sphere_eb/inputs_3d rename to Examples/Tests/electrostatic_sphere_eb/inputs_test_3d_electrostatic_sphere_eb index 13ad42da070..f738e1c5d3a 100644 --- a/Examples/Tests/electrostatic_sphere_eb/inputs_3d +++ b/Examples/Tests/electrostatic_sphere_eb/inputs_test_3d_electrostatic_sphere_eb @@ -20,6 +20,7 @@ warpx.do_electrostatic = labframe warpx.eb_implicit_function = "-(x**2+y**2+z**2-0.1**2)" warpx.eb_potential(x,y,z,t) = "1." warpx.self_fields_required_precision = 1.e-7 +warpx.abort_on_warning_threshold = medium algo.field_gathering = momentum-conserving diff --git a/Examples/Tests/electrostatic_sphere_eb/inputs_3d_mixed_BCs b/Examples/Tests/electrostatic_sphere_eb/inputs_test_3d_electrostatic_sphere_eb_mixed_bc similarity index 94% rename from Examples/Tests/electrostatic_sphere_eb/inputs_3d_mixed_BCs rename to Examples/Tests/electrostatic_sphere_eb/inputs_test_3d_electrostatic_sphere_eb_mixed_bc index 0c1b9130ded..de2c0d0646c 100644 --- a/Examples/Tests/electrostatic_sphere_eb/inputs_3d_mixed_BCs +++ b/Examples/Tests/electrostatic_sphere_eb/inputs_test_3d_electrostatic_sphere_eb_mixed_bc @@ -17,6 +17,7 @@ warpx.do_electrostatic = labframe warpx.eb_implicit_function = "-(x**2+y**2+z**2-0.3**2)" warpx.eb_potential(x,y,z,t) = "1." warpx.self_fields_required_precision = 1.e-7 +warpx.abort_on_warning_threshold = medium algo.field_gathering = momentum-conserving diff --git a/Examples/Tests/electrostatic_sphere_eb/PICMI_inputs_3d.py b/Examples/Tests/electrostatic_sphere_eb/inputs_test_3d_electrostatic_sphere_eb_picmi.py similarity index 94% rename from Examples/Tests/electrostatic_sphere_eb/PICMI_inputs_3d.py rename to Examples/Tests/electrostatic_sphere_eb/inputs_test_3d_electrostatic_sphere_eb_picmi.py index 97f52a69c72..37d280e77d2 100755 --- a/Examples/Tests/electrostatic_sphere_eb/PICMI_inputs_3d.py +++ b/Examples/Tests/electrostatic_sphere_eb/inputs_test_3d_electrostatic_sphere_eb_picmi.py @@ -73,16 +73,12 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=1, - write_dir=".", - warpx_file_prefix="Python_ElectrostaticSphereEB_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=1, data_list=["Ex", "Ey", "Ez", "phi", "rho"], - write_dir=".", - warpx_file_prefix="Python_ElectrostaticSphereEB_plt", ) reduced_diag = picmi.ReducedDiagnostic( diff --git a/Examples/Tests/electrostatic_sphere_eb/inputs_rz b/Examples/Tests/electrostatic_sphere_eb/inputs_test_rz_electrostatic_sphere_eb similarity index 94% rename from Examples/Tests/electrostatic_sphere_eb/inputs_rz rename to Examples/Tests/electrostatic_sphere_eb/inputs_test_rz_electrostatic_sphere_eb index 28ebadb1cc7..8ace9cd9b4a 100644 --- a/Examples/Tests/electrostatic_sphere_eb/inputs_rz +++ b/Examples/Tests/electrostatic_sphere_eb/inputs_test_rz_electrostatic_sphere_eb @@ -20,6 +20,7 @@ warpx.do_electrostatic = labframe warpx.eb_implicit_function = "-(x**2-0.1**2)" warpx.eb_potential(x,y,z,t) = "1." warpx.self_fields_required_precision = 1.e-7 +warpx.abort_on_warning_threshold = medium algo.field_gathering = momentum-conserving diff --git a/Examples/Tests/electrostatic_sphere_eb/inputs_rz_mr b/Examples/Tests/electrostatic_sphere_eb/inputs_test_rz_electrostatic_sphere_eb_mr similarity index 92% rename from Examples/Tests/electrostatic_sphere_eb/inputs_rz_mr rename to Examples/Tests/electrostatic_sphere_eb/inputs_test_rz_electrostatic_sphere_eb_mr index 722fc916416..d984ba35b5d 100644 --- a/Examples/Tests/electrostatic_sphere_eb/inputs_rz_mr +++ b/Examples/Tests/electrostatic_sphere_eb/inputs_test_rz_electrostatic_sphere_eb_mr @@ -6,6 +6,7 @@ max_step = 1 amr.n_cell = 64 64 amr.blocking_factor = 8 amr.max_grid_size = 128 +amr.ref_ratio_vect = 2 2 2 boundary.field_lo = none periodic boundary.field_hi = pec periodic boundary.potential_lo_x = 0 @@ -23,6 +24,7 @@ warpx.do_electrostatic = labframe warpx.eb_implicit_function = "-(x**2-0.1**2)" warpx.eb_potential(x,y,z,t) = "1." warpx.self_fields_required_precision = 1.e-7 +warpx.abort_on_warning_threshold = medium algo.field_gathering = momentum-conserving diff --git a/Examples/Tests/embedded_boundary_cube/CMakeLists.txt b/Examples/Tests/embedded_boundary_cube/CMakeLists.txt new file mode 100644 index 00000000000..3fd0a0f4c3b --- /dev/null +++ b/Examples/Tests/embedded_boundary_cube/CMakeLists.txt @@ -0,0 +1,41 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_2d_embedded_boundary_cube # name + 2 # dims + 1 # nprocs + ON # eb + inputs_test_2d_embedded_boundary_cube # inputs + analysis_fields_2d.py # analysis + diags/diag1000114 # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_3d_embedded_boundary_cube # name + 3 # dims + 1 # nprocs + ON # eb + inputs_test_3d_embedded_boundary_cube # inputs + analysis_fields.py # analysis + diags/diag1000208 # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_3d_embedded_boundary_cube_macroscopic # name + 3 # dims + 1 # nprocs + ON # eb + inputs_test_3d_embedded_boundary_cube_macroscopic # inputs + analysis_fields.py # analysis + diags/diag1000208 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/embedded_boundary_cube/analysis_fields.py b/Examples/Tests/embedded_boundary_cube/analysis_fields.py index 1890c1d9aea..49da1a76edd 100755 --- a/Examples/Tests/embedded_boundary_cube/analysis_fields.py +++ b/Examples/Tests/embedded_boundary_cube/analysis_fields.py @@ -23,6 +23,8 @@ # $$ k_y = \frac{n\pi}{L}$$ # $$ k_z = \frac{p\pi}{L}$$ +test_name = os.path.split(os.getcwd())[1] + hi = [0.8, 0.8, 0.8] lo = [-0.8, -0.8, -0.8] ncells = [48, 48, 48] @@ -46,7 +48,7 @@ # Parse test name and check whether this use the macroscopic solver # (i.e. solving the equation in a dielectric) -macroscopic = True if re.search("macroscopic", filename) else False +macroscopic = True if re.search("macroscopic", test_name) else False # Calculate frequency of the mode oscillation omega = np.sqrt(h_2) * c @@ -108,6 +110,4 @@ rel_err_z = np.sqrt(np.sum(np.square(Bz_sim - Bz_th)) / np.sum(np.square(Bz_th))) assert rel_err_z < rel_tol_err -test_name = os.path.split(os.getcwd())[1] - checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/embedded_boundary_cube/inputs_3d b/Examples/Tests/embedded_boundary_cube/inputs_base_3d similarity index 97% rename from Examples/Tests/embedded_boundary_cube/inputs_3d rename to Examples/Tests/embedded_boundary_cube/inputs_base_3d index 61eb1192e04..9710701d871 100644 --- a/Examples/Tests/embedded_boundary_cube/inputs_3d +++ b/Examples/Tests/embedded_boundary_cube/inputs_base_3d @@ -7,6 +7,7 @@ geometry.dims = 3 geometry.prob_lo = -0.8 -0.8 -0.8 geometry.prob_hi = 0.8 0.8 0.8 warpx.cfl = 1 +warpx.abort_on_warning_threshold = medium boundary.field_lo = pec pec pec boundary.field_hi = pec pec pec diff --git a/Examples/Tests/embedded_boundary_cube/inputs_2d b/Examples/Tests/embedded_boundary_cube/inputs_test_2d_embedded_boundary_cube similarity index 97% rename from Examples/Tests/embedded_boundary_cube/inputs_2d rename to Examples/Tests/embedded_boundary_cube/inputs_test_2d_embedded_boundary_cube index 372e0dc0340..684325dc030 100644 --- a/Examples/Tests/embedded_boundary_cube/inputs_2d +++ b/Examples/Tests/embedded_boundary_cube/inputs_test_2d_embedded_boundary_cube @@ -7,6 +7,7 @@ geometry.dims = 2 geometry.prob_lo = -0.8 -0.8 geometry.prob_hi = 0.8 0.8 warpx.cfl = 1 +warpx.abort_on_warning_threshold = medium boundary.field_lo = pec pec boundary.field_hi = pec pec diff --git a/Examples/Tests/embedded_boundary_cube/inputs_test_3d_embedded_boundary_cube b/Examples/Tests/embedded_boundary_cube/inputs_test_3d_embedded_boundary_cube new file mode 100644 index 00000000000..9d612bd62da --- /dev/null +++ b/Examples/Tests/embedded_boundary_cube/inputs_test_3d_embedded_boundary_cube @@ -0,0 +1,2 @@ +# base inpute parameters +FILE = inputs_base_3d diff --git a/Examples/Tests/embedded_boundary_cube/inputs_test_3d_embedded_boundary_cube_macroscopic b/Examples/Tests/embedded_boundary_cube/inputs_test_3d_embedded_boundary_cube_macroscopic new file mode 100644 index 00000000000..1bcb49dec54 --- /dev/null +++ b/Examples/Tests/embedded_boundary_cube/inputs_test_3d_embedded_boundary_cube_macroscopic @@ -0,0 +1,8 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.em_solver_medium = macroscopic +macroscopic.epsilon = 1.5*8.8541878128e-12 +macroscopic.mu = 1.25663706212e-06 +macroscopic.sigma = 0 diff --git a/Examples/Tests/embedded_boundary_diffraction/CMakeLists.txt b/Examples/Tests/embedded_boundary_diffraction/CMakeLists.txt new file mode 100644 index 00000000000..d91a94b539b --- /dev/null +++ b/Examples/Tests/embedded_boundary_diffraction/CMakeLists.txt @@ -0,0 +1,15 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_rz_embedded_boundary_diffraction # name + RZ # dims + 2 # nprocs + ON # eb + inputs_test_rz_embedded_boundary_diffraction # inputs + analysis_fields.py # analysis + diags/diag1/ # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/embedded_boundary_diffraction/analysis_fields.py b/Examples/Tests/embedded_boundary_diffraction/analysis_fields.py index bef85259f17..84dfacbb505 100755 --- a/Examples/Tests/embedded_boundary_diffraction/analysis_fields.py +++ b/Examples/Tests/embedded_boundary_diffraction/analysis_fields.py @@ -17,7 +17,8 @@ sys.path.insert(1, "../../../../warpx/Regression/Checksum/") import checksumAPI -ts = OpenPMDTimeSeries("./EmbeddedBoundaryDiffraction_plt/") +filename = sys.argv[1] +ts = OpenPMDTimeSeries(filename) # Extract the intensity as a function of r and z Ex, info = ts.get_field("E", "x", iteration=300) @@ -42,6 +43,5 @@ def r_first_minimum(iz): assert np.all(abs(r[50:] - theta_diffraction * info.z[50:]) < 0.03) # Open the right plot file -filename = sys.argv[1] test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, filename, output_format="openpmd") diff --git a/Examples/Tests/embedded_boundary_diffraction/inputs_rz b/Examples/Tests/embedded_boundary_diffraction/inputs_test_rz_embedded_boundary_diffraction similarity index 100% rename from Examples/Tests/embedded_boundary_diffraction/inputs_rz rename to Examples/Tests/embedded_boundary_diffraction/inputs_test_rz_embedded_boundary_diffraction diff --git a/Examples/Tests/embedded_boundary_python_api/CMakeLists.txt b/Examples/Tests/embedded_boundary_python_api/CMakeLists.txt new file mode 100644 index 00000000000..cf45d9d56f3 --- /dev/null +++ b/Examples/Tests/embedded_boundary_python_api/CMakeLists.txt @@ -0,0 +1,15 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_3d_embedded_boundary_picmi # name + 3 # dims + 1 # nprocs + ON # eb + inputs_test_3d_embedded_boundary_picmi.py # inputs + analysis.py # analysis + diags/diag1000002 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/embedded_boundary_python_api/PICMI_inputs_EB_API.py b/Examples/Tests/embedded_boundary_python_api/inputs_test_3d_embedded_boundary_picmi.py similarity index 97% rename from Examples/Tests/embedded_boundary_python_api/PICMI_inputs_EB_API.py rename to Examples/Tests/embedded_boundary_python_api/inputs_test_3d_embedded_boundary_picmi.py index 45d57e606b4..80ce483f2c7 100755 --- a/Examples/Tests/embedded_boundary_python_api/PICMI_inputs_EB_API.py +++ b/Examples/Tests/embedded_boundary_python_api/inputs_test_3d_embedded_boundary_picmi.py @@ -61,16 +61,12 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=1, - write_dir=".", - warpx_file_prefix="embedded_boundary_python_API_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=1, data_list=["Ex"], - write_dir=".", - warpx_file_prefix="embedded_boundary_python_API_plt", ) ########################## diff --git a/Examples/Tests/embedded_boundary_rotated_cube/CMakeLists.txt b/Examples/Tests/embedded_boundary_rotated_cube/CMakeLists.txt new file mode 100644 index 00000000000..c9d3b47cece --- /dev/null +++ b/Examples/Tests/embedded_boundary_rotated_cube/CMakeLists.txt @@ -0,0 +1,28 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_2d_embedded_boundary_rotated_cube # name + 2 # dims + 1 # nprocs + ON # eb + inputs_test_2d_embedded_boundary_rotated_cube # inputs + analysis_fields_2d.py # analysis + diags/diag1000068 # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_3d_embedded_boundary_rotated_cube # name + 3 # dims + 1 # nprocs + ON # eb + inputs_test_3d_embedded_boundary_rotated_cube # inputs + analysis_fields_3d.py # analysis + diags/diag1000111 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/embedded_boundary_rotated_cube/analysis_fields.py b/Examples/Tests/embedded_boundary_rotated_cube/analysis_fields_3d.py similarity index 100% rename from Examples/Tests/embedded_boundary_rotated_cube/analysis_fields.py rename to Examples/Tests/embedded_boundary_rotated_cube/analysis_fields_3d.py diff --git a/Examples/Tests/embedded_boundary_rotated_cube/inputs_2d b/Examples/Tests/embedded_boundary_rotated_cube/inputs_test_2d_embedded_boundary_rotated_cube similarity index 96% rename from Examples/Tests/embedded_boundary_rotated_cube/inputs_2d rename to Examples/Tests/embedded_boundary_rotated_cube/inputs_test_2d_embedded_boundary_rotated_cube index e7e03168824..24fb2938c2d 100644 --- a/Examples/Tests/embedded_boundary_rotated_cube/inputs_2d +++ b/Examples/Tests/embedded_boundary_rotated_cube/inputs_test_2d_embedded_boundary_rotated_cube @@ -7,6 +7,7 @@ geometry.dims = 2 geometry.prob_lo = -0.8 -0.8 geometry.prob_hi = 0.8 0.8 warpx.cfl = 1 +warpx.abort_on_warning_threshold = medium boundary.field_lo = pec pec boundary.field_hi = pec pec diff --git a/Examples/Tests/embedded_boundary_rotated_cube/inputs_3d b/Examples/Tests/embedded_boundary_rotated_cube/inputs_test_3d_embedded_boundary_rotated_cube similarity index 98% rename from Examples/Tests/embedded_boundary_rotated_cube/inputs_3d rename to Examples/Tests/embedded_boundary_rotated_cube/inputs_test_3d_embedded_boundary_rotated_cube index 77e259e8975..faefeec2206 100644 --- a/Examples/Tests/embedded_boundary_rotated_cube/inputs_3d +++ b/Examples/Tests/embedded_boundary_rotated_cube/inputs_test_3d_embedded_boundary_rotated_cube @@ -7,6 +7,7 @@ geometry.dims = 3 geometry.prob_lo = -0.8 -0.8 -0.8 geometry.prob_hi = 0.8 0.8 0.8 warpx.cfl = 1 +warpx.abort_on_warning_threshold = medium boundary.field_lo = pec pec pec boundary.field_hi = pec pec pec diff --git a/Examples/Tests/embedded_circle/CMakeLists.txt b/Examples/Tests/embedded_circle/CMakeLists.txt new file mode 100644 index 00000000000..9eb8f23460b --- /dev/null +++ b/Examples/Tests/embedded_circle/CMakeLists.txt @@ -0,0 +1,15 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_2d_embedded_circle # name + 2 # dims + 2 # nprocs + ON # eb + inputs_test_2d_embedded_circle # inputs + analysis.py # analysis + diags/diag1000011 + OFF # dependency + ) +endif() diff --git a/Examples/Tests/embedded_circle/inputs_2d b/Examples/Tests/embedded_circle/inputs_test_2d_embedded_circle similarity index 100% rename from Examples/Tests/embedded_circle/inputs_2d rename to Examples/Tests/embedded_circle/inputs_test_2d_embedded_circle diff --git a/Examples/Tests/energy_conserving_thermal_plasma/CMakeLists.txt b/Examples/Tests/energy_conserving_thermal_plasma/CMakeLists.txt new file mode 100644 index 00000000000..13012e7605b --- /dev/null +++ b/Examples/Tests/energy_conserving_thermal_plasma/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_energy_conserving_thermal_plasma # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_energy_conserving_thermal_plasma # inputs + analysis.py # analysis + diags/diag1000500 # output + OFF # dependency +) diff --git a/Examples/Tests/energy_conserving_thermal_plasma/inputs_2d_electrostatic b/Examples/Tests/energy_conserving_thermal_plasma/inputs_test_2d_energy_conserving_thermal_plasma similarity index 100% rename from Examples/Tests/energy_conserving_thermal_plasma/inputs_2d_electrostatic rename to Examples/Tests/energy_conserving_thermal_plasma/inputs_test_2d_energy_conserving_thermal_plasma diff --git a/Examples/Tests/field_probe/CMakeLists.txt b/Examples/Tests/field_probe/CMakeLists.txt new file mode 100644 index 00000000000..4ef61237775 --- /dev/null +++ b/Examples/Tests/field_probe/CMakeLists.txt @@ -0,0 +1,15 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_2d_field_probe # name + 2 # dims + 2 # nprocs + ON # eb + inputs_test_2d_field_probe # inputs + analysis.py # analysis + diags/diag1000544 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/field_probe/analysis_field_probe.py b/Examples/Tests/field_probe/analysis.py similarity index 100% rename from Examples/Tests/field_probe/analysis_field_probe.py rename to Examples/Tests/field_probe/analysis.py diff --git a/Examples/Tests/field_probe/inputs_2d b/Examples/Tests/field_probe/inputs_test_2d_field_probe similarity index 100% rename from Examples/Tests/field_probe/inputs_2d rename to Examples/Tests/field_probe/inputs_test_2d_field_probe diff --git a/Examples/Tests/flux_injection/CMakeLists.txt b/Examples/Tests/flux_injection/CMakeLists.txt new file mode 100644 index 00000000000..306ff2018bc --- /dev/null +++ b/Examples/Tests/flux_injection/CMakeLists.txt @@ -0,0 +1,24 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_flux_injection # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_flux_injection # inputs + analysis_flux_injection_3d.py # analysis + diags/diag1000002 # output + OFF # dependency +) + +add_warpx_test( + test_rz_flux_injection # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_flux_injection # inputs + analysis_flux_injection_rz.py # analysis + diags/diag1000120 # output + OFF # dependency +) diff --git a/Examples/Tests/flux_injection/inputs_3d b/Examples/Tests/flux_injection/inputs_test_3d_flux_injection similarity index 100% rename from Examples/Tests/flux_injection/inputs_3d rename to Examples/Tests/flux_injection/inputs_test_3d_flux_injection diff --git a/Examples/Tests/flux_injection/inputs_rz b/Examples/Tests/flux_injection/inputs_test_rz_flux_injection similarity index 100% rename from Examples/Tests/flux_injection/inputs_rz rename to Examples/Tests/flux_injection/inputs_test_rz_flux_injection diff --git a/Examples/Tests/gaussian_beam/CMakeLists.txt b/Examples/Tests/gaussian_beam/CMakeLists.txt new file mode 100644 index 00000000000..35ec08c10e3 --- /dev/null +++ b/Examples/Tests/gaussian_beam/CMakeLists.txt @@ -0,0 +1,24 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_focusing_gaussian_beam # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_focusing_gaussian_beam # inputs + analysis.py # analysis + diags/diag1000000 # output + OFF # dependency +) + +add_warpx_test( + test_3d_gaussian_beam_picmi # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_gaussian_beam_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency +) diff --git a/Examples/Tests/gaussian_beam/README.rst b/Examples/Tests/gaussian_beam/README similarity index 100% rename from Examples/Tests/gaussian_beam/README.rst rename to Examples/Tests/gaussian_beam/README diff --git a/Examples/Tests/gaussian_beam/analysis_focusing_beam.py b/Examples/Tests/gaussian_beam/analysis.py similarity index 100% rename from Examples/Tests/gaussian_beam/analysis_focusing_beam.py rename to Examples/Tests/gaussian_beam/analysis.py diff --git a/Examples/Tests/gaussian_beam/analysis_default_regression.py b/Examples/Tests/gaussian_beam/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/gaussian_beam/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/gaussian_beam/inputs_focusing_beam b/Examples/Tests/gaussian_beam/inputs_test_3d_focusing_gaussian_beam similarity index 100% rename from Examples/Tests/gaussian_beam/inputs_focusing_beam rename to Examples/Tests/gaussian_beam/inputs_test_3d_focusing_gaussian_beam diff --git a/Examples/Tests/gaussian_beam/PICMI_inputs_gaussian_beam.py b/Examples/Tests/gaussian_beam/inputs_test_3d_gaussian_beam_picmi.py similarity index 97% rename from Examples/Tests/gaussian_beam/PICMI_inputs_gaussian_beam.py rename to Examples/Tests/gaussian_beam/inputs_test_3d_gaussian_beam_picmi.py index 9ad2fd6b82b..cd169110f8a 100755 --- a/Examples/Tests/gaussian_beam/PICMI_inputs_gaussian_beam.py +++ b/Examples/Tests/gaussian_beam/inputs_test_3d_gaussian_beam_picmi.py @@ -87,8 +87,6 @@ period=10, data_list=args.fields_to_plot, warpx_format=args.diagformat, - write_dir=".", - warpx_file_prefix="Python_gaussian_beam_plt", ) part_diag1 = picmi.ParticleDiagnostic( diff --git a/Examples/Tests/implicit/CMakeLists.txt b/Examples/Tests/implicit/CMakeLists.txt new file mode 100644 index 00000000000..11881ae4972 --- /dev/null +++ b/Examples/Tests/implicit/CMakeLists.txt @@ -0,0 +1,46 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_semi_implicit_picard # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_semi_implicit_picard # inputs + analysis_1d.py # analysis + diags/diag1000100 # output + OFF # dependency +) + +add_warpx_test( + test_1d_theta_implicit_picard # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_theta_implicit_picard # inputs + analysis_1d.py # analysis + diags/diag1000100 # output + OFF # dependency +) + +add_warpx_test( + test_2d_theta_implicit_jfnk_vandb # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_theta_implicit_jfnk_vandb # inputs + analysis_vandb_jfnk_2d.py # analysis + diags/diag1000020 # output + OFF # dependency +) + +add_warpx_test( + test_2d_theta_implicit_jfnk_vandb_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_theta_implicit_jfnk_vandb_picmi.py # inputs + analysis_vandb_jfnk_2d.py # analysis + diags/diag1000020 # output + OFF # dependency +) diff --git a/Examples/Tests/Implicit/analysis_1d.py b/Examples/Tests/implicit/analysis_1d.py similarity index 87% rename from Examples/Tests/Implicit/analysis_1d.py rename to Examples/Tests/implicit/analysis_1d.py index af4515968f9..bbbbb8db9b2 100755 --- a/Examples/Tests/Implicit/analysis_1d.py +++ b/Examples/Tests/implicit/analysis_1d.py @@ -29,9 +29,10 @@ delta_E = (total_energy - total_energy[0]) / total_energy[0] max_delta_E = np.abs(delta_E).max() -if re.match("SemiImplicitPicard_1d", fn): +test_name = os.path.split(os.getcwd())[1] +if re.match("test_1d_semi_implicit_picard", test_name): tolerance_rel = 2.5e-5 -elif re.match("ThetaImplicitPicard_1d", fn): +elif re.match("test_1d_theta_implicit_picard", test_name): # This case should have near machine precision conservation of energy tolerance_rel = 1.0e-14 diff --git a/Examples/Tests/Implicit/analysis_vandb_jfnk_2d.py b/Examples/Tests/implicit/analysis_vandb_jfnk_2d.py similarity index 100% rename from Examples/Tests/Implicit/analysis_vandb_jfnk_2d.py rename to Examples/Tests/implicit/analysis_vandb_jfnk_2d.py diff --git a/Examples/Tests/Implicit/inputs_1d_semiimplicit b/Examples/Tests/implicit/inputs_test_1d_semi_implicit_picard similarity index 97% rename from Examples/Tests/Implicit/inputs_1d_semiimplicit rename to Examples/Tests/implicit/inputs_test_1d_semi_implicit_picard index 07460e08be8..8ef0304bebb 100644 --- a/Examples/Tests/Implicit/inputs_1d_semiimplicit +++ b/Examples/Tests/implicit/inputs_test_1d_semi_implicit_picard @@ -17,6 +17,7 @@ my_constants.dt = 0.1/wpe # time step size, s max_step = 100 amr.n_cell = nz +amr.max_grid_size = 32 amr.max_level = 0 geometry.dims = 1 @@ -31,6 +32,7 @@ boundary.particle_hi = periodic ############ NUMERICS ########### ################################# +warpx.abort_on_warning_threshold = high warpx.verbose = 1 warpx.const_dt = dt algo.evolve_scheme = semi_implicit_em diff --git a/Examples/Tests/Implicit/inputs_1d b/Examples/Tests/implicit/inputs_test_1d_theta_implicit_picard similarity index 97% rename from Examples/Tests/Implicit/inputs_1d rename to Examples/Tests/implicit/inputs_test_1d_theta_implicit_picard index 3e57689b723..2ed4d746708 100644 --- a/Examples/Tests/Implicit/inputs_1d +++ b/Examples/Tests/implicit/inputs_test_1d_theta_implicit_picard @@ -17,6 +17,7 @@ my_constants.dt = 0.1/wpe # time step size, s max_step = 100 amr.n_cell = nz +amr.max_grid_size = 32 amr.max_level = 0 geometry.dims = 1 @@ -31,6 +32,7 @@ boundary.particle_hi = periodic ############ NUMERICS ########### ################################# +warpx.abort_on_warning_threshold = high warpx.verbose = 1 warpx.const_dt = dt algo.evolve_scheme = theta_implicit_em diff --git a/Examples/Tests/Implicit/inputs_vandb_jfnk_2d b/Examples/Tests/implicit/inputs_test_2d_theta_implicit_jfnk_vandb similarity index 98% rename from Examples/Tests/Implicit/inputs_vandb_jfnk_2d rename to Examples/Tests/implicit/inputs_test_2d_theta_implicit_jfnk_vandb index 393a9d90330..0cdf2ebe40d 100644 --- a/Examples/Tests/Implicit/inputs_vandb_jfnk_2d +++ b/Examples/Tests/implicit/inputs_test_2d_theta_implicit_jfnk_vandb @@ -31,6 +31,7 @@ boundary.field_hi = periodic periodic ################################# ############ NUMERICS ########### ################################# +warpx.abort_on_warning_threshold = high warpx.serialize_initial_conditions = 1 warpx.verbose = 1 warpx.const_dt = dt diff --git a/Examples/Tests/Implicit/PICMI_inputs_vandb_jfnk_2d.py b/Examples/Tests/implicit/inputs_test_2d_theta_implicit_jfnk_vandb_picmi.py similarity index 96% rename from Examples/Tests/Implicit/PICMI_inputs_vandb_jfnk_2d.py rename to Examples/Tests/implicit/inputs_test_2d_theta_implicit_jfnk_vandb_picmi.py index a2ed607e873..8fa29127a7f 100755 --- a/Examples/Tests/Implicit/PICMI_inputs_vandb_jfnk_2d.py +++ b/Examples/Tests/implicit/inputs_test_2d_theta_implicit_jfnk_vandb_picmi.py @@ -111,8 +111,6 @@ grid=grid, period=diagnostic_intervals, data_list=["Ex", "Ey", "Ez", "Bx", "By", "Bz", "Jx", "Jy", "Jz", "rho", "divE"], - write_dir=".", - warpx_file_prefix="ThetaImplicitJFNK_VandB_2d_PICMI_plt", ) part_diag1 = picmi.ParticleDiagnostic( @@ -120,8 +118,6 @@ period=diagnostic_intervals, species=[electrons, protons], data_list=["weighting", "position", "momentum"], - write_dir=".", - warpx_file_prefix="ThetaImplicitJFNK_VandB_2d_PICMI_plt", ) particle_energy_diag = picmi.ReducedDiagnostic( diff --git a/Examples/Tests/initial_distribution/CMakeLists.txt b/Examples/Tests/initial_distribution/CMakeLists.txt new file mode 100644 index 00000000000..14dabd7a67c --- /dev/null +++ b/Examples/Tests/initial_distribution/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_initial_distribution # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_initial_distribution # inputs + analysis.py # analysis + diags/diag1000001 # output + OFF # dependency +) diff --git a/Examples/Tests/initial_distribution/analysis_distribution.py b/Examples/Tests/initial_distribution/analysis.py similarity index 100% rename from Examples/Tests/initial_distribution/analysis_distribution.py rename to Examples/Tests/initial_distribution/analysis.py diff --git a/Examples/Tests/initial_distribution/inputs b/Examples/Tests/initial_distribution/inputs_test_3d_initial_distribution similarity index 100% rename from Examples/Tests/initial_distribution/inputs rename to Examples/Tests/initial_distribution/inputs_test_3d_initial_distribution diff --git a/Examples/Tests/initial_plasma_profile/CMakeLists.txt b/Examples/Tests/initial_plasma_profile/CMakeLists.txt new file mode 100644 index 00000000000..fab15e8b97f --- /dev/null +++ b/Examples/Tests/initial_plasma_profile/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_parabolic_channel_initialization # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_parabolic_channel_initialization # inputs + analysis.py # analysis + diags/diag1000001 # output + OFF # dependency +) diff --git a/Examples/Tests/initial_plasma_profile/inputs b/Examples/Tests/initial_plasma_profile/inputs_test_2d_parabolic_channel_initialization similarity index 100% rename from Examples/Tests/initial_plasma_profile/inputs rename to Examples/Tests/initial_plasma_profile/inputs_test_2d_parabolic_channel_initialization diff --git a/Examples/Tests/ion_stopping/CMakeLists.txt b/Examples/Tests/ion_stopping/CMakeLists.txt new file mode 100644 index 00000000000..1f203d76fa1 --- /dev/null +++ b/Examples/Tests/ion_stopping/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_ion_stopping # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_ion_stopping # inputs + analysis.py # analysis + diags/diag1000010 # output + OFF # dependency +) diff --git a/Examples/Tests/ion_stopping/analysis_ion_stopping.py b/Examples/Tests/ion_stopping/analysis.py similarity index 93% rename from Examples/Tests/ion_stopping/analysis_ion_stopping.py rename to Examples/Tests/ion_stopping/analysis.py index f1ad3bc8b2b..e343bd23fdd 100755 --- a/Examples/Tests/ion_stopping/analysis_ion_stopping.py +++ b/Examples/Tests/ion_stopping/analysis.py @@ -12,7 +12,6 @@ # particle energies. import os -import re import sys import numpy as np @@ -30,13 +29,7 @@ tolerance = 1.0e-7 last_filename = sys.argv[1] - -# Remove trailing '/' from file name, if necessary -last_filename.rstrip("/") -# Find last iteration in file name, such as 'test_name_plt000001' (last_it = '000001') -last_it = re.search("\d+$", last_filename).group() -# Find output prefix in file name, such as 'test_name_plt000001' (prefix = 'test_name_plt') -prefix = last_filename[: -len(last_it)] +last_it = 10 def stopping_from_electrons(ne, Te, Zb, ion_mass): @@ -94,7 +87,7 @@ def stopping_from_ions(dt, ni, Ti, mi, Zi, Zb, ion_mass, ion_energy): # Fetch background parameters and initial particle data -ds0 = yt.load(f'{prefix}{len(last_it)*"0"}') +ds0 = yt.load("diags/diag1000000") ad0 = ds0.all_data() Zb = 1.0 # Ion charge state @@ -150,14 +143,14 @@ def stopping_from_ions(dt, ni, Ti, mi, Zi, Zb, ion_mass, ion_energy): ds = yt.load(last_filename) ad = ds.all_data() -dt = ds.current_time.to_value() / int(last_it) +dt = ds.current_time.to_value() / last_it # Step through the same number of time steps a_EE1 = EE1 a_EE2 = EE2 a_EE3 = EE3 a_EE4 = EE4 -for it in range(int(last_it)): +for it in range(last_it): dEdt1 = stopping_from_electrons(ne, Te, Zb, ion_mass12) a_EE1 *= np.exp(dEdt1 * dt) dEdt2 = stopping_from_electrons(ne2, Te2, Zb, ion_mass12) diff --git a/Examples/Tests/ion_stopping/inputs_3d b/Examples/Tests/ion_stopping/inputs_test_3d_ion_stopping similarity index 99% rename from Examples/Tests/ion_stopping/inputs_3d rename to Examples/Tests/ion_stopping/inputs_test_3d_ion_stopping index 291e1ca0a9e..93b59bbde4a 100644 --- a/Examples/Tests/ion_stopping/inputs_3d +++ b/Examples/Tests/ion_stopping/inputs_test_3d_ion_stopping @@ -14,6 +14,7 @@ boundary.field_hi = periodic periodic periodic boundary.particle_lo = periodic periodic periodic boundary.particle_hi = periodic periodic periodic algo.particle_shape = 1 +warpx.cfl = 0.7 particles.species_names = ions1 ions2 ions3 ions4 diff --git a/Examples/Tests/ionization/CMakeLists.txt b/Examples/Tests/ionization/CMakeLists.txt new file mode 100644 index 00000000000..32da653f301 --- /dev/null +++ b/Examples/Tests/ionization/CMakeLists.txt @@ -0,0 +1,35 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_ionization_boost # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_ionization_boost # inputs + analysis.py # analysis + diags/diag1000420 # output + OFF # dependency +) + +add_warpx_test( + test_2d_ionization_lab # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_ionization_lab # inputs + analysis.py # analysis + diags/diag1001600 # output + OFF # dependency +) + +add_warpx_test( + test_2d_ionization_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_ionization_picmi.py # inputs + analysis.py # analysis + diags/diag1001600 # output + OFF # dependency +) diff --git a/Examples/Tests/ionization/analysis_ionization.py b/Examples/Tests/ionization/analysis.py similarity index 100% rename from Examples/Tests/ionization/analysis_ionization.py rename to Examples/Tests/ionization/analysis.py diff --git a/Examples/Tests/ionization/inputs_2d_bf_rt b/Examples/Tests/ionization/inputs_test_2d_ionization_boost similarity index 100% rename from Examples/Tests/ionization/inputs_2d_bf_rt rename to Examples/Tests/ionization/inputs_test_2d_ionization_boost diff --git a/Examples/Tests/ionization/inputs_2d_rt b/Examples/Tests/ionization/inputs_test_2d_ionization_lab similarity index 100% rename from Examples/Tests/ionization/inputs_2d_rt rename to Examples/Tests/ionization/inputs_test_2d_ionization_lab diff --git a/Examples/Tests/ionization/PICMI_inputs_2d.py b/Examples/Tests/ionization/inputs_test_2d_ionization_picmi.py similarity index 96% rename from Examples/Tests/ionization/PICMI_inputs_2d.py rename to Examples/Tests/ionization/inputs_test_2d_ionization_picmi.py index 00db8c83ad1..6d1d485cc8c 100644 --- a/Examples/Tests/ionization/PICMI_inputs_2d.py +++ b/Examples/Tests/ionization/inputs_test_2d_ionization_picmi.py @@ -94,16 +94,12 @@ period=10000, species=[electrons, ions], data_list=["ux", "uy", "uz", "x", "z", "weighting", "orig_z"], - write_dir=".", - warpx_file_prefix="Python_ionization_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=10000, data_list=["Bx", "By", "Bz", "Ex", "Ey", "Ez", "Jx", "Jy", "Jz"], - write_dir=".", - warpx_file_prefix="Python_ionization_plt", ) # Set up simulation diff --git a/Examples/Tests/langmuir/CMakeLists.txt b/Examples/Tests/langmuir/CMakeLists.txt new file mode 100644 index 00000000000..1223a23e4d2 --- /dev/null +++ b/Examples/Tests/langmuir/CMakeLists.txt @@ -0,0 +1,435 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_langmuir_multi # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_langmuir_multi # inputs + analysis_1d.py # analysis + diags/diag1000080 # output + OFF # dependency +) + +add_warpx_test( + test_2d_langmuir_multi_mr # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_mr # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency +) + +add_warpx_test( + test_2d_langmuir_multi_mr_anisotropic # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_mr_anisotropic # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency +) + +add_warpx_test( + test_2d_langmuir_multi_mr_momentum_conserving # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_mr_momentum_conserving # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency +) + +if(WarpX_FFT) + add_warpx_test( + test_2d_langmuir_multi_mr_psatd # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_mr_psatd # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +add_warpx_test( + test_2d_langmuir_multi_nodal # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_nodal # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency +) + +add_warpx_test( + test_2d_langmuir_multi_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000040 # output + OFF # dependency +) + +if(WarpX_FFT) + add_warpx_test( + test_2d_langmuir_multi_psatd # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_psatd # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_langmuir_multi_psatd_current_correction # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_psatd_current_correction # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_langmuir_multi_psatd_current_correction_nodal # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_psatd_current_correction_nodal # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_langmuir_multi_psatd_momentum_conserving # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_psatd_momentum_conserving # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_langmuir_multi_psatd_multiJ # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_psatd_multiJ # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_langmuir_multi_psatd_multiJ_nodal # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_psatd_multiJ_nodal # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_langmuir_multi_psatd_nodal # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_psatd_nodal # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_langmuir_multi_psatd_vay_deposition # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_psatd_vay_deposition # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_langmuir_multi_psatd_vay_deposition_nodal # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_psatd_vay_deposition_nodal # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_langmuir_multi_psatd_vay_deposition_particle_shape_4 # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_langmuir_multi_psatd_vay_deposition_particle_shape_4 # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +add_warpx_test( + test_3d_langmuir_multi # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency +) + +add_warpx_test( + test_3d_langmuir_multi_nodal # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_nodal # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency +) + +add_warpx_test( + test_3d_langmuir_multi_picmi # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000040 # output + OFF # dependency +) + +if(WarpX_FFT) + add_warpx_test( + test_3d_langmuir_multi_psatd # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_psatd # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_langmuir_multi_psatd_current_correction # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_psatd_current_correction # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_langmuir_multi_psatd_current_correction_nodal # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_psatd_current_correction_nodal # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_langmuir_multi_psatd_div_cleaning # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_psatd_div_cleaning # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_langmuir_multi_psatd_momentum_conserving # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_psatd_momentum_conserving # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_langmuir_multi_psatd_multiJ # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_psatd_multiJ # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_langmuir_multi_psatd_multiJ_nodal # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_psatd_multiJ_nodal # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_langmuir_multi_psatd_nodal # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_psatd_nodal # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_langmuir_multi_psatd_vay_deposition # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_psatd_vay_deposition # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_langmuir_multi_psatd_vay_deposition_nodal # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_langmuir_multi_psatd_vay_deposition_nodal # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency + ) +endif() + +add_warpx_test( + test_rz_langmuir_multi # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_langmuir_multi # inputs + analysis_rz.py # analysis + diags/diag1000080 # output + OFF # dependency +) + +add_warpx_test( + test_rz_langmuir_multi_picmi # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_langmuir_multi_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000040 # output + OFF # dependency +) + +if(WarpX_FFT) + add_warpx_test( + test_rz_langmuir_multi_psatd # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_langmuir_multi_psatd # inputs + analysis_rz.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_rz_langmuir_multi_psatd_current_correction # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_langmuir_multi_psatd_current_correction # inputs + analysis_rz.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_rz_langmuir_multi_psatd_multiJ # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_langmuir_multi_psatd_multiJ # inputs + analysis_rz.py # analysis + diags/diag1000080 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/langmuir/README.rst b/Examples/Tests/langmuir/README similarity index 100% rename from Examples/Tests/langmuir/README.rst rename to Examples/Tests/langmuir/README diff --git a/Examples/Tests/langmuir/analysis_1d.py b/Examples/Tests/langmuir/analysis_1d.py index 3ba21751671..d041ca03b36 100755 --- a/Examples/Tests/langmuir/analysis_1d.py +++ b/Examples/Tests/langmuir/analysis_1d.py @@ -29,14 +29,17 @@ sys.path.insert(1, "../../../../warpx/Regression/Checksum/") import checksumAPI +# test name +test_name = os.path.split(os.getcwd())[1] + # this will be the name of the plot file fn = sys.argv[1] # Parse test name and check if current correction (psatd.current_correction=1) is applied -current_correction = True if re.search("current_correction", fn) else False +current_correction = True if re.search("current_correction", test_name) else False # Parse test name and check if Vay current deposition (algo.current_deposition=vay) is used -vay_deposition = True if re.search("Vay_deposition", fn) else False +vay_deposition = True if re.search("vay_deposition", test_name) else False # Parameters (these parameters must match the parameters in `inputs.multi.rt`) epsilon = 0.01 @@ -123,5 +126,4 @@ def get_theoretical_field(field, t): print("tolerance = {}".format(tolerance)) assert error_rel < tolerance -test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, fn) diff --git a/Examples/Tests/langmuir/analysis_2d.py b/Examples/Tests/langmuir/analysis_2d.py index 8914b8b426c..ac98354c73b 100755 --- a/Examples/Tests/langmuir/analysis_2d.py +++ b/Examples/Tests/langmuir/analysis_2d.py @@ -29,19 +29,23 @@ sys.path.insert(1, "../../../../warpx/Regression/Checksum/") import checksumAPI +# test name +test_name = os.path.split(os.getcwd())[1] + # this will be the name of the plot file fn = sys.argv[1] # Parse test name and check if current correction (psatd.current_correction=1) is applied -current_correction = True if re.search("current_correction", fn) else False +current_correction = True if re.search("current_correction", test_name) else False # Parse test name and check if Vay current deposition (algo.current_deposition=vay) is used -vay_deposition = True if re.search("Vay_deposition", fn) else False +vay_deposition = True if re.search("vay_deposition", test_name) else False # Parse test name and check if particle_shape = 4 is used -particle_shape_4 = True if re.search("particle_shape_4", fn) else False +particle_shape_4 = True if re.search("particle_shape_4", test_name) else False -# Parameters (these parameters must match the parameters in `inputs.multi.rt`) +# Parameters (must match the parameters in the inputs) +# FIXME read these parameters from warpx_used_inputs epsilon = 0.01 n = 4.0e24 n_osc_x = 2 @@ -159,5 +163,4 @@ def get_theoretical_field(field, t): print("tolerance = {}".format(tolerance)) assert error_rel < tolerance -test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, fn) diff --git a/Examples/Tests/langmuir/analysis_3d.py b/Examples/Tests/langmuir/analysis_3d.py index 6fd58e62de4..9f4b2cc1f93 100755 --- a/Examples/Tests/langmuir/analysis_3d.py +++ b/Examples/Tests/langmuir/analysis_3d.py @@ -29,17 +29,20 @@ sys.path.insert(1, "../../../../warpx/Regression/Checksum/") import checksumAPI +# test name +test_name = os.path.split(os.getcwd())[1] + # this will be the name of the plot file fn = sys.argv[1] # Parse test name and check if current correction (psatd.current_correction=1) is applied -current_correction = True if re.search("current_correction", fn) else False +current_correction = True if re.search("current_correction", test_name) else False # Parse test name and check if Vay current deposition (algo.current_deposition=vay) is used -vay_deposition = True if re.search("Vay_deposition", fn) else False +vay_deposition = True if re.search("vay_deposition", test_name) else False # Parse test name and check if div(E)/div(B) cleaning (warpx.do_div_cleaning=1) is used -div_cleaning = True if re.search("div_cleaning", fn) else False +div_cleaning = True if re.search("div_cleaning", test_name) else False # Parameters (these parameters must match the parameters in `inputs.multi.rt`) epsilon = 0.01 @@ -178,8 +181,8 @@ def get_theoretical_field(field, t): assert error_rel < tolerance if div_cleaning: - ds_old = yt.load("Langmuir_multi_psatd_div_cleaning_plt000038") - ds_mid = yt.load("Langmuir_multi_psatd_div_cleaning_plt000039") + ds_old = yt.load("diags/diag1000038") + ds_mid = yt.load("diags/diag1000039") ds_new = yt.load(fn) # this is the last plotfile ad_old = ds_old.covering_grid( @@ -209,9 +212,7 @@ def get_theoretical_field(field, t): print("tolerance = {}".format(tolerance)) assert error_rel < tolerance -test_name = os.path.split(os.getcwd())[1] - -if re.search("single_precision", fn): +if re.search("single_precision", test_name): checksumAPI.evaluate_checksum(test_name, fn, rtol=1.0e-3) else: checksumAPI.evaluate_checksum(test_name, fn) diff --git a/Examples/Tests/langmuir/analysis_default_regression.py b/Examples/Tests/langmuir/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/langmuir/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/langmuir/analysis_rz.py b/Examples/Tests/langmuir/analysis_rz.py index 792394ea573..dd26fd29db7 100755 --- a/Examples/Tests/langmuir/analysis_rz.py +++ b/Examples/Tests/langmuir/analysis_rz.py @@ -35,10 +35,11 @@ # this will be the name of the plot file fn = sys.argv[1] +# test name test_name = os.path.split(os.getcwd())[1] # Parse test name and check if current correction (psatd.current_correction) is applied -current_correction = True if re.search("current_correction", fn) else False +current_correction = True if re.search("current_correction", test_name) else False # Parameters (these parameters must match the parameters in `inputs.multi.rz.rt`) epsilon = 0.01 diff --git a/Examples/Tests/langmuir/inputs_2d b/Examples/Tests/langmuir/inputs_base_2d similarity index 100% rename from Examples/Tests/langmuir/inputs_2d rename to Examples/Tests/langmuir/inputs_base_2d diff --git a/Examples/Tests/langmuir/inputs_3d b/Examples/Tests/langmuir/inputs_base_3d similarity index 100% rename from Examples/Tests/langmuir/inputs_3d rename to Examples/Tests/langmuir/inputs_base_3d diff --git a/Examples/Tests/langmuir/inputs_rz b/Examples/Tests/langmuir/inputs_base_rz similarity index 100% rename from Examples/Tests/langmuir/inputs_rz rename to Examples/Tests/langmuir/inputs_base_rz diff --git a/Examples/Tests/langmuir/inputs_1d b/Examples/Tests/langmuir/inputs_test_1d_langmuir_multi similarity index 95% rename from Examples/Tests/langmuir/inputs_1d rename to Examples/Tests/langmuir/inputs_test_1d_langmuir_multi index af1cf367553..e2fd1da4b94 100644 --- a/Examples/Tests/langmuir/inputs_1d +++ b/Examples/Tests/langmuir/inputs_test_1d_langmuir_multi @@ -27,6 +27,7 @@ warpx.verbose = 1 # Algorithms algo.field_gathering = energy-conserving +algo.current_deposition = esirkepov warpx.use_filter = 0 # Order of particle shape factors @@ -79,6 +80,8 @@ positrons.momentum_function_uz(x,y,z) = "-epsilon * k/kp * cos(k*x) * cos(k*y) * diagnostics.diags_names = diag1 openpmd diag1.intervals = 40 diag1.diag_type = Full +diag1.electrons.variables = z w ux uy uz +diag1.positrons.variables = z w ux uy uz openpmd.intervals = 40 openpmd.diag_type = Full diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr new file mode 100644 index 00000000000..8adf73023be --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr @@ -0,0 +1,12 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.maxwell_solver = ckc +amr.max_level = 1 +amr.ref_ratio = 4 +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +warpx.fine_tag_hi = 10.e-6 10.e-6 +warpx.fine_tag_lo = -10.e-6 -10.e-6 +warpx.use_filter = 1 diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr_anisotropic b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr_anisotropic new file mode 100644 index 00000000000..047943373c0 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr_anisotropic @@ -0,0 +1,12 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.maxwell_solver = ckc +amr.max_level = 1 +amr.ref_ratio_vect = 4 2 +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +warpx.fine_tag_hi = 10.e-6 10.e-6 +warpx.fine_tag_lo = -10.e-6 -10.e-6 +warpx.use_filter = 1 diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr_momentum_conserving b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr_momentum_conserving new file mode 100644 index 00000000000..201f19f32c2 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr_momentum_conserving @@ -0,0 +1,13 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.field_gathering = momentum-conserving +algo.maxwell_solver = ckc +amr.max_level = 1 +amr.ref_ratio = 4 +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +warpx.use_filter = 1 +warpx.fine_tag_lo = -10.e-6 -10.e-6 +warpx.fine_tag_hi = 10.e-6 10.e-6 diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr_psatd b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr_psatd new file mode 100644 index 00000000000..cf95a07e2fc --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_mr_psatd @@ -0,0 +1,14 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.maxwell_solver = psatd +amr.max_level = 1 +amr.ref_ratio = 4 +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +psatd.current_correction = 0 +warpx.abort_on_warning_threshold = medium +warpx.fine_tag_hi = 10.e-6 10.e-6 +warpx.fine_tag_lo = -10.e-6 -10.e-6 +warpx.use_filter = 1 diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_nodal b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_nodal new file mode 100644 index 00000000000..99d952d79d9 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_nodal @@ -0,0 +1,8 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.current_deposition = direct +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +warpx.grid_type = collocated diff --git a/Examples/Tests/langmuir/PICMI_inputs_2d.py b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_picmi.py similarity index 97% rename from Examples/Tests/langmuir/PICMI_inputs_2d.py rename to Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_picmi.py index 11020ac34fb..dc7fa3a2ba7 100755 --- a/Examples/Tests/langmuir/PICMI_inputs_2d.py +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_picmi.py @@ -73,8 +73,6 @@ grid=grid, period=diagnostic_intervals, data_list=["Ex", "Jx"], - write_dir=".", - warpx_file_prefix="Python_Langmuir_2d_plt", ) part_diag1 = picmi.ParticleDiagnostic( diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd new file mode 100644 index 00000000000..2386f9e462f --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd @@ -0,0 +1,11 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.maxwell_solver = psatd +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +diag1.fields_to_plot = Ex Ey Ez jx jy jz part_per_cell +psatd.current_correction = 0 +warpx.abort_on_warning_threshold = medium +warpx.cfl = 0.7071067811865475 diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_current_correction b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_current_correction new file mode 100644 index 00000000000..c56572ac957 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_current_correction @@ -0,0 +1,13 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.current_deposition = esirkepov +algo.maxwell_solver = psatd +amr.max_grid_size = 128 +diag1.fields_to_plot = Ex Ey Ez jx jy jz part_per_cell rho divE +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +psatd.current_correction = 1 +psatd.periodic_single_box_fft = 1 +warpx.cfl = 0.7071067811865475 diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_current_correction_nodal b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_current_correction_nodal new file mode 100644 index 00000000000..5359d8703f3 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_current_correction_nodal @@ -0,0 +1,14 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.current_deposition = direct +algo.maxwell_solver = psatd +amr.max_grid_size = 128 +diag1.fields_to_plot = Ex Ey Ez jx jy jz part_per_cell rho divE +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +psatd.current_correction = 1 +psatd.periodic_single_box_fft = 1 +warpx.cfl = 0.7071067811865475 +warpx.grid_type = collocated diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_momentum_conserving b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_momentum_conserving new file mode 100644 index 00000000000..694f65fe233 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_momentum_conserving @@ -0,0 +1,12 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.field_gathering = momentum-conserving +algo.maxwell_solver = psatd +diag1.fields_to_plot = Ex Ey Ez jx jy jz part_per_cell +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +psatd.current_correction = 0 +warpx.abort_on_warning_threshold = medium +warpx.cfl = 0.7071067811865475 diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_multiJ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_multiJ new file mode 100644 index 00000000000..793f077b0f7 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_multiJ @@ -0,0 +1,12 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.maxwell_solver = psatd +psatd.J_in_time = linear +psatd.solution_type = first-order +psatd.update_with_rho = 1 +warpx.abort_on_warning_threshold = medium +warpx.cfl = 0.7071067811865475 +warpx.do_multi_J = 1 +warpx.do_multi_J_n_depositions = 2 diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_multiJ_nodal b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_multiJ_nodal new file mode 100644 index 00000000000..573337abb76 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_multiJ_nodal @@ -0,0 +1,13 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.maxwell_solver = psatd +psatd.J_in_time = linear +psatd.solution_type = first-order +psatd.update_with_rho = 1 +warpx.abort_on_warning_threshold = medium +warpx.cfl = 0.7071067811865475 +warpx.do_multi_J = 1 +warpx.do_multi_J_n_depositions = 2 +warpx.grid_type = collocated diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_nodal b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_nodal new file mode 100644 index 00000000000..8f02d4f8aae --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_nodal @@ -0,0 +1,13 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.current_deposition = direct +algo.maxwell_solver = psatd +diag1.fields_to_plot = Ex Ey Ez jx jy jz part_per_cell +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +psatd.current_correction = 0 +warpx.abort_on_warning_threshold = medium +warpx.cfl = 0.7071067811865475 +warpx.grid_type = collocated diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_vay_deposition b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_vay_deposition new file mode 100644 index 00000000000..209e48e10e6 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_vay_deposition @@ -0,0 +1,11 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.current_deposition = vay +algo.maxwell_solver = psatd +amr.max_grid_size = 128 +diag1.fields_to_plot = Ex Ey Ez jx jy jz part_per_cell rho divE +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +warpx.cfl = 0.7071067811865475 diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_vay_deposition_nodal b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_vay_deposition_nodal new file mode 100644 index 00000000000..d327c1b37b2 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_vay_deposition_nodal @@ -0,0 +1,12 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.current_deposition = vay +algo.maxwell_solver = psatd +amr.max_grid_size = 128 +diag1.fields_to_plot = Ex Ey Ez jx jy jz part_per_cell rho divE +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +warpx.cfl = 0.7071067811865475 +warpx.grid_type = collocated diff --git a/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_vay_deposition_particle_shape_4 b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_vay_deposition_particle_shape_4 new file mode 100644 index 00000000000..fc5d780cef1 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_2d_langmuir_multi_psatd_vay_deposition_particle_shape_4 @@ -0,0 +1,12 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.current_deposition = vay +algo.maxwell_solver = psatd +algo.particle_shape = 4 +amr.max_grid_size = 128 +diag1.fields_to_plot = Ex Ey Ez jx jy jz part_per_cell rho divE +diag1.electrons.variables = x z w ux uy uz +diag1.positrons.variables = x z w ux uy uz +warpx.cfl = 0.7071067811865475 diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi new file mode 100644 index 00000000000..7665a846eef --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi @@ -0,0 +1,2 @@ +# base input parameters +FILE = inputs_base_3d diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_nodal b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_nodal new file mode 100644 index 00000000000..9620cd97f33 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_nodal @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.current_deposition = direct +warpx.grid_type = collocated diff --git a/Examples/Tests/langmuir/PICMI_inputs_3d.py b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_picmi.py similarity index 97% rename from Examples/Tests/langmuir/PICMI_inputs_3d.py rename to Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_picmi.py index e5cef203b7e..11ea1843e27 100755 --- a/Examples/Tests/langmuir/PICMI_inputs_3d.py +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_picmi.py @@ -75,8 +75,6 @@ grid=grid, period=diagnostic_interval, data_list=["Ex", "Jx"], - write_dir=".", - warpx_file_prefix="Python_Langmuir_plt", ) part_diag1 = picmi.ParticleDiagnostic( diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd new file mode 100644 index 00000000000..427de2993b1 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.maxwell_solver = psatd +warpx.cfl = 0.5773502691896258 diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_current_correction b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_current_correction new file mode 100644 index 00000000000..86f33d131ce --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_current_correction @@ -0,0 +1,10 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.current_deposition = esirkepov +algo.maxwell_solver = psatd +diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz part_per_cell rho divE +psatd.current_correction = 1 +psatd.periodic_single_box_fft = 1 +warpx.cfl = 0.5773502691896258 diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_current_correction_nodal b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_current_correction_nodal new file mode 100644 index 00000000000..7f67b9100b2 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_current_correction_nodal @@ -0,0 +1,11 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.current_deposition = direct +algo.maxwell_solver = psatd +diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz part_per_cell rho divE +psatd.current_correction = 1 +psatd.periodic_single_box_fft = 1 +warpx.cfl = 0.5773502691896258 +warpx.grid_type = collocated diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_div_cleaning b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_div_cleaning new file mode 100644 index 00000000000..d372b789336 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_div_cleaning @@ -0,0 +1,13 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.current_deposition = direct +algo.maxwell_solver = psatd +diag1.intervals = 0, 38:40:1 +diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz part_per_cell rho divE F +psatd.update_with_rho = 1 +warpx.abort_on_warning_threshold = medium +warpx.cfl = 0.5773502691896258 +warpx.do_dive_cleaning = 1 +warpx.do_divb_cleaning = 1 diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_momentum_conserving b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_momentum_conserving new file mode 100644 index 00000000000..15a4c7d6985 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_momentum_conserving @@ -0,0 +1,7 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.field_gathering = momentum-conserving +algo.maxwell_solver = psatd +warpx.cfl = 0.5773502691896258 diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_multiJ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_multiJ new file mode 100644 index 00000000000..e1cd25cd93d --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_multiJ @@ -0,0 +1,13 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.current_deposition = direct +algo.maxwell_solver = psatd +warpx.cfl = 0.5773502691896258 +warpx.do_multi_J = 1 +warpx.do_multi_J_n_depositions = 2 +psatd.J_in_time = linear +psatd.solution_type = first-order +psatd.update_with_rho = 1 +warpx.abort_on_warning_threshold = medium diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_multiJ_nodal b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_multiJ_nodal new file mode 100644 index 00000000000..4a828d2e8b5 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_multiJ_nodal @@ -0,0 +1,14 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.current_deposition = direct +algo.maxwell_solver = psatd +psatd.J_in_time = linear +psatd.solution_type = first-order +psatd.update_with_rho = 1 +warpx.abort_on_warning_threshold = medium +warpx.cfl = 0.5773502691896258 +warpx.do_multi_J = 1 +warpx.do_multi_J_n_depositions = 2 +warpx.grid_type = collocated diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_nodal b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_nodal new file mode 100644 index 00000000000..fd03e00968a --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_nodal @@ -0,0 +1,10 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.current_deposition = direct +algo.maxwell_solver = psatd +psatd.current_correction = 0 +warpx.abort_on_warning_threshold = medium +warpx.cfl = 0.5773502691896258 +warpx.grid_type = collocated diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_vay_deposition b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_vay_deposition new file mode 100644 index 00000000000..5e2ffa9d407 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_vay_deposition @@ -0,0 +1,8 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.current_deposition = vay +algo.maxwell_solver = psatd +diag1.fields_to_plot = Ex Ey Ez jx jy jz part_per_cell rho divE +warpx.cfl = 0.5773502691896258 diff --git a/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_vay_deposition_nodal b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_vay_deposition_nodal new file mode 100644 index 00000000000..df311b0fb3c --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_3d_langmuir_multi_psatd_vay_deposition_nodal @@ -0,0 +1,9 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.current_deposition = vay +algo.maxwell_solver = psatd +diag1.fields_to_plot = Ex Ey Ez jx jy jz part_per_cell rho divE +warpx.cfl = 0.5773502691896258 +warpx.grid_type = collocated diff --git a/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi b/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi new file mode 100644 index 00000000000..45665b67266 --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi @@ -0,0 +1,7 @@ +# base input parameters +FILE = inputs_base_rz + +# test input parameters +diag1.dump_rz_modes = 0 +diag1.electrons.variables = x y z w ux uy uz +diag1.ions.variables = x y z w ux uy uz diff --git a/Examples/Tests/langmuir/PICMI_inputs_rz.py b/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_picmi.py similarity index 99% rename from Examples/Tests/langmuir/PICMI_inputs_rz.py rename to Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_picmi.py index e1becedd62d..24eedd703d2 100755 --- a/Examples/Tests/langmuir/PICMI_inputs_rz.py +++ b/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_picmi.py @@ -118,8 +118,6 @@ grid=grid, period=diagnostic_intervals, data_list=["Er", "Ez", "Bt", "Jr", "Jz", "part_per_cell"], - write_dir=".", - warpx_file_prefix="Python_Langmuir_rz_multimode_plt", ) part_diag1 = picmi.ParticleDiagnostic( diff --git a/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_psatd b/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_psatd new file mode 100644 index 00000000000..5537335629d --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_psatd @@ -0,0 +1,15 @@ +# base input parameters +FILE = inputs_base_rz + +# test input parameters +algo.current_deposition = direct +algo.maxwell_solver = psatd +diag1.dump_rz_modes = 0 +diag1.electrons.variables = x y z w ux uy uz +diag1.ions.variables = x y z w ux uy uz +electrons.random_theta = 0 +ions.random_theta = 0 +psatd.current_correction = 0 +psatd.update_with_rho = 1 +warpx.abort_on_warning_threshold = medium +warpx.do_dive_cleaning = 0 diff --git a/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_psatd_current_correction b/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_psatd_current_correction new file mode 100644 index 00000000000..fac41cea4cd --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_psatd_current_correction @@ -0,0 +1,16 @@ +# base input parameters +FILE = inputs_base_rz + +# test input parameters +algo.current_deposition = direct +algo.maxwell_solver = psatd +amr.max_grid_size = 128 +diag1.dump_rz_modes = 0 +diag1.electrons.variables = x y z w ux uy uz +diag1.fields_to_plot = jr jz Er Ez Bt rho divE +diag1.ions.variables = x y z w ux uy uz +electrons.random_theta = 0 +ions.random_theta = 0 +psatd.current_correction = 1 +psatd.periodic_single_box_fft = 1 +warpx.do_dive_cleaning = 0 diff --git a/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_psatd_multiJ b/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_psatd_multiJ new file mode 100644 index 00000000000..0ff617af8eb --- /dev/null +++ b/Examples/Tests/langmuir/inputs_test_rz_langmuir_multi_psatd_multiJ @@ -0,0 +1,22 @@ +# base input parameters +FILE = inputs_base_rz + +# test input parameters +algo.current_deposition = direct +algo.maxwell_solver = psatd +amr.max_grid_size = 32 +diag1.dump_rz_modes = 0 +diag1.electrons.variables = x y z w ux uy uz +diag1.ions.variables = x y z w ux uy uz +electrons.num_particles_per_cell_each_dim = 2 4 2 +electrons.random_theta = 0 +ions.num_particles_per_cell_each_dim = 2 4 2 +ions.random_theta = 0 +psatd.current_correction = 0 +psatd.update_with_rho = 1 +warpx.abort_on_warning_threshold = medium +warpx.do_dive_cleaning = 0 +warpx.do_multi_J = 1 +warpx.do_multi_J_n_depositions = 4 +warpx.n_rz_azimuthal_modes = 2 +warpx.use_filter = 1 diff --git a/Examples/Tests/langmuir_fluids/CMakeLists.txt b/Examples/Tests/langmuir_fluids/CMakeLists.txt new file mode 100644 index 00000000000..8f3ab3ebc78 --- /dev/null +++ b/Examples/Tests/langmuir_fluids/CMakeLists.txt @@ -0,0 +1,46 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_langmuir_fluid # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_langmuir_fluid # inputs + analysis_1d.py # analysis + diags/diag1000080 # output + OFF # dependency +) + +add_warpx_test( + test_2d_langmuir_fluid # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_langmuir_fluid # inputs + analysis_2d.py # analysis + diags/diag1000080 # output + OFF # dependency +) + +add_warpx_test( + test_3d_langmuir_fluid # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_langmuir_fluid # inputs + analysis_3d.py # analysis + diags/diag1000040 # output + OFF # dependency +) + +add_warpx_test( + test_rz_langmuir_fluid # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_langmuir_fluid # inputs + analysis_rz.py # analysis + diags/diag1000080 # output + OFF # dependency +) diff --git a/Examples/Tests/langmuir_fluids/inputs_1d b/Examples/Tests/langmuir_fluids/inputs_test_1d_langmuir_fluid similarity index 100% rename from Examples/Tests/langmuir_fluids/inputs_1d rename to Examples/Tests/langmuir_fluids/inputs_test_1d_langmuir_fluid diff --git a/Examples/Tests/langmuir_fluids/inputs_2d b/Examples/Tests/langmuir_fluids/inputs_test_2d_langmuir_fluid similarity index 100% rename from Examples/Tests/langmuir_fluids/inputs_2d rename to Examples/Tests/langmuir_fluids/inputs_test_2d_langmuir_fluid diff --git a/Examples/Tests/langmuir_fluids/inputs_3d b/Examples/Tests/langmuir_fluids/inputs_test_3d_langmuir_fluid similarity index 100% rename from Examples/Tests/langmuir_fluids/inputs_3d rename to Examples/Tests/langmuir_fluids/inputs_test_3d_langmuir_fluid diff --git a/Examples/Tests/langmuir_fluids/inputs_rz b/Examples/Tests/langmuir_fluids/inputs_test_rz_langmuir_fluid similarity index 100% rename from Examples/Tests/langmuir_fluids/inputs_rz rename to Examples/Tests/langmuir_fluids/inputs_test_rz_langmuir_fluid diff --git a/Examples/Tests/larmor/CMakeLists.txt b/Examples/Tests/larmor/CMakeLists.txt new file mode 100644 index 00000000000..3ddcc394c98 --- /dev/null +++ b/Examples/Tests/larmor/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_larmor # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_larmor # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency +) diff --git a/Examples/Tests/larmor/analysis_default_regression.py b/Examples/Tests/larmor/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/larmor/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/larmor/inputs_2d_mr b/Examples/Tests/larmor/inputs_test_2d_larmor similarity index 99% rename from Examples/Tests/larmor/inputs_2d_mr rename to Examples/Tests/larmor/inputs_test_2d_larmor index 5d7af3d67a4..76e4f76ee22 100644 --- a/Examples/Tests/larmor/inputs_2d_mr +++ b/Examples/Tests/larmor/inputs_test_2d_larmor @@ -1,5 +1,5 @@ # Maximum number of time steps -max_step = 400 +max_step = 10 # number of grid points amr.n_cell = 64 64 diff --git a/Examples/Tests/laser_injection/CMakeLists.txt b/Examples/Tests/laser_injection/CMakeLists.txt new file mode 100644 index 00000000000..577b8bdcebc --- /dev/null +++ b/Examples/Tests/laser_injection/CMakeLists.txt @@ -0,0 +1,35 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_laser_injection # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_laser_injection # inputs + analysis_1d.py # analysis + diags/diag1000240 # output + OFF # dependency +) + +add_warpx_test( + test_2d_laser_injection # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_laser_injection # inputs + analysis_2d.py # analysis + diags/diag1000240 # output + OFF # dependency +) + +add_warpx_test( + test_3d_laser_injection # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_laser_injection # inputs + analysis_3d.py # analysis + diags/diag1000020 # output + OFF # dependency +) diff --git a/Examples/Tests/laser_injection/analysis_laser.py b/Examples/Tests/laser_injection/analysis_3d.py similarity index 100% rename from Examples/Tests/laser_injection/analysis_laser.py rename to Examples/Tests/laser_injection/analysis_3d.py diff --git a/Examples/Tests/laser_injection/inputs_1d_rt b/Examples/Tests/laser_injection/inputs_test_1d_laser_injection similarity index 100% rename from Examples/Tests/laser_injection/inputs_1d_rt rename to Examples/Tests/laser_injection/inputs_test_1d_laser_injection diff --git a/Examples/Tests/laser_injection/inputs_2d_rt b/Examples/Tests/laser_injection/inputs_test_2d_laser_injection similarity index 100% rename from Examples/Tests/laser_injection/inputs_2d_rt rename to Examples/Tests/laser_injection/inputs_test_2d_laser_injection diff --git a/Examples/Tests/laser_injection/inputs_3d_rt b/Examples/Tests/laser_injection/inputs_test_3d_laser_injection similarity index 99% rename from Examples/Tests/laser_injection/inputs_3d_rt rename to Examples/Tests/laser_injection/inputs_test_3d_laser_injection index 72464f86aaf..250a0160881 100644 --- a/Examples/Tests/laser_injection/inputs_3d_rt +++ b/Examples/Tests/laser_injection/inputs_test_3d_laser_injection @@ -1,5 +1,5 @@ # Maximum number of time steps -max_step = 1000 +max_step = 20 # number of grid points amr.n_cell = 32 32 240 diff --git a/Examples/Tests/laser_injection_from_file/CMakeLists.txt b/Examples/Tests/laser_injection_from_file/CMakeLists.txt new file mode 100644 index 00000000000..a4f09f6895d --- /dev/null +++ b/Examples/Tests/laser_injection_from_file/CMakeLists.txt @@ -0,0 +1,156 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_laser_injection_from_lasy_file_prepare # name + 1 # dims + 1 # nprocs + OFF # eb + inputs_test_1d_laser_injection_from_lasy_file_prepare.py # inputs + OFF # analysis + OFF # output + OFF # dependency +) + +add_warpx_test( + test_1d_laser_injection_from_lasy_file # name + 1 # dims + 1 # nprocs + OFF # eb + inputs_test_1d_laser_injection_from_lasy_file # inputs + analysis_1d.py # analysis + diags/diag1000251 # output + test_1d_laser_injection_from_lasy_file_prepare # dependency +) + +add_warpx_test( + test_1d_laser_injection_from_lasy_file_boost_prepare # name + 1 # dims + 1 # nprocs + OFF # eb + inputs_test_1d_laser_injection_from_lasy_file_boost_prepare.py # inputs + OFF # analysis + OFF # output + OFF # dependency +) + +add_warpx_test( + test_1d_laser_injection_from_lasy_file_boost # name + 1 # dims + 1 # nprocs + OFF # eb + inputs_test_1d_laser_injection_from_lasy_file_boost # inputs + analysis_1d_boost.py # analysis + diags/diag1000001 # output + test_1d_laser_injection_from_lasy_file_boost_prepare # dependency +) + +add_warpx_test( + test_2d_laser_injection_from_binary_file_prepare # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_laser_injection_from_binary_file_prepare.py # inputs + OFF # analysis + OFF # output + OFF # dependency +) + +add_warpx_test( + test_2d_laser_injection_from_binary_file # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_laser_injection_from_binary_file # inputs + analysis_2d_binary.py # analysis + diags/diag1000250 # output + test_2d_laser_injection_from_binary_file_prepare # dependency +) + +add_warpx_test( + test_2d_laser_injection_from_lasy_file_prepare # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_laser_injection_from_lasy_file_prepare.py # inputs + OFF # analysis + OFF # output + OFF # dependency +) + +add_warpx_test( + test_2d_laser_injection_from_lasy_file # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_laser_injection_from_lasy_file # inputs + analysis_2d.py # analysis + diags/diag1000251 # output + test_2d_laser_injection_from_lasy_file_prepare # dependency +) + +add_warpx_test( + test_3d_laser_injection_from_lasy_file_prepare # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_laser_injection_from_lasy_file_prepare.py # inputs + OFF # analysis + OFF # output + OFF # dependency +) + +add_warpx_test( + test_3d_laser_injection_from_lasy_file # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_laser_injection_from_lasy_file # inputs + analysis_3d.py # analysis + diags/diag1000251 # output + test_3d_laser_injection_from_lasy_file_prepare # dependency +) + +add_warpx_test( + test_rz_laser_injection_from_lasy_file_prepare # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_laser_injection_from_lasy_file_prepare.py # inputs + OFF # analysis + OFF # output + OFF # dependency +) + +add_warpx_test( + test_rz_laser_injection_from_lasy_file # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_laser_injection_from_lasy_file # inputs + analysis_rz.py # analysis + diags/diag1000252 # output + test_rz_laser_injection_from_lasy_file_prepare # dependency +) + +add_warpx_test( + test_rz_laser_injection_from_RZ_lasy_file_prepare # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_laser_injection_from_RZ_lasy_file_prepare.py # inputs + OFF # analysis + OFF # output + OFF # dependency +) + +add_warpx_test( + test_rz_laser_injection_from_RZ_lasy_file # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_laser_injection_from_RZ_lasy_file # inputs + analysis_from_RZ_file.py # analysis + diags/diag1000612 # output + test_rz_laser_injection_from_RZ_lasy_file_prepare # dependency +) diff --git a/Examples/Tests/laser_injection_from_file/analysis_1d.py b/Examples/Tests/laser_injection_from_file/analysis_1d.py index e9bab5e8783..1b5f209cb91 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_1d.py +++ b/Examples/Tests/laser_injection_from_file/analysis_1d.py @@ -9,14 +9,10 @@ # This file is part of the WarpX automated test suite. It is used to test the -# injection of a laser pulse from an external lasy file. -# -# - Generate an input lasy file with a gaussian laser pulse. -# - Run the WarpX simulation for time T, when the pulse is fully injected +# injection of a laser pulse from an external lasy file: # - Compute the theory for laser envelope at time T # - Compare theory and simulation in 1D, for both envelope and central frequency -import glob import os import sys @@ -61,94 +57,61 @@ def gauss_env(T, Z): return E_max * np.real(np.exp(exp_arg)) -def do_analysis(fname, compname, steps): - ds = yt.load(fname) - dt = ds.current_time.to_value() / steps - - z = np.linspace( - ds.domain_left_edge[0].v, ds.domain_right_edge[0].v, ds.domain_dimensions[0] - ) - - # Compute the theory for envelope - env_theory = gauss_env(+t_c - ds.current_time.to_value(), z) + gauss_env( - -t_c + ds.current_time.to_value(), z - ) - - # Read laser field in PIC simulation, and compute envelope - all_data_level_0 = ds.covering_grid( - level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions - ) - F_laser = all_data_level_0["boxlib", "Ey"].v.squeeze() - env = abs(hilbert(F_laser)) - - # Plot results - plt.figure(figsize=(8, 8)) - plt.subplot(221) - plt.title("PIC field") - plt.plot(z, F_laser) - plt.subplot(222) - plt.title("PIC envelope") - plt.plot(z, env) - plt.subplot(223) - plt.title("Theory envelope") - plt.plot(z, env_theory) - plt.subplot(224) - plt.title("Difference") - plt.plot(z, env - env_theory) - - plt.tight_layout() - plt.savefig(compname, bbox_inches="tight") - - relative_error_env = np.sum(np.abs(env - env_theory)) / np.sum(np.abs(env)) - print("Relative error envelope: ", relative_error_env) - assert relative_error_env < relative_error_threshold - - fft_F_laser = np.fft.fftn(F_laser) - - freq_z = np.fft.fftfreq(F_laser.shape[0], dt) - - pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) - - freq = np.abs(freq_z[pos_max[0]]) - exp_freq = c / wavelength - relative_error_freq = np.abs(freq - exp_freq) / exp_freq - print("Relative error frequency: ", relative_error_freq) - assert relative_error_freq < relative_error_threshold - - -def launch_analysis(executable): - os.system( - "./" + executable + " inputs.1d_test diag1.file_prefix=diags/plotfiles/plt" - ) - do_analysis("diags/plotfiles/plt000251/", "comp_unf.pdf", 251) - - -def main(): - from lasy.laser import Laser - from lasy.profiles import GaussianProfile - - # Create a laser using lasy - pol = (1, 0) - profile = GaussianProfile(wavelength, pol, laser_energy, w0, tt, t_peak=0) - dim = "xyt" - lo = (-25e-6, -25e-6, -20e-15) - hi = (+25e-6, +25e-6, +20e-15) - npoints = (100, 100, 100) - laser = Laser(dim, lo, hi, npoints, profile) - laser.normalize(laser_energy, kind="energy") - laser.write_to_file("gaussianlaser3d") - executables = glob.glob("*.ex") - if len(executables) == 1: - launch_analysis(executables[0]) - else: - assert False - - # Do the checksum test - filename_end = "diags/plotfiles/plt000251/" - test_name = os.path.split(os.getcwd())[1] - checksumAPI.evaluate_checksum(test_name, filename_end) - print("Passed") - - -if __name__ == "__main__": - main() +filename = sys.argv[1] +compname = "comp_unf.pdf" +steps = 251 +ds = yt.load(filename) +dt = ds.current_time.to_value() / steps + +z = np.linspace( + ds.domain_left_edge[0].v, ds.domain_right_edge[0].v, ds.domain_dimensions[0] +) + +# Compute the theory for envelope +env_theory = gauss_env(+t_c - ds.current_time.to_value(), z) + gauss_env( + -t_c + ds.current_time.to_value(), z +) + +# Read laser field in PIC simulation, and compute envelope +all_data_level_0 = ds.covering_grid( + level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions +) +F_laser = all_data_level_0["boxlib", "Ey"].v.squeeze() +env = abs(hilbert(F_laser)) + +# Plot results +plt.figure(figsize=(8, 8)) +plt.subplot(221) +plt.title("PIC field") +plt.plot(z, F_laser) +plt.subplot(222) +plt.title("PIC envelope") +plt.plot(z, env) +plt.subplot(223) +plt.title("Theory envelope") +plt.plot(z, env_theory) +plt.subplot(224) +plt.title("Difference") +plt.plot(z, env - env_theory) + +plt.tight_layout() +plt.savefig(compname, bbox_inches="tight") + +relative_error_env = np.sum(np.abs(env - env_theory)) / np.sum(np.abs(env)) +print("Relative error envelope: ", relative_error_env) +assert relative_error_env < relative_error_threshold + +fft_F_laser = np.fft.fftn(F_laser) + +freq_z = np.fft.fftfreq(F_laser.shape[0], dt) + +pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) + +freq = np.abs(freq_z[pos_max[0]]) +exp_freq = c / wavelength +relative_error_freq = np.abs(freq - exp_freq) / exp_freq +print("Relative error frequency: ", relative_error_freq) +assert relative_error_freq < relative_error_threshold + +test_name = os.path.split(os.getcwd())[1] +checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/laser_injection_from_file/analysis_1d_boost.py b/Examples/Tests/laser_injection_from_file/analysis_1d_boost.py index 279b29f14ce..89c0ea3c57c 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_1d_boost.py +++ b/Examples/Tests/laser_injection_from_file/analysis_1d_boost.py @@ -9,14 +9,10 @@ # This file is part of the WarpX automated test suite. It is used to test the -# injection of a laser pulse from an external lasy file. -# -# - Generate an input lasy file with a gaussian laser pulse. -# - Run the WarpX simulation for time T, when the pulse is fully injected +# injection of a laser pulse from an external lasy file: # - Compute the theory for laser envelope at time T # - Compare theory and simulation in 1D, for both envelope and central frequency -import glob import os import sys @@ -61,99 +57,62 @@ def gauss_env(T, Z): return E_max * np.real(np.exp(exp_arg)) -def do_analysis(fname, compname): - ds = yt.load(fname) - dz = (ds.domain_right_edge[0].v - ds.domain_left_edge[0].v) / ds.domain_dimensions[ - 0 - ] - dt = dz / c - - z = np.linspace( - ds.domain_left_edge[0].v, ds.domain_right_edge[0].v, ds.domain_dimensions[0] - ) - - # Compute the theory for envelope - env_theory = gauss_env(+t_c - ds.current_time.to_value(), z) + gauss_env( - -t_c + ds.current_time.to_value(), z - ) - - # Read laser field in PIC simulation, and compute envelope - all_data_level_0 = ds.covering_grid( - level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions - ) - F_laser = all_data_level_0["boxlib", "Ey"].v.squeeze() - env = abs(hilbert(F_laser)) - - # Plot results - plt.figure(figsize=(8, 8)) - plt.subplot(221) - plt.title("PIC field") - plt.plot(z, F_laser) - plt.subplot(222) - plt.title("PIC envelope") - plt.plot(z, env) - plt.subplot(223) - plt.title("Theory envelope") - plt.plot(z, env_theory) - plt.subplot(224) - plt.title("Difference") - plt.plot(z, env - env_theory) - - plt.tight_layout() - plt.savefig(compname, bbox_inches="tight") - - relative_error_env = np.sum(np.abs(env - env_theory)) / np.sum(np.abs(env)) - print("Relative error envelope: ", relative_error_env) - assert relative_error_env < relative_error_threshold - - fft_F_laser = np.fft.fftn(F_laser) - - freq_z = np.fft.fftfreq(F_laser.shape[0], dt) - - pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) - - freq = np.abs(freq_z[pos_max[0]]) - exp_freq = c / wavelength - relative_error_freq = np.abs(freq - exp_freq) / exp_freq - print("Relative error frequency: ", relative_error_freq) - assert relative_error_freq < relative_error_threshold - - -def launch_analysis(executable): - os.system( - "./" - + executable - + " inputs.1d_boost_test diag1.file_prefix=diags/plotfiles/plt" - ) - do_analysis("diags/plotfiles/plt000001/", "comp_unf.pdf") - - -def main(): - from lasy.laser import Laser - from lasy.profiles import GaussianProfile - - # Create a laser using lasy - pol = (1, 0) - profile = GaussianProfile(wavelength, pol, laser_energy, w0, tt, t_peak=0) - dim = "xyt" - lo = (-25e-6, -25e-6, -20e-15) - hi = (+25e-6, +25e-6, +20e-15) - npoints = (100, 100, 100) - laser = Laser(dim, lo, hi, npoints, profile) - laser.normalize(laser_energy, kind="energy") - laser.write_to_file("gaussianlaser3d") - executables = glob.glob("*.ex") - if len(executables) == 1: - launch_analysis(executables[0]) - else: - assert False - - # Do the checksum test - filename_end = "diags/plotfiles/plt000001/" - test_name = os.path.split(os.getcwd())[1] - checksumAPI.evaluate_checksum(test_name, filename_end) - print("Passed") - - -if __name__ == "__main__": - main() +filename = sys.argv[1] +compname = "comp_unf.pdf" +ds = yt.load(filename) +dz = (ds.domain_right_edge[0].v - ds.domain_left_edge[0].v) / ds.domain_dimensions[0] +dt = dz / c + +z = np.linspace( + ds.domain_left_edge[0].v, ds.domain_right_edge[0].v, ds.domain_dimensions[0] +) + +# Compute the theory for envelope +env_theory = gauss_env(+t_c - ds.current_time.to_value(), z) + gauss_env( + -t_c + ds.current_time.to_value(), z +) + +# Read laser field in PIC simulation, and compute envelope +all_data_level_0 = ds.covering_grid( + level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions +) +F_laser = all_data_level_0["boxlib", "Ey"].v.squeeze() +env = abs(hilbert(F_laser)) + +# Plot results +plt.figure(figsize=(8, 8)) +plt.subplot(221) +plt.title("PIC field") +plt.plot(z, F_laser) +plt.subplot(222) +plt.title("PIC envelope") +plt.plot(z, env) +plt.subplot(223) +plt.title("Theory envelope") +plt.plot(z, env_theory) +plt.subplot(224) +plt.title("Difference") +plt.plot(z, env - env_theory) + +plt.tight_layout() +plt.savefig(compname, bbox_inches="tight") + +relative_error_env = np.sum(np.abs(env - env_theory)) / np.sum(np.abs(env)) +print("Relative error envelope: ", relative_error_env) +assert relative_error_env < relative_error_threshold + +fft_F_laser = np.fft.fftn(F_laser) + +freq_z = np.fft.fftfreq(F_laser.shape[0], dt) + +pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) + +freq = np.abs(freq_z[pos_max[0]]) +exp_freq = c / wavelength +relative_error_freq = np.abs(freq - exp_freq) / exp_freq +print("Relative error frequency: ", relative_error_freq) +assert relative_error_freq < relative_error_threshold + +# Do the checksum test +test_name = os.path.split(os.getcwd())[1] +checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/laser_injection_from_file/analysis_2d.py b/Examples/Tests/laser_injection_from_file/analysis_2d.py index 18c178cea15..ab5649e968f 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_2d.py +++ b/Examples/Tests/laser_injection_from_file/analysis_2d.py @@ -9,14 +9,10 @@ # This file is part of the WarpX automated test suite. It is used to test the -# injection of a laser pulse from an external lasy file. -# -# - Generate an input lasy file with a gaussian laser pulse. -# - Run the WarpX simulation for time T, when the pulse is fully injected +# injection of a laser pulse from an external lasy file: # - Compute the theory for laser envelope at time T # - Compare theory and simulation in 2D, for both envelope and central frequency -import glob import os import sys @@ -66,115 +62,82 @@ def gauss_env(T, X, Y, Z): return E_max * np.real(np.exp(exp_arg)) -def do_analysis(fname, compname, steps): - ds = yt.load(fname) - dt = ds.current_time.to_value() / steps - - # Define 3D meshes - x = np.linspace( - ds.domain_left_edge[0], ds.domain_right_edge[0], ds.domain_dimensions[0] - ).v - y = np.linspace( - ds.domain_left_edge[1], ds.domain_right_edge[1], ds.domain_dimensions[1] - ).v - z = np.linspace( - ds.domain_left_edge[ds.dimensionality - 1], - ds.domain_right_edge[ds.dimensionality - 1], - ds.domain_dimensions[ds.dimensionality - 1], - ).v - X, Y, Z = np.meshgrid(x, y, z, sparse=False, indexing="ij") - - # Compute the theory for envelope - env_theory = gauss_env(+t_c - ds.current_time.to_value(), X, Y, Z) + gauss_env( - -t_c + ds.current_time.to_value(), X, Y, Z - ) +filename = sys.argv[1] +compname = "comp_unf.pdf" +steps = 251 +ds = yt.load(filename) +dt = ds.current_time.to_value() / steps + +# Define 3D meshes +x = np.linspace( + ds.domain_left_edge[0], ds.domain_right_edge[0], ds.domain_dimensions[0] +).v +y = np.linspace( + ds.domain_left_edge[1], ds.domain_right_edge[1], ds.domain_dimensions[1] +).v +z = np.linspace( + ds.domain_left_edge[ds.dimensionality - 1], + ds.domain_right_edge[ds.dimensionality - 1], + ds.domain_dimensions[ds.dimensionality - 1], +).v +X, Y, Z = np.meshgrid(x, y, z, sparse=False, indexing="ij") + +# Compute the theory for envelope +env_theory = gauss_env(+t_c - ds.current_time.to_value(), X, Y, Z) + gauss_env( + -t_c + ds.current_time.to_value(), X, Y, Z +) - # Read laser field in PIC simulation, and compute envelope - all_data_level_0 = ds.covering_grid( - level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions - ) - F_laser = all_data_level_0["boxlib", "Ey"].v.squeeze() - env = abs(hilbert(F_laser)) - extent = [ - ds.domain_left_edge[ds.dimensionality - 1], - ds.domain_right_edge[ds.dimensionality - 1], - ds.domain_left_edge[0], - ds.domain_right_edge[0], - ] - env_theory_slice = env_theory[:, env_theory.shape[1] // 2, :] - - # Plot results - plt.figure(figsize=(8, 6)) - plt.subplot(221) - plt.title("PIC field") - plt.imshow(F_laser, extent=extent) - plt.colorbar() - plt.subplot(222) - plt.title("PIC envelope") - plt.imshow(env, extent=extent) - plt.colorbar() - plt.subplot(223) - plt.title("Theory envelope") - plt.imshow(env_theory_slice, extent=extent) - plt.colorbar() - plt.subplot(224) - plt.title("Difference") - plt.imshow(env - env_theory_slice, extent=extent) - plt.colorbar() - plt.tight_layout() - plt.savefig(compname, bbox_inches="tight") - - relative_error_env = np.sum(np.abs(env - env_theory_slice)) / np.sum(np.abs(env)) - print("Relative error envelope: ", relative_error_env) - assert relative_error_env < relative_error_threshold - - fft_F_laser = np.fft.fftn(F_laser) - - freq_x = np.fft.fftfreq(F_laser.shape[0], dt) - freq_z = np.fft.fftfreq(F_laser.shape[1], dt) - - pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) - - freq = np.sqrt((freq_x[pos_max[0]]) ** 2 + (freq_z[pos_max[1]]) ** 2) - exp_freq = c / wavelength - relative_error_freq = np.abs(freq - exp_freq) / exp_freq - print("Relative error frequency: ", relative_error_freq) - assert relative_error_freq < relative_error_threshold - - -def launch_analysis(executable): - os.system( - "./" + executable + " inputs.2d_test diag1.file_prefix=diags/plotfiles/plt" - ) - do_analysis("diags/plotfiles/plt000251/", "comp_unf.pdf", 251) - - -def main(): - from lasy.laser import Laser - from lasy.profiles import GaussianProfile - - # Create a laser using lasy - pol = (1, 0) - profile = GaussianProfile(wavelength, pol, laser_energy, w0, tt, t_peak=0) - dim = "xyt" - lo = (-25e-6, -25e-6, -20e-15) - hi = (+25e-6, +25e-6, +20e-15) - npoints = (100, 100, 100) - laser = Laser(dim, lo, hi, npoints, profile) - laser.normalize(laser_energy, kind="energy") - laser.write_to_file("gaussianlaser3d") - executables = glob.glob("*.ex") - if len(executables) == 1: - launch_analysis(executables[0]) - else: - assert False - - # Do the checksum test - filename_end = "diags/plotfiles/plt000251/" - test_name = os.path.split(os.getcwd())[1] - checksumAPI.evaluate_checksum(test_name, filename_end) - print("Passed") - - -if __name__ == "__main__": - main() +# Read laser field in PIC simulation, and compute envelope +all_data_level_0 = ds.covering_grid( + level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions +) +F_laser = all_data_level_0["boxlib", "Ey"].v.squeeze() +env = abs(hilbert(F_laser)) +extent = [ + ds.domain_left_edge[ds.dimensionality - 1], + ds.domain_right_edge[ds.dimensionality - 1], + ds.domain_left_edge[0], + ds.domain_right_edge[0], +] +env_theory_slice = env_theory[:, env_theory.shape[1] // 2, :] + +# Plot results +plt.figure(figsize=(8, 6)) +plt.subplot(221) +plt.title("PIC field") +plt.imshow(F_laser, extent=extent) +plt.colorbar() +plt.subplot(222) +plt.title("PIC envelope") +plt.imshow(env, extent=extent) +plt.colorbar() +plt.subplot(223) +plt.title("Theory envelope") +plt.imshow(env_theory_slice, extent=extent) +plt.colorbar() +plt.subplot(224) +plt.title("Difference") +plt.imshow(env - env_theory_slice, extent=extent) +plt.colorbar() +plt.tight_layout() +plt.savefig(compname, bbox_inches="tight") + +relative_error_env = np.sum(np.abs(env - env_theory_slice)) / np.sum(np.abs(env)) +print("Relative error envelope: ", relative_error_env) +assert relative_error_env < relative_error_threshold + +fft_F_laser = np.fft.fftn(F_laser) + +freq_x = np.fft.fftfreq(F_laser.shape[0], dt) +freq_z = np.fft.fftfreq(F_laser.shape[1], dt) + +pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) + +freq = np.sqrt((freq_x[pos_max[0]]) ** 2 + (freq_z[pos_max[1]]) ** 2) +exp_freq = c / wavelength +relative_error_freq = np.abs(freq - exp_freq) / exp_freq +print("Relative error frequency: ", relative_error_freq) +assert relative_error_freq < relative_error_threshold + +test_name = os.path.split(os.getcwd())[1] +checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/laser_injection_from_file/analysis_2d_binary.py b/Examples/Tests/laser_injection_from_file/analysis_2d_binary.py index 44030261732..bcb13bba410 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_2d_binary.py +++ b/Examples/Tests/laser_injection_from_file/analysis_2d_binary.py @@ -9,14 +9,10 @@ # This file is part of the WarpX automated test suite. It is used to test the -# injection of a laser pulse from an external binary file. -# -# - Generate an input binary file with a gaussian laser pulse. -# - Run the WarpX simulation for time T, when the pulse is fully injected +# injection of a laser pulse from an external binary file: # - Compute the theory for laser envelope at time T # - Compare theory and simulation in 2D, for both envelope and central frequency -import glob import os import sys @@ -62,30 +58,6 @@ xcoords = np.linspace(x_l, x_r, x_points) -def gauss(T, X, Y, opt): - """Compute the electric field for a Gaussian laser pulse. - This is used to write the binary input file. - """ - - k0 = 2.0 * np.pi / wavelength - inv_tau2 = 1.0 / tt / tt - osc_phase = k0 * c * (T - t_c) - - diff_factor = 1.0 + 1.0j * foc_dist * 2 / (k0 * w0 * w0) - inv_w_2 = 1.0 / (w0 * w0 * diff_factor) - - pre_fact = np.exp(1.0j * osc_phase) - - if opt == "3d": - pre_fact = pre_fact / diff_factor - else: - pre_fact = pre_fact / np.sqrt(diff_factor) - - exp_arg = -(X * X + Y * Y) * inv_w_2 - inv_tau2 * (T - t_c) * (T - t_c) - - return np.real(pre_fact * np.exp(exp_arg)) - - # Function for the envelope def gauss_env(T, XX, ZZ): """Function to compute the theory for the envelope""" @@ -99,134 +71,80 @@ def gauss_env(T, XX, ZZ): return E_max * np.real(np.exp(exp_arg)) -def write_file(fname, x, y, t, E): - """For a given filename fname, space coordinates x and y, time coordinate t - and field E, write a WarpX-compatible input binary file containing the - profile of the laser pulse. This function should be used in the case - of a uniform spatio-temporal mesh - """ - - with open(fname, "wb") as file: - flag_unif = 1 - file.write(flag_unif.to_bytes(1, byteorder="little")) - file.write((len(t)).to_bytes(4, byteorder="little", signed=False)) - file.write((len(x)).to_bytes(4, byteorder="little", signed=False)) - file.write((len(y)).to_bytes(4, byteorder="little", signed=False)) - file.write(t[0].tobytes()) - file.write(t[-1].tobytes()) - file.write(x[0].tobytes()) - file.write(x[-1].tobytes()) - if len(y) == 1: - file.write(y[0].tobytes()) - else: - file.write(y[0].tobytes()) - file.write(y[-1].tobytes()) - file.write(E.tobytes()) - - -def create_gaussian_2d(): - T, X, Y = np.meshgrid(tcoords, xcoords, np.array([0.0]), indexing="ij") - E_t = gauss(T, X, Y, "2d") - write_file("gauss_2d", xcoords, np.array([0.0]), tcoords, E_t) - - -def do_analysis(fname, compname, steps): - ds = yt.load(fname) - - dt = ds.current_time.to_value() / steps - - # Define 2D meshes - x = np.linspace( - ds.domain_left_edge[0], ds.domain_right_edge[0], ds.domain_dimensions[0] - ).v - z = np.linspace( - ds.domain_left_edge[ds.dimensionality - 1], - ds.domain_right_edge[ds.dimensionality - 1], - ds.domain_dimensions[ds.dimensionality - 1], - ).v - X, Z = np.meshgrid(x, z, sparse=False, indexing="ij") - - # Compute the theory for envelope - env_theory = gauss_env(+t_c - ds.current_time.to_value(), X, Z) + gauss_env( - -t_c + ds.current_time.to_value(), X, Z - ) - - # Read laser field in PIC simulation, and compute envelope - all_data_level_0 = ds.covering_grid( - level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions - ) - F_laser = all_data_level_0["boxlib", "Ey"].v.squeeze() - env = abs(hilbert(F_laser)) - extent = [ - ds.domain_left_edge[ds.dimensionality - 1], - ds.domain_right_edge[ds.dimensionality - 1], - ds.domain_left_edge[0], - ds.domain_right_edge[0], - ] - - # Plot results - plt.figure(figsize=(8, 6)) - plt.subplot(221) - plt.title("PIC field") - plt.imshow(F_laser, extent=extent) - plt.colorbar() - plt.subplot(222) - plt.title("PIC envelope") - plt.imshow(env, extent=extent) - plt.colorbar() - plt.subplot(223) - plt.title("Theory envelope") - plt.imshow(env_theory, extent=extent) - plt.colorbar() - plt.subplot(224) - plt.title("Difference") - plt.imshow(env - env_theory, extent=extent) - plt.colorbar() - plt.tight_layout() - plt.savefig(compname, bbox_inches="tight") - - relative_error_env = np.sum(np.abs(env - env_theory)) / np.sum(np.abs(env)) - print("Relative error envelope: ", relative_error_env) - assert relative_error_env < relative_error_threshold - - fft_F_laser = np.fft.fft2(F_laser) - - freq_rows = np.fft.fftfreq(F_laser.shape[0], dt) - freq_cols = np.fft.fftfreq(F_laser.shape[1], dt) - - pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) - - freq = np.sqrt((freq_rows[pos_max[0]]) ** 2 + (freq_cols[pos_max[1]] ** 2)) - exp_freq = c / wavelength - - relative_error_freq = np.abs(freq - exp_freq) / exp_freq - print("Relative error frequency: ", relative_error_freq) - assert relative_error_freq < relative_error_threshold - - -def launch_analysis(executable): - create_gaussian_2d() - os.system( - "./" - + executable - + " inputs.2d_test_binary diag1.file_prefix=diags/plotfiles/plt" - ) - do_analysis("diags/plotfiles/plt000250/", "comp_unf.pdf", 250) - - -def main(): - executables = glob.glob("*.ex") - if len(executables) == 1: - launch_analysis(executables[0]) - else: - assert False - - # Do the checksum test - filename_end = "diags/plotfiles/plt000250/" - test_name = "LaserInjectionFromBINARYFile" - checksumAPI.evaluate_checksum(test_name, filename_end) - print("Passed") - - -if __name__ == "__main__": - main() +filename = sys.argv[1] +compname = "comp_unf.pdf" +steps = 250 +ds = yt.load(filename) + +dt = ds.current_time.to_value() / steps + +# Define 2D meshes +x = np.linspace( + ds.domain_left_edge[0], ds.domain_right_edge[0], ds.domain_dimensions[0] +).v +z = np.linspace( + ds.domain_left_edge[ds.dimensionality - 1], + ds.domain_right_edge[ds.dimensionality - 1], + ds.domain_dimensions[ds.dimensionality - 1], +).v +X, Z = np.meshgrid(x, z, sparse=False, indexing="ij") + +# Compute the theory for envelope +env_theory = gauss_env(+t_c - ds.current_time.to_value(), X, Z) + gauss_env( + -t_c + ds.current_time.to_value(), X, Z +) + +# Read laser field in PIC simulation, and compute envelope +all_data_level_0 = ds.covering_grid( + level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions +) +F_laser = all_data_level_0["boxlib", "Ey"].v.squeeze() +env = abs(hilbert(F_laser)) +extent = [ + ds.domain_left_edge[ds.dimensionality - 1], + ds.domain_right_edge[ds.dimensionality - 1], + ds.domain_left_edge[0], + ds.domain_right_edge[0], +] + +# Plot results +plt.figure(figsize=(8, 6)) +plt.subplot(221) +plt.title("PIC field") +plt.imshow(F_laser, extent=extent) +plt.colorbar() +plt.subplot(222) +plt.title("PIC envelope") +plt.imshow(env, extent=extent) +plt.colorbar() +plt.subplot(223) +plt.title("Theory envelope") +plt.imshow(env_theory, extent=extent) +plt.colorbar() +plt.subplot(224) +plt.title("Difference") +plt.imshow(env - env_theory, extent=extent) +plt.colorbar() +plt.tight_layout() +plt.savefig(compname, bbox_inches="tight") + +relative_error_env = np.sum(np.abs(env - env_theory)) / np.sum(np.abs(env)) +print("Relative error envelope: ", relative_error_env) +assert relative_error_env < relative_error_threshold + +fft_F_laser = np.fft.fft2(F_laser) + +freq_rows = np.fft.fftfreq(F_laser.shape[0], dt) +freq_cols = np.fft.fftfreq(F_laser.shape[1], dt) + +pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) + +freq = np.sqrt((freq_rows[pos_max[0]]) ** 2 + (freq_cols[pos_max[1]] ** 2)) +exp_freq = c / wavelength + +relative_error_freq = np.abs(freq - exp_freq) / exp_freq +print("Relative error frequency: ", relative_error_freq) +assert relative_error_freq < relative_error_threshold + +test_name = os.path.split(os.getcwd())[1] +checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/laser_injection_from_file/analysis_3d.py b/Examples/Tests/laser_injection_from_file/analysis_3d.py index 59fe2c6ce8a..7d30af28639 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_3d.py +++ b/Examples/Tests/laser_injection_from_file/analysis_3d.py @@ -9,14 +9,10 @@ # This file is part of the WarpX automated test suite. It is used to test the -# injection of a laser pulse from an external lasy file. -# -# - Generate an input lasy file with a gaussian laser pulse. -# - Run the WarpX simulation for time T, when the pulse is fully injected +# injection of a laser pulse from an external lasy file: # - Compute the theory for laser envelope at time T # - Compare theory and simulation in 3D, for both envelope and central frequency -import glob import os import sys @@ -66,123 +62,88 @@ def gauss_env(T, X, Y, Z): return E_max * np.real(np.exp(exp_arg)) -def do_analysis(fname, compname, steps): - ds = yt.load(fname) - dt = ds.current_time.to_value() / steps - - # Define 3D meshes - x = np.linspace( - ds.domain_left_edge[0], ds.domain_right_edge[0], ds.domain_dimensions[0] - ).v - y = np.linspace( - ds.domain_left_edge[1], ds.domain_right_edge[1], ds.domain_dimensions[1] - ).v - z = np.linspace( - ds.domain_left_edge[ds.dimensionality - 1], - ds.domain_right_edge[ds.dimensionality - 1], - ds.domain_dimensions[ds.dimensionality - 1], - ).v - X, Y, Z = np.meshgrid(x, y, z, sparse=False, indexing="ij") - - # Compute the theory for envelope - env_theory = gauss_env(+t_c - ds.current_time.to_value(), X, Y, Z) + gauss_env( - -t_c + ds.current_time.to_value(), X, Y, Z - ) - - # Read laser field in PIC simulation, and compute envelope - all_data_level_0 = ds.covering_grid( - level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions - ) - F_laser = all_data_level_0["boxlib", "Ey"].v.squeeze() - env = abs(hilbert(F_laser)) - extent = [ - ds.domain_left_edge[ds.dimensionality - 1], - ds.domain_right_edge[ds.dimensionality - 1], - ds.domain_left_edge[0], - ds.domain_right_edge[0], - ] - - F_slice = F_laser[:, F_laser.shape[1] // 2, :] - env_slice = env[:, env.shape[1] // 2, :] - env_theory_slice = env_theory[:, env_theory.shape[1] // 2, :] - - # Plot results - plt.figure(figsize=(8, 6)) - plt.subplot(221) - plt.title("PIC field") - plt.imshow(F_slice, extent=extent) - plt.colorbar() - plt.subplot(222) - plt.title("PIC envelope") - plt.imshow(env_slice, extent=extent) - plt.colorbar() - plt.subplot(223) - plt.title("Theory envelope") - plt.imshow(env_theory_slice, extent=extent) - plt.colorbar() - plt.subplot(224) - plt.title("Difference") - plt.imshow(env_slice - env_theory_slice, extent=extent) - plt.colorbar() - plt.tight_layout() - plt.savefig(compname, bbox_inches="tight") - - relative_error_env = np.sum(np.abs(env - env_theory)) / np.sum(np.abs(env)) - print("Relative error envelope: ", relative_error_env) - assert relative_error_env < relative_error_threshold - - fft_F_laser = np.fft.fftn(F_laser) - - freq_x = np.fft.fftfreq(F_laser.shape[0], dt) - freq_y = np.fft.fftfreq(F_laser.shape[1], dt) - freq_z = np.fft.fftfreq(F_laser.shape[2], dt) - - pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) - - freq = np.sqrt( - (freq_x[pos_max[0]]) ** 2 - + (freq_y[pos_max[1]] ** 2) - + (freq_z[pos_max[2]]) ** 2 - ) - exp_freq = c / wavelength - relative_error_freq = np.abs(freq - exp_freq) / exp_freq - print("Relative error frequency: ", relative_error_freq) - assert relative_error_freq < relative_error_threshold +filename = sys.argv[1] +compname = "comp_unf.pdf" +steps = 251 +ds = yt.load(filename) +dt = ds.current_time.to_value() / steps + +# Define 3D meshes +x = np.linspace( + ds.domain_left_edge[0], ds.domain_right_edge[0], ds.domain_dimensions[0] +).v +y = np.linspace( + ds.domain_left_edge[1], ds.domain_right_edge[1], ds.domain_dimensions[1] +).v +z = np.linspace( + ds.domain_left_edge[ds.dimensionality - 1], + ds.domain_right_edge[ds.dimensionality - 1], + ds.domain_dimensions[ds.dimensionality - 1], +).v +X, Y, Z = np.meshgrid(x, y, z, sparse=False, indexing="ij") + +# Compute the theory for envelope +env_theory = gauss_env(+t_c - ds.current_time.to_value(), X, Y, Z) + gauss_env( + -t_c + ds.current_time.to_value(), X, Y, Z +) +# Read laser field in PIC simulation, and compute envelope +all_data_level_0 = ds.covering_grid( + level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions +) +F_laser = all_data_level_0["boxlib", "Ey"].v.squeeze() +env = abs(hilbert(F_laser)) +extent = [ + ds.domain_left_edge[ds.dimensionality - 1], + ds.domain_right_edge[ds.dimensionality - 1], + ds.domain_left_edge[0], + ds.domain_right_edge[0], +] + +F_slice = F_laser[:, F_laser.shape[1] // 2, :] +env_slice = env[:, env.shape[1] // 2, :] +env_theory_slice = env_theory[:, env_theory.shape[1] // 2, :] + +# Plot results +plt.figure(figsize=(8, 6)) +plt.subplot(221) +plt.title("PIC field") +plt.imshow(F_slice, extent=extent) +plt.colorbar() +plt.subplot(222) +plt.title("PIC envelope") +plt.imshow(env_slice, extent=extent) +plt.colorbar() +plt.subplot(223) +plt.title("Theory envelope") +plt.imshow(env_theory_slice, extent=extent) +plt.colorbar() +plt.subplot(224) +plt.title("Difference") +plt.imshow(env_slice - env_theory_slice, extent=extent) +plt.colorbar() +plt.tight_layout() +plt.savefig(compname, bbox_inches="tight") + +relative_error_env = np.sum(np.abs(env - env_theory)) / np.sum(np.abs(env)) +print("Relative error envelope: ", relative_error_env) +assert relative_error_env < relative_error_threshold + +fft_F_laser = np.fft.fftn(F_laser) + +freq_x = np.fft.fftfreq(F_laser.shape[0], dt) +freq_y = np.fft.fftfreq(F_laser.shape[1], dt) +freq_z = np.fft.fftfreq(F_laser.shape[2], dt) + +pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) + +freq = np.sqrt( + (freq_x[pos_max[0]]) ** 2 + (freq_y[pos_max[1]] ** 2) + (freq_z[pos_max[2]]) ** 2 +) +exp_freq = c / wavelength +relative_error_freq = np.abs(freq - exp_freq) / exp_freq +print("Relative error frequency: ", relative_error_freq) +assert relative_error_freq < relative_error_threshold -def launch_analysis(executable): - os.system( - "./" + executable + " inputs.3d_test diag1.file_prefix=diags/plotfiles/plt" - ) - do_analysis("diags/plotfiles/plt000251/", "comp_unf.pdf", 251) - - -def main(): - from lasy.laser import Laser - from lasy.profiles import GaussianProfile - - # Create a laser using lasy - pol = (1, 0) - profile = GaussianProfile(wavelength, pol, laser_energy, w0, tt, t_peak=0) - dim = "xyt" - lo = (-25e-6, -25e-6, -20e-15) - hi = (+25e-6, +25e-6, +20e-15) - npoints = (100, 100, 100) - laser = Laser(dim, lo, hi, npoints, profile) - laser.normalize(laser_energy, kind="energy") - laser.write_to_file("gaussianlaser3d") - executables = glob.glob("*.ex") - if len(executables) == 1: - launch_analysis(executables[0]) - else: - assert False - - # Do the checksum test - filename_end = "diags/plotfiles/plt000251/" - test_name = os.path.split(os.getcwd())[1] - checksumAPI.evaluate_checksum(test_name, filename_end) - print("Passed") - - -if __name__ == "__main__": - main() +test_name = os.path.split(os.getcwd())[1] +checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/laser_injection_from_file/analysis_RZ.py b/Examples/Tests/laser_injection_from_file/analysis_RZ.py deleted file mode 100755 index 5ebba5b86e2..00000000000 --- a/Examples/Tests/laser_injection_from_file/analysis_RZ.py +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright 2020 Andrew Myers, Axel Huebl, Luca Fedeli -# Remi Lehe, Ilian Kara-Mostefa -# -# This file is part of WarpX. -# -# License: BSD-3-Clause-LBNL - - -# This file is part of the WarpX automated test suite. It is used to test the -# injection of a laser pulse from an external lasy file. -# -# - Generate an input lasy file with a gaussian laser pulse. -# - Run the WarpX simulation for time T, when the pulse is fully injected -# - Compute the theory for laser envelope at time T -# - Compare theory and simulation in RZ, for both envelope and central frequency - -import glob -import os -import sys - -import matplotlib - -matplotlib.use("Agg") -import matplotlib.pyplot as plt -import numpy as np -import yt -from scipy.constants import c, epsilon_0 -from scipy.signal import hilbert - -yt.funcs.mylog.setLevel(50) - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -import checksumAPI - -# Maximum acceptable error for this test -relative_error_threshold = 0.065 - -# Physical parameters -um = 1.0e-6 -fs = 1.0e-15 - -# Parameters of the gaussian beam -wavelength = 1.0 * um -w0 = 12.0 * um -tt = 10.0 * fs -t_c = 20.0 * fs - -laser_energy = 1.0 -E_max = np.sqrt( - 2 * (2 / np.pi) ** (3 / 2) * laser_energy / (epsilon_0 * w0**2 * c * tt) -) - - -# Function for the envelope -def gauss_env(T, X, Y, Z): - # Function to compute the theory for the envelope - inv_tau2 = 1.0 / tt / tt - inv_w_2 = 1.0 / (w0 * w0) - exp_arg = ( - -(X * X) * inv_w_2 - - (Y * Y) * inv_w_2 - - inv_tau2 / c / c * (Z - T * c) * (Z - T * c) - ) - return E_max * np.real(np.exp(exp_arg)) - - -def do_analysis(fname, compname, steps): - ds = yt.load(fname) - dt = ds.current_time.to_value() / steps - - # Define 3D meshes - x = np.linspace( - ds.domain_left_edge[0], ds.domain_right_edge[0], ds.domain_dimensions[0] - ).v - y = np.linspace( - ds.domain_left_edge[1], ds.domain_right_edge[1], ds.domain_dimensions[1] - ).v - z = np.linspace( - ds.domain_left_edge[ds.dimensionality - 1], - ds.domain_right_edge[ds.dimensionality - 1], - ds.domain_dimensions[ds.dimensionality - 1], - ).v - X, Y, Z = np.meshgrid(x, y, z, sparse=False, indexing="ij") - - # Compute the theory for envelope - env_theory = gauss_env(+t_c - ds.current_time.to_value(), X, Y, Z) + gauss_env( - -t_c + ds.current_time.to_value(), X, Y, Z - ) - - # Read laser field in PIC simulation, and compute envelope - all_data_level_0 = ds.covering_grid( - level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions - ) - F_laser = all_data_level_0["boxlib", "Et"].v.squeeze() - env = abs(hilbert(F_laser)) - extent = [ - ds.domain_left_edge[ds.dimensionality - 1], - ds.domain_right_edge[ds.dimensionality - 1], - ds.domain_left_edge[0], - ds.domain_right_edge[0], - ] - - env_theory_slice = env_theory[:, env_theory.shape[1] // 2, :] - - # Plot results - plt.figure(figsize=(8, 6)) - plt.subplot(221) - plt.title("PIC field") - plt.imshow(F_laser, extent=extent) - plt.colorbar() - plt.subplot(222) - plt.title("PIC envelope") - plt.imshow(env, extent=extent) - plt.colorbar() - plt.subplot(223) - plt.title("Theory envelope") - plt.imshow(env_theory_slice, extent=extent) - plt.colorbar() - plt.subplot(224) - plt.title("Difference") - plt.imshow(env - env_theory_slice, extent=extent) - plt.colorbar() - plt.tight_layout() - plt.savefig(compname, bbox_inches="tight") - - relative_error_env = np.sum(np.abs(env - env_theory_slice)) / np.sum(np.abs(env)) - print("Relative error envelope: ", relative_error_env) - assert relative_error_env < relative_error_threshold - - fft_F_laser = np.fft.fftn(F_laser) - - freq_x = np.fft.fftfreq(F_laser.shape[0], dt) - freq_z = np.fft.fftfreq(F_laser.shape[1], dt) - - pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) - - freq = np.sqrt((freq_x[pos_max[0]]) ** 2 + (freq_z[pos_max[1]]) ** 2) - exp_freq = c / wavelength - relative_error_freq = np.abs(freq - exp_freq) / exp_freq - print("Relative error frequency: ", relative_error_freq) - assert relative_error_freq < relative_error_threshold - - -def launch_analysis(executable): - os.system( - "./" + executable + " inputs.RZ_test diag1.file_prefix=diags/plotfiles/plt" - ) - do_analysis("diags/plotfiles/plt000252/", "comp_unf.pdf", 252) - - -def main(): - from lasy.laser import Laser - from lasy.profiles import GaussianProfile - - # Create a laser using lasy - pol = (1, 0) - profile = GaussianProfile(wavelength, pol, laser_energy, w0, tt, t_peak=0) - dim = "xyt" - lo = (-25e-6, -25e-6, -20e-15) - hi = (+25e-6, +25e-6, +20e-15) - npoints = (100, 100, 100) - laser = Laser(dim, lo, hi, npoints, profile) - laser.normalize(laser_energy, kind="energy") - laser.write_to_file("gaussianlaser3d") - executables = glob.glob("*.ex") - if len(executables) == 1: - launch_analysis(executables[0]) - else: - assert False - - # Do the checksum test - filename_end = "diags/plotfiles/plt000252/" - test_name = os.path.split(os.getcwd())[1] - checksumAPI.evaluate_checksum(test_name, filename_end) - print("Passed") - - -if __name__ == "__main__": - main() diff --git a/Examples/Tests/laser_injection_from_file/analysis_from_RZ_file.py b/Examples/Tests/laser_injection_from_file/analysis_from_RZ_file.py index 8bc0daea481..72575da96b4 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_from_RZ_file.py +++ b/Examples/Tests/laser_injection_from_file/analysis_from_RZ_file.py @@ -9,14 +9,10 @@ # This file is part of the WarpX automated test suite. It is used to test the -# injection of a laser pulse from an external lasy file. -# -# - Generate an input lasy file with a Laguerre Gaussian laser pulse. -# - Run the WarpX simulation for time T, when the pulse is fully injected +# injection of a laser pulse from an external lasy file: # - Compute the theory for laser envelope at time T # - Compare theory and simulation in RZ, for both envelope and central frequency -import glob import os import sys @@ -73,126 +69,83 @@ def laguerre_env(T, X, Y, Z, p, m): return E_max * np.real(envelope) -def do_analysis(fname, compname, steps): - ds = yt.load(fname) - dt = ds.current_time.to_value() / steps - - # Define 3D meshes - x = np.linspace( - ds.domain_left_edge[0], ds.domain_right_edge[0], ds.domain_dimensions[0] - ).v - y = np.linspace( - ds.domain_left_edge[1], ds.domain_right_edge[1], ds.domain_dimensions[1] - ).v - z = np.linspace( - ds.domain_left_edge[ds.dimensionality - 1], - ds.domain_right_edge[ds.dimensionality - 1], - ds.domain_dimensions[ds.dimensionality - 1], - ).v - X, Y, Z = np.meshgrid(x, y, z, sparse=False, indexing="ij") - - # Compute the theory for envelope - env_theory = laguerre_env( - +t_c - ds.current_time.to_value(), X, Y, Z, p=0, m=1 - ) + laguerre_env(-t_c + ds.current_time.to_value(), X, Y, Z, p=0, m=1) - - # Read laser field in PIC simulation, and compute envelope - all_data_level_0 = ds.covering_grid( - level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions - ) - F_laser = all_data_level_0["boxlib", "Et"].v.squeeze() - env = abs(hilbert(F_laser)) - extent = [ - ds.domain_left_edge[ds.dimensionality - 1], - ds.domain_right_edge[ds.dimensionality - 1], - ds.domain_left_edge[0], - ds.domain_right_edge[0], - ] - - env_theory_slice = env_theory[:, env_theory.shape[1] // 2, :] - - # Plot results - plt.figure(figsize=(8, 6)) - plt.subplot(221) - plt.title("PIC field") - plt.imshow(F_laser, extent=extent) - plt.colorbar() - plt.subplot(222) - plt.title("PIC envelope") - plt.imshow(env, extent=extent) - plt.colorbar() - plt.subplot(223) - plt.title("Theory envelope") - plt.imshow(env_theory_slice, extent=extent) - plt.colorbar() - plt.subplot(224) - plt.title("Difference") - plt.imshow(env - env_theory_slice, extent=extent) - plt.colorbar() - plt.tight_layout() - plt.savefig(compname, bbox_inches="tight") - - relative_error_env = np.sum(np.abs(env - env_theory_slice)) / np.sum(np.abs(env)) - print("Relative error envelope: ", relative_error_env) - assert relative_error_env < relative_error_threshold - - fft_F_laser = np.fft.fftn(F_laser) - - freq_x = np.fft.fftfreq(F_laser.shape[0], dt) - freq_z = np.fft.fftfreq(F_laser.shape[1], dt) - - pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) - - freq = np.sqrt((freq_x[pos_max[0]]) ** 2 + (freq_z[pos_max[1]]) ** 2) - exp_freq = c / wavelength - relative_error_freq = np.abs(freq - exp_freq) / exp_freq - print("Relative error frequency: ", relative_error_freq) - assert relative_error_freq < relative_error_threshold - - -def launch_analysis(executable): - os.system( - "./" - + executable - + " inputs.from_RZ_file_test diag1.file_prefix=diags/plotfiles/plt" - ) - do_analysis("diags/plotfiles/plt000612/", "comp_unf.pdf", 612) - - -def main(): - from lasy.laser import Laser - from lasy.profiles import CombinedLongitudinalTransverseProfile - from lasy.profiles.longitudinal import GaussianLongitudinalProfile - from lasy.profiles.transverse import LaguerreGaussianTransverseProfile - - # Create a Laguerre Gaussian laser in RZ geometry using lasy - pol = (1, 0) - profile = CombinedLongitudinalTransverseProfile( - wavelength, - pol, - laser_energy, - GaussianLongitudinalProfile(wavelength, tt, t_peak=0), - LaguerreGaussianTransverseProfile(w0, p=0, m=1), - ) - dim = "rt" - lo = (0e-6, -20e-15) - hi = (+25e-6, +20e-15) - npoints = (100, 100) - laser = Laser(dim, lo, hi, npoints, profile, n_azimuthal_modes=2) - laser.normalize(laser_energy, kind="energy") - laser.write_to_file("laguerrelaserRZ") - executables = glob.glob("*.ex") - if len(executables) == 1: - launch_analysis(executables[0]) - else: - assert False - - # Do the checksum test - filename_end = "diags/plotfiles/plt000612/" - test_name = "LaserInjectionFromRZLASYFile" - checksumAPI.evaluate_checksum(test_name, filename_end) - print("Passed") - - -if __name__ == "__main__": - main() +filename = sys.argv[1] +compname = "comp_unf.pdf" +steps = 612 +ds = yt.load(filename) +dt = ds.current_time.to_value() / steps + +# Define 3D meshes +x = np.linspace( + ds.domain_left_edge[0], ds.domain_right_edge[0], ds.domain_dimensions[0] +).v +y = np.linspace( + ds.domain_left_edge[1], ds.domain_right_edge[1], ds.domain_dimensions[1] +).v +z = np.linspace( + ds.domain_left_edge[ds.dimensionality - 1], + ds.domain_right_edge[ds.dimensionality - 1], + ds.domain_dimensions[ds.dimensionality - 1], +).v +X, Y, Z = np.meshgrid(x, y, z, sparse=False, indexing="ij") + +# Compute the theory for envelope +env_theory = laguerre_env( + +t_c - ds.current_time.to_value(), X, Y, Z, p=0, m=1 +) + laguerre_env(-t_c + ds.current_time.to_value(), X, Y, Z, p=0, m=1) + +# Read laser field in PIC simulation, and compute envelope +all_data_level_0 = ds.covering_grid( + level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions +) +F_laser = all_data_level_0["boxlib", "Et"].v.squeeze() +env = abs(hilbert(F_laser)) +extent = [ + ds.domain_left_edge[ds.dimensionality - 1], + ds.domain_right_edge[ds.dimensionality - 1], + ds.domain_left_edge[0], + ds.domain_right_edge[0], +] + +env_theory_slice = env_theory[:, env_theory.shape[1] // 2, :] + +# Plot results +plt.figure(figsize=(8, 6)) +plt.subplot(221) +plt.title("PIC field") +plt.imshow(F_laser, extent=extent) +plt.colorbar() +plt.subplot(222) +plt.title("PIC envelope") +plt.imshow(env, extent=extent) +plt.colorbar() +plt.subplot(223) +plt.title("Theory envelope") +plt.imshow(env_theory_slice, extent=extent) +plt.colorbar() +plt.subplot(224) +plt.title("Difference") +plt.imshow(env - env_theory_slice, extent=extent) +plt.colorbar() +plt.tight_layout() +plt.savefig(compname, bbox_inches="tight") + +relative_error_env = np.sum(np.abs(env - env_theory_slice)) / np.sum(np.abs(env)) +print("Relative error envelope: ", relative_error_env) +assert relative_error_env < relative_error_threshold + +fft_F_laser = np.fft.fftn(F_laser) + +freq_x = np.fft.fftfreq(F_laser.shape[0], dt) +freq_z = np.fft.fftfreq(F_laser.shape[1], dt) + +pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) + +freq = np.sqrt((freq_x[pos_max[0]]) ** 2 + (freq_z[pos_max[1]]) ** 2) +exp_freq = c / wavelength +relative_error_freq = np.abs(freq - exp_freq) / exp_freq +print("Relative error frequency: ", relative_error_freq) +assert relative_error_freq < relative_error_threshold + +test_name = os.path.split(os.getcwd())[1] +checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/laser_injection_from_file/analysis_rz.py b/Examples/Tests/laser_injection_from_file/analysis_rz.py new file mode 100755 index 00000000000..90e392bcf25 --- /dev/null +++ b/Examples/Tests/laser_injection_from_file/analysis_rz.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python3 + +# Copyright 2020 Andrew Myers, Axel Huebl, Luca Fedeli +# Remi Lehe, Ilian Kara-Mostefa +# +# This file is part of WarpX. +# +# License: BSD-3-Clause-LBNL + + +# This file is part of the WarpX automated test suite. It is used to test the +# injection of a laser pulse from an external lasy file: +# - Compute the theory for laser envelope at time T +# - Compare theory and simulation in RZ, for both envelope and central frequency + +import os +import sys + +import matplotlib + +matplotlib.use("Agg") +import matplotlib.pyplot as plt +import numpy as np +import yt +from scipy.constants import c, epsilon_0 +from scipy.signal import hilbert + +yt.funcs.mylog.setLevel(50) + +sys.path.insert(1, "../../../../warpx/Regression/Checksum/") +import checksumAPI + +# Maximum acceptable error for this test +relative_error_threshold = 0.065 + +# Physical parameters +um = 1.0e-6 +fs = 1.0e-15 + +# Parameters of the gaussian beam +wavelength = 1.0 * um +w0 = 12.0 * um +tt = 10.0 * fs +t_c = 20.0 * fs + +laser_energy = 1.0 +E_max = np.sqrt( + 2 * (2 / np.pi) ** (3 / 2) * laser_energy / (epsilon_0 * w0**2 * c * tt) +) + + +# Function for the envelope +def gauss_env(T, X, Y, Z): + # Function to compute the theory for the envelope + inv_tau2 = 1.0 / tt / tt + inv_w_2 = 1.0 / (w0 * w0) + exp_arg = ( + -(X * X) * inv_w_2 + - (Y * Y) * inv_w_2 + - inv_tau2 / c / c * (Z - T * c) * (Z - T * c) + ) + return E_max * np.real(np.exp(exp_arg)) + + +filename = sys.argv[1] +compname = "comp_unf.pdf" +steps = 252 +ds = yt.load(filename) +dt = ds.current_time.to_value() / steps + +# Define 3D meshes +x = np.linspace( + ds.domain_left_edge[0], ds.domain_right_edge[0], ds.domain_dimensions[0] +).v +y = np.linspace( + ds.domain_left_edge[1], ds.domain_right_edge[1], ds.domain_dimensions[1] +).v +z = np.linspace( + ds.domain_left_edge[ds.dimensionality - 1], + ds.domain_right_edge[ds.dimensionality - 1], + ds.domain_dimensions[ds.dimensionality - 1], +).v +X, Y, Z = np.meshgrid(x, y, z, sparse=False, indexing="ij") + +# Compute the theory for envelope +env_theory = gauss_env(+t_c - ds.current_time.to_value(), X, Y, Z) + gauss_env( + -t_c + ds.current_time.to_value(), X, Y, Z +) + +# Read laser field in PIC simulation, and compute envelope +all_data_level_0 = ds.covering_grid( + level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions +) +F_laser = all_data_level_0["boxlib", "Et"].v.squeeze() +env = abs(hilbert(F_laser)) +extent = [ + ds.domain_left_edge[ds.dimensionality - 1], + ds.domain_right_edge[ds.dimensionality - 1], + ds.domain_left_edge[0], + ds.domain_right_edge[0], +] + +env_theory_slice = env_theory[:, env_theory.shape[1] // 2, :] + +# Plot results +plt.figure(figsize=(8, 6)) +plt.subplot(221) +plt.title("PIC field") +plt.imshow(F_laser, extent=extent) +plt.colorbar() +plt.subplot(222) +plt.title("PIC envelope") +plt.imshow(env, extent=extent) +plt.colorbar() +plt.subplot(223) +plt.title("Theory envelope") +plt.imshow(env_theory_slice, extent=extent) +plt.colorbar() +plt.subplot(224) +plt.title("Difference") +plt.imshow(env - env_theory_slice, extent=extent) +plt.colorbar() +plt.tight_layout() +plt.savefig(compname, bbox_inches="tight") + +relative_error_env = np.sum(np.abs(env - env_theory_slice)) / np.sum(np.abs(env)) +print("Relative error envelope: ", relative_error_env) +assert relative_error_env < relative_error_threshold + +fft_F_laser = np.fft.fftn(F_laser) + +freq_x = np.fft.fftfreq(F_laser.shape[0], dt) +freq_z = np.fft.fftfreq(F_laser.shape[1], dt) + +pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape) + +freq = np.sqrt((freq_x[pos_max[0]]) ** 2 + (freq_z[pos_max[1]]) ** 2) +exp_freq = c / wavelength +relative_error_freq = np.abs(freq - exp_freq) / exp_freq +print("Relative error frequency: ", relative_error_freq) +assert relative_error_freq < relative_error_threshold + +test_name = os.path.split(os.getcwd())[1] +checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/laser_injection_from_file/inputs.1d_test b/Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file similarity index 93% rename from Examples/Tests/laser_injection_from_file/inputs.1d_test rename to Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file index 6c392883418..1510a8df4c3 100644 --- a/Examples/Tests/laser_injection_from_file/inputs.1d_test +++ b/Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file @@ -40,7 +40,7 @@ lasy_laser.e_max = 1.e14 # Maximum amplitude of the laser field (i lasy_laser.wavelength = 1.0e-6 # The wavelength of the laser (in meters) lasy_laser.profile = from_file lasy_laser.time_chunk_size = 50 -lasy_laser.lasy_file_name = "diags/gaussianlaser3d_00000.h5" +lasy_laser.lasy_file_name = "../test_1d_laser_injection_from_lasy_file_prepare/diags/gaussian_laser_3d_00000.h5" lasy_laser.delay = 0.0 # Diagnostics diff --git a/Examples/Tests/laser_injection_from_file/inputs.1d_boost_test b/Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file_boost similarity index 93% rename from Examples/Tests/laser_injection_from_file/inputs.1d_boost_test rename to Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file_boost index ffc1865ee0f..d118ce85ae5 100644 --- a/Examples/Tests/laser_injection_from_file/inputs.1d_boost_test +++ b/Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file_boost @@ -47,7 +47,7 @@ lasy_laser.e_max = 1.e14 # Maximum amplitude of the laser field (i lasy_laser.wavelength = 1.0e-6 # The wavelength of the laser (in meters) lasy_laser.profile = from_file lasy_laser.time_chunk_size = 50 -lasy_laser.lasy_file_name = "diags/gaussianlaser3d_00000.h5" +lasy_laser.lasy_file_name = "../test_1d_laser_injection_from_lasy_file_boost_prepare/diags/gaussian_laser_3d_00000.h5" lasy_laser.delay = 0.0 # Diagnostics diff --git a/Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file_boost_prepare.py b/Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file_boost_prepare.py new file mode 100755 index 00000000000..f71b87d5fc8 --- /dev/null +++ b/Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file_boost_prepare.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# Copyright 2020 Andrew Myers, Axel Huebl, Luca Fedeli +# Remi Lehe, Ilian Kara-Mostefa +# +# This file is part of WarpX. +# +# License: BSD-3-Clause-LBNL + + +# This file is part of the WarpX automated test suite. It is used to test the +# injection of a laser pulse from an external lasy file: +# - Generate an input lasy file with a gaussian laser pulse. + +from lasy.laser import Laser +from lasy.profiles import GaussianProfile + +# Physical parameters +um = 1.0e-6 +fs = 1.0e-15 + +# Parameters of the Gaussian beam +wavelength = 1.0 * um +pol = (1, 0) +laser_energy = 1.0 +w0 = 12.0 * um +tt = 10.0 * fs +t_c = 20.0 * fs + +# Create a laser using lasy +profile = GaussianProfile(wavelength, pol, laser_energy, w0, tt, t_peak=0) +dim = "xyt" +lo = (-25e-6, -25e-6, -20e-15) +hi = (+25e-6, +25e-6, +20e-15) +npoints = (100, 100, 100) +laser = Laser(dim, lo, hi, npoints, profile) +laser.normalize(laser_energy, kind="energy") +laser.write_to_file("gaussian_laser_3d") diff --git a/Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file_prepare.py b/Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file_prepare.py new file mode 100755 index 00000000000..902b0c47210 --- /dev/null +++ b/Examples/Tests/laser_injection_from_file/inputs_test_1d_laser_injection_from_lasy_file_prepare.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Copyright 2020 Andrew Myers, Axel Huebl, Luca Fedeli +# Remi Lehe, Ilian Kara-Mostefa +# +# This file is part of WarpX. +# +# License: BSD-3-Clause-LBNL + + +# This file is part of the WarpX automated test suite. It is used to test the +# injection of a laser pulse from an external lasy file: +# - Generate an input lasy file with a gaussian laser pulse. + +from lasy.laser import Laser +from lasy.profiles import GaussianProfile + +# Physical parameters +um = 1.0e-6 +fs = 1.0e-15 + +# Parameters of the Gaussian beam +wavelength = 1.0 * um +pol = (1, 0) +laser_energy = 1.0 +w0 = 12.0 * um +tt = 10.0 * fs + +# Create a laser using lasy +profile = GaussianProfile(wavelength, pol, laser_energy, w0, tt, t_peak=0) +dim = "xyt" +lo = (-25e-6, -25e-6, -20e-15) +hi = (+25e-6, +25e-6, +20e-15) +npoints = (100, 100, 100) +laser = Laser(dim, lo, hi, npoints, profile) +laser.normalize(laser_energy, kind="energy") +laser.write_to_file("gaussian_laser_3d") diff --git a/Examples/Tests/laser_injection_from_file/inputs.2d_test_binary b/Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_binary_file similarity index 94% rename from Examples/Tests/laser_injection_from_file/inputs.2d_test_binary rename to Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_binary_file index fdb19f406ca..022da5b0e29 100644 --- a/Examples/Tests/laser_injection_from_file/inputs.2d_test_binary +++ b/Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_binary_file @@ -40,7 +40,7 @@ binary_laser.polarization = 0. 1. 0. # The main polarization vector binary_laser.e_max = 1.e12 # Maximum amplitude of the laser field (in V/m) binary_laser.wavelength = 1.0e-6 # The wavelength of the laser (in meters) binary_laser.profile = from_file -binary_laser.binary_file_name = "gauss_2d" +binary_laser.binary_file_name = "../test_2d_laser_injection_from_binary_file_prepare/gauss_2d" binary_laser.time_chunk_size = 50 binary_laser.delay = 0.0 diff --git a/Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_binary_file_prepare.py b/Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_binary_file_prepare.py new file mode 100755 index 00000000000..d8fe2236ae0 --- /dev/null +++ b/Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_binary_file_prepare.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python3 + +# Copyright 2020 Andrew Myers, Axel Huebl, Luca Fedeli +# Remi Lehe, Ilian Kara-Mostefa +# +# This file is part of WarpX. +# +# License: BSD-3-Clause-LBNL + + +# This file is part of the WarpX automated test suite. It is used to test the +# injection of a laser pulse from an external binary file: +# - Generate an input binary file with a gaussian laser pulse. + +import sys + +import matplotlib + +matplotlib.use("Agg") +import numpy as np +import yt + +yt.funcs.mylog.setLevel(50) + +sys.path.insert(1, "../../../../warpx/Regression/Checksum/") + +# Maximum acceptable error for this test +relative_error_threshold = 0.065 + +# Physical parameters +um = 1.0e-6 +fs = 1.0e-15 +c = 299792458 + +# Parameters of the gaussian beam +wavelength = 1.0 * um +w0 = 6.0 * um +tt = 10.0 * fs +x_c = 0.0 * um +t_c = 20.0 * fs +foc_dist = 10 * um +E_max = 1e12 +rot_angle = -np.pi / 4.0 + +# Parameters of the tx grid +x_l = -12.0 * um +x_r = 12.0 * um +x_points = 480 +t_l = 0.0 * fs +t_r = 40.0 * fs +t_points = 400 +tcoords = np.linspace(t_l, t_r, t_points) +xcoords = np.linspace(x_l, x_r, x_points) + + +def gauss(T, X, Y, opt): + """Compute the electric field for a Gaussian laser pulse. + This is used to write the binary input file. + """ + + k0 = 2.0 * np.pi / wavelength + inv_tau2 = 1.0 / tt / tt + osc_phase = k0 * c * (T - t_c) + + diff_factor = 1.0 + 1.0j * foc_dist * 2 / (k0 * w0 * w0) + inv_w_2 = 1.0 / (w0 * w0 * diff_factor) + + pre_fact = np.exp(1.0j * osc_phase) + + if opt == "3d": + pre_fact = pre_fact / diff_factor + else: + pre_fact = pre_fact / np.sqrt(diff_factor) + + exp_arg = -(X * X + Y * Y) * inv_w_2 - inv_tau2 * (T - t_c) * (T - t_c) + + return np.real(pre_fact * np.exp(exp_arg)) + + +def write_file(fname, x, y, t, E): + """For a given filename fname, space coordinates x and y, time coordinate t + and field E, write a WarpX-compatible input binary file containing the + profile of the laser pulse. This function should be used in the case + of a uniform spatio-temporal mesh + """ + + with open(fname, "wb") as file: + flag_unif = 1 + file.write(flag_unif.to_bytes(1, byteorder="little")) + file.write((len(t)).to_bytes(4, byteorder="little", signed=False)) + file.write((len(x)).to_bytes(4, byteorder="little", signed=False)) + file.write((len(y)).to_bytes(4, byteorder="little", signed=False)) + file.write(t[0].tobytes()) + file.write(t[-1].tobytes()) + file.write(x[0].tobytes()) + file.write(x[-1].tobytes()) + if len(y) == 1: + file.write(y[0].tobytes()) + else: + file.write(y[0].tobytes()) + file.write(y[-1].tobytes()) + file.write(E.tobytes()) + + +T, X, Y = np.meshgrid(tcoords, xcoords, np.array([0.0]), indexing="ij") +E_t = gauss(T, X, Y, "2d") +write_file("gauss_2d", xcoords, np.array([0.0]), tcoords, E_t) diff --git a/Examples/Tests/laser_injection_from_file/inputs.2d_test b/Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_lasy_file similarity index 93% rename from Examples/Tests/laser_injection_from_file/inputs.2d_test rename to Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_lasy_file index e5814471753..f6a0693a5bd 100644 --- a/Examples/Tests/laser_injection_from_file/inputs.2d_test +++ b/Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_lasy_file @@ -40,7 +40,7 @@ lasy_laser.e_max = 1.e14 # Maximum amplitude of the laser field (i lasy_laser.wavelength = 1.0e-6 # The wavelength of the laser (in meters) lasy_laser.profile = from_file lasy_laser.time_chunk_size = 50 -lasy_laser.lasy_file_name = "diags/gaussianlaser3d_00000.h5" +lasy_laser.lasy_file_name = "../test_2d_laser_injection_from_lasy_file_prepare/diags/gaussian_laser_3d_00000.h5" lasy_laser.delay = 0.0 # Diagnostics diff --git a/Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_lasy_file_prepare.py b/Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_lasy_file_prepare.py new file mode 100755 index 00000000000..f71b87d5fc8 --- /dev/null +++ b/Examples/Tests/laser_injection_from_file/inputs_test_2d_laser_injection_from_lasy_file_prepare.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# Copyright 2020 Andrew Myers, Axel Huebl, Luca Fedeli +# Remi Lehe, Ilian Kara-Mostefa +# +# This file is part of WarpX. +# +# License: BSD-3-Clause-LBNL + + +# This file is part of the WarpX automated test suite. It is used to test the +# injection of a laser pulse from an external lasy file: +# - Generate an input lasy file with a gaussian laser pulse. + +from lasy.laser import Laser +from lasy.profiles import GaussianProfile + +# Physical parameters +um = 1.0e-6 +fs = 1.0e-15 + +# Parameters of the Gaussian beam +wavelength = 1.0 * um +pol = (1, 0) +laser_energy = 1.0 +w0 = 12.0 * um +tt = 10.0 * fs +t_c = 20.0 * fs + +# Create a laser using lasy +profile = GaussianProfile(wavelength, pol, laser_energy, w0, tt, t_peak=0) +dim = "xyt" +lo = (-25e-6, -25e-6, -20e-15) +hi = (+25e-6, +25e-6, +20e-15) +npoints = (100, 100, 100) +laser = Laser(dim, lo, hi, npoints, profile) +laser.normalize(laser_energy, kind="energy") +laser.write_to_file("gaussian_laser_3d") diff --git a/Examples/Tests/laser_injection_from_file/inputs.3d_test b/Examples/Tests/laser_injection_from_file/inputs_test_3d_laser_injection_from_lasy_file similarity index 93% rename from Examples/Tests/laser_injection_from_file/inputs.3d_test rename to Examples/Tests/laser_injection_from_file/inputs_test_3d_laser_injection_from_lasy_file index ad8159cb650..534ea729886 100644 --- a/Examples/Tests/laser_injection_from_file/inputs.3d_test +++ b/Examples/Tests/laser_injection_from_file/inputs_test_3d_laser_injection_from_lasy_file @@ -40,7 +40,7 @@ lasy_laser.e_max = 1.e14 # Maximum amplitude of the laser field (i lasy_laser.wavelength = 1.0e-6 # The wavelength of the laser (in meters) lasy_laser.profile = from_file lasy_laser.time_chunk_size = 50 -lasy_laser.lasy_file_name = "diags/gaussianlaser3d_00000.h5" +lasy_laser.lasy_file_name = "../test_3d_laser_injection_from_lasy_file_prepare/diags/gaussian_laser_3d_00000.h5" lasy_laser.delay = 0.0 # Diagnostics diff --git a/Examples/Tests/laser_injection_from_file/inputs_test_3d_laser_injection_from_lasy_file_prepare.py b/Examples/Tests/laser_injection_from_file/inputs_test_3d_laser_injection_from_lasy_file_prepare.py new file mode 100755 index 00000000000..410dcd2c36e --- /dev/null +++ b/Examples/Tests/laser_injection_from_file/inputs_test_3d_laser_injection_from_lasy_file_prepare.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +# Copyright 2020 Andrew Myers, Axel Huebl, Luca Fedeli +# Remi Lehe, Ilian Kara-Mostefa +# +# This file is part of WarpX. +# +# License: BSD-3-Clause-LBNL + + +# This file is part of the WarpX automated test suite. It is used to test the +# injection of a laser pulse from an external lasy file: +# - Generate an input lasy file with a gaussian laser pulse. + +from lasy.laser import Laser +from lasy.profiles import GaussianProfile + +# Maximum acceptable error for this test +relative_error_threshold = 0.065 + +# Physical parameters +um = 1.0e-6 +fs = 1.0e-15 + +# Parameters of the Gaussian beam +wavelength = 1.0 * um +pol = (1, 0) +laser_energy = 1.0 +w0 = 12.0 * um +tt = 10.0 * fs +t_c = 20.0 * fs + +# Create a laser using lasy +profile = GaussianProfile(wavelength, pol, laser_energy, w0, tt, t_peak=0) +dim = "xyt" +lo = (-25e-6, -25e-6, -20e-15) +hi = (+25e-6, +25e-6, +20e-15) +npoints = (100, 100, 100) +laser = Laser(dim, lo, hi, npoints, profile) +laser.normalize(laser_energy, kind="energy") +laser.write_to_file("gaussian_laser_3d") diff --git a/Examples/Tests/laser_injection_from_file/inputs.from_RZ_file_test b/Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_RZ_lasy_file similarity index 93% rename from Examples/Tests/laser_injection_from_file/inputs.from_RZ_file_test rename to Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_RZ_lasy_file index f92440188b7..a4c87d244fc 100644 --- a/Examples/Tests/laser_injection_from_file/inputs.from_RZ_file_test +++ b/Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_RZ_lasy_file @@ -40,7 +40,7 @@ lasy_RZ_laser.e_max = 1.e14 # Maximum amplitude of the laser field lasy_RZ_laser.wavelength = 1.0e-6 # The wavelength of the laser (in meters) lasy_RZ_laser.profile = from_file lasy_RZ_laser.time_chunk_size = 50 -lasy_RZ_laser.lasy_file_name = "diags/laguerrelaserRZ_00000.h5" +lasy_RZ_laser.lasy_file_name = "../test_rz_laser_injection_from_RZ_lasy_file_prepare/diags/laguerre_laser_RZ_00000.h5" lasy_RZ_laser.delay = 0.0 # Diagnostics diff --git a/Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_RZ_lasy_file_prepare.py b/Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_RZ_lasy_file_prepare.py new file mode 100755 index 00000000000..1a1dfabe86e --- /dev/null +++ b/Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_RZ_lasy_file_prepare.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +# Copyright 2020 Andrew Myers, Axel Huebl, Luca Fedeli +# Remi Lehe, Ilian Kara-Mostefa +# +# This file is part of WarpX. +# +# License: BSD-3-Clause-LBNL + + +# This file is part of the WarpX automated test suite. It is used to test the +# injection of a laser pulse from an external lasy file: +# - Generate an input lasy file with a Laguerre Gaussian laser pulse. + +from lasy.laser import Laser +from lasy.profiles import CombinedLongitudinalTransverseProfile +from lasy.profiles.longitudinal import GaussianLongitudinalProfile +from lasy.profiles.transverse import LaguerreGaussianTransverseProfile + +# Maximum acceptable error for this test +relative_error_threshold = 0.065 + +# Physical parameters +um = 1.0e-6 +fs = 1.0e-15 + +# Parameters of the Laguerre Gaussian beam +wavelength = 1.0 * um +pol = (1, 0) +laser_energy = 1.0 +w0 = 12.0 * um +tt = 10.0 * fs +t_c = 20.0 * fs + +# Create a Laguerre Gaussian laser in RZ geometry using lasy +profile = CombinedLongitudinalTransverseProfile( + wavelength, + pol, + laser_energy, + GaussianLongitudinalProfile(wavelength, tt, t_peak=0), + LaguerreGaussianTransverseProfile(w0, p=0, m=1), +) +dim = "rt" +lo = (0e-6, -20e-15) +hi = (+25e-6, +20e-15) +npoints = (100, 100) +laser = Laser(dim, lo, hi, npoints, profile, n_azimuthal_modes=2) +laser.normalize(laser_energy, kind="energy") +laser.write_to_file("laguerre_laser_RZ") diff --git a/Examples/Tests/laser_injection_from_file/inputs.RZ_test b/Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_lasy_file similarity index 93% rename from Examples/Tests/laser_injection_from_file/inputs.RZ_test rename to Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_lasy_file index 2a539883fec..cc7100afb9d 100644 --- a/Examples/Tests/laser_injection_from_file/inputs.RZ_test +++ b/Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_lasy_file @@ -41,7 +41,7 @@ lasy_laser.e_max = 1.e14 # Maximum amplitude of the laser field (i lasy_laser.wavelength = 1.0e-6 # The wavelength of the laser (in meters) lasy_laser.profile = from_file lasy_laser.time_chunk_size = 50 -lasy_laser.lasy_file_name = "diags/gaussianlaser3d_00000.h5" +lasy_laser.lasy_file_name = "../test_rz_laser_injection_from_lasy_file_prepare/diags/gaussian_laser_3d_00000.h5" lasy_laser.delay = 0.0 # Diagnostics diff --git a/Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_lasy_file_prepare.py b/Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_lasy_file_prepare.py new file mode 100755 index 00000000000..410dcd2c36e --- /dev/null +++ b/Examples/Tests/laser_injection_from_file/inputs_test_rz_laser_injection_from_lasy_file_prepare.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +# Copyright 2020 Andrew Myers, Axel Huebl, Luca Fedeli +# Remi Lehe, Ilian Kara-Mostefa +# +# This file is part of WarpX. +# +# License: BSD-3-Clause-LBNL + + +# This file is part of the WarpX automated test suite. It is used to test the +# injection of a laser pulse from an external lasy file: +# - Generate an input lasy file with a gaussian laser pulse. + +from lasy.laser import Laser +from lasy.profiles import GaussianProfile + +# Maximum acceptable error for this test +relative_error_threshold = 0.065 + +# Physical parameters +um = 1.0e-6 +fs = 1.0e-15 + +# Parameters of the Gaussian beam +wavelength = 1.0 * um +pol = (1, 0) +laser_energy = 1.0 +w0 = 12.0 * um +tt = 10.0 * fs +t_c = 20.0 * fs + +# Create a laser using lasy +profile = GaussianProfile(wavelength, pol, laser_energy, w0, tt, t_peak=0) +dim = "xyt" +lo = (-25e-6, -25e-6, -20e-15) +hi = (+25e-6, +25e-6, +20e-15) +npoints = (100, 100, 100) +laser = Laser(dim, lo, hi, npoints, profile) +laser.normalize(laser_energy, kind="energy") +laser.write_to_file("gaussian_laser_3d") diff --git a/Examples/Tests/laser_on_fine/CMakeLists.txt b/Examples/Tests/laser_on_fine/CMakeLists.txt new file mode 100644 index 00000000000..794d5e68c66 --- /dev/null +++ b/Examples/Tests/laser_on_fine/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_laser_on_fine # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_laser_on_fine # inputs + analysis_default_regression.py # analysis + diags/diag1000050 # output + OFF # dependency +) diff --git a/Examples/Tests/laser_on_fine/analysis_default_regression.py b/Examples/Tests/laser_on_fine/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/laser_on_fine/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/laser_on_fine/inputs_2d b/Examples/Tests/laser_on_fine/inputs_test_2d_laser_on_fine similarity index 99% rename from Examples/Tests/laser_on_fine/inputs_2d rename to Examples/Tests/laser_on_fine/inputs_test_2d_laser_on_fine index 1ffbfcb7e09..61c10e81f3e 100644 --- a/Examples/Tests/laser_on_fine/inputs_2d +++ b/Examples/Tests/laser_on_fine/inputs_test_2d_laser_on_fine @@ -1,5 +1,5 @@ # Maximum number of time steps -max_step = 500 +max_step = 50 # number of grid points amr.n_cell = 64 64 diff --git a/Examples/Tests/load_external_field/CMakeLists.txt b/Examples/Tests/load_external_field/CMakeLists.txt new file mode 100644 index 00000000000..93b0a1436be --- /dev/null +++ b/Examples/Tests/load_external_field/CMakeLists.txt @@ -0,0 +1,68 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_load_external_field_grid_picmi # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_load_external_field_grid_picmi.py # inputs + analysis_3d.py # analysis + diags/diag1000300 # output + OFF # dependency +) + +add_warpx_test( + test_3d_load_external_field_particle_picmi # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_load_external_field_particle_picmi.py # inputs + analysis_3d.py # analysis + diags/diag1000300 # output + OFF # dependency +) + +add_warpx_test( + test_rz_load_external_field_grid # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_load_external_field_grid # inputs + analysis_rz.py # analysis + diags/diag1000300 # output + OFF # dependency +) + +add_warpx_test( + test_rz_load_external_field_grid_restart # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_load_external_field_grid_restart # inputs + analysis_default_restart.py # analysis + diags/diag1000300 # output + test_rz_load_external_field_grid # dependency +) + +add_warpx_test( + test_rz_load_external_field_particles # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_load_external_field_particles # inputs + analysis_rz.py # analysis + diags/diag1000300 # output + OFF # dependency +) + +add_warpx_test( + test_rz_load_external_field_particles_restart # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_load_external_field_particles_restart # inputs + analysis_default_restart.py # analysis + diags/diag1000300 # output + test_rz_load_external_field_particles # dependency +) diff --git a/Examples/Tests/LoadExternalField/analysis_3d.py b/Examples/Tests/load_external_field/analysis_3d.py similarity index 100% rename from Examples/Tests/LoadExternalField/analysis_3d.py rename to Examples/Tests/load_external_field/analysis_3d.py diff --git a/Examples/Tests/load_external_field/analysis_default_restart.py b/Examples/Tests/load_external_field/analysis_default_restart.py new file mode 120000 index 00000000000..0459986eebc --- /dev/null +++ b/Examples/Tests/load_external_field/analysis_default_restart.py @@ -0,0 +1 @@ +../../analysis_default_restart.py \ No newline at end of file diff --git a/Examples/Tests/LoadExternalField/analysis_rz.py b/Examples/Tests/load_external_field/analysis_rz.py similarity index 100% rename from Examples/Tests/LoadExternalField/analysis_rz.py rename to Examples/Tests/load_external_field/analysis_rz.py diff --git a/Examples/Tests/LoadExternalField/PICMI_inputs_3d_grid_fields.py b/Examples/Tests/load_external_field/inputs_test_3d_load_external_field_grid_picmi.py similarity index 95% rename from Examples/Tests/LoadExternalField/PICMI_inputs_3d_grid_fields.py rename to Examples/Tests/load_external_field/inputs_test_3d_load_external_field_grid_picmi.py index f71bb171ee3..231552d088e 100644 --- a/Examples/Tests/LoadExternalField/PICMI_inputs_3d_grid_fields.py +++ b/Examples/Tests/load_external_field/inputs_test_3d_load_external_field_grid_picmi.py @@ -94,16 +94,12 @@ period=300, species=[ions], data_list=["ux", "uy", "uz", "x", "y", "z", "weighting"], - write_dir=".", - warpx_file_prefix="Python_LoadExternalGridField3D_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=300, data_list=["Bx", "By", "Bz", "Ex", "Ey", "Ez", "Jx", "Jy", "Jz"], - write_dir=".", - warpx_file_prefix="Python_LoadExternalGridField3D_plt", ) ################################# diff --git a/Examples/Tests/LoadExternalField/PICMI_inputs_3d_particle_fields.py b/Examples/Tests/load_external_field/inputs_test_3d_load_external_field_particle_picmi.py similarity index 95% rename from Examples/Tests/LoadExternalField/PICMI_inputs_3d_particle_fields.py rename to Examples/Tests/load_external_field/inputs_test_3d_load_external_field_particle_picmi.py index 90b1ac78474..c2ec6c1a5b7 100644 --- a/Examples/Tests/LoadExternalField/PICMI_inputs_3d_particle_fields.py +++ b/Examples/Tests/load_external_field/inputs_test_3d_load_external_field_particle_picmi.py @@ -94,16 +94,12 @@ period=300, species=[ions], data_list=["ux", "uy", "uz", "x", "y", "z", "weighting"], - write_dir=".", - warpx_file_prefix="Python_LoadExternalParticleField3D_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=300, data_list=["Bx", "By", "Bz", "Ex", "Ey", "Ez", "Jx", "Jy", "Jz"], - write_dir=".", - warpx_file_prefix="Python_LoadExternalParticleField3D_plt", ) ################################# diff --git a/Examples/Tests/LoadExternalField/inputs_rz_grid_fields b/Examples/Tests/load_external_field/inputs_test_rz_load_external_field_grid similarity index 97% rename from Examples/Tests/LoadExternalField/inputs_rz_grid_fields rename to Examples/Tests/load_external_field/inputs_test_rz_load_external_field_grid index 2e22ca299ea..f986add7bf5 100644 --- a/Examples/Tests/LoadExternalField/inputs_rz_grid_fields +++ b/Examples/Tests/load_external_field/inputs_test_rz_load_external_field_grid @@ -1,3 +1,4 @@ +warpx.abort_on_warning_threshold = medium warpx.serialize_initial_conditions = 0 warpx.do_dynamic_scheduling = 0 particles.do_tiling = 0 diff --git a/Examples/Tests/load_external_field/inputs_test_rz_load_external_field_grid_restart b/Examples/Tests/load_external_field/inputs_test_rz_load_external_field_grid_restart new file mode 100644 index 00000000000..ed31e697e25 --- /dev/null +++ b/Examples/Tests/load_external_field/inputs_test_rz_load_external_field_grid_restart @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_test_rz_load_external_field_grid + +# test input parameters +amr.restart = "../test_rz_load_external_field_grid/diags/chk000150" diff --git a/Examples/Tests/LoadExternalField/inputs_rz_particle_fields b/Examples/Tests/load_external_field/inputs_test_rz_load_external_field_particles similarity index 97% rename from Examples/Tests/LoadExternalField/inputs_rz_particle_fields rename to Examples/Tests/load_external_field/inputs_test_rz_load_external_field_particles index b76d4cb7efc..e725ed588b0 100644 --- a/Examples/Tests/LoadExternalField/inputs_rz_particle_fields +++ b/Examples/Tests/load_external_field/inputs_test_rz_load_external_field_particles @@ -1,3 +1,4 @@ +warpx.abort_on_warning_threshold = medium warpx.serialize_initial_conditions = 0 warpx.do_dynamic_scheduling = 0 particles.do_tiling = 0 diff --git a/Examples/Tests/load_external_field/inputs_test_rz_load_external_field_particles_restart b/Examples/Tests/load_external_field/inputs_test_rz_load_external_field_particles_restart new file mode 100644 index 00000000000..7e20f87d6d2 --- /dev/null +++ b/Examples/Tests/load_external_field/inputs_test_rz_load_external_field_particles_restart @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_test_rz_load_external_field_particles + +# test input parameters +amr.restart = "../test_rz_load_external_field_particles/diags/chk000150" diff --git a/Examples/Tests/magnetostatic_eb/CMakeLists.txt b/Examples/Tests/magnetostatic_eb/CMakeLists.txt new file mode 100644 index 00000000000..db97a6e11c2 --- /dev/null +++ b/Examples/Tests/magnetostatic_eb/CMakeLists.txt @@ -0,0 +1,41 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_3d_magnetostatic_eb # name + 3 # dims + 1 # nprocs + ON # eb + inputs_test_3d_magnetostatic_eb # inputs + analysis_default_regression.py # analysis + diags/diag1000001 # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_3d_magnetostatic_eb_picmi # name + 3 # dims + 1 # nprocs + ON # eb + inputs_test_3d_magnetostatic_eb_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000001 # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_rz_magnetostatic_eb_picmi # name + RZ # dims + 1 # nprocs + ON # eb + inputs_test_rz_magnetostatic_eb_picmi.py # inputs + analysis_rz.py # analysis + diags/diag1000001 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/magnetostatic_eb/analysis_default_regression.py b/Examples/Tests/magnetostatic_eb/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/magnetostatic_eb/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/magnetostatic_eb/inputs_3d b/Examples/Tests/magnetostatic_eb/inputs_test_3d_magnetostatic_eb similarity index 96% rename from Examples/Tests/magnetostatic_eb/inputs_3d rename to Examples/Tests/magnetostatic_eb/inputs_test_3d_magnetostatic_eb index 60617f7d392..73ff14dc8a4 100644 --- a/Examples/Tests/magnetostatic_eb/inputs_3d +++ b/Examples/Tests/magnetostatic_eb/inputs_test_3d_magnetostatic_eb @@ -48,4 +48,3 @@ diag1.diag_type = Full diag1.format = plotfile diag1.intervals = 1 diag1.fields_to_plot = Az Bx By Ex Ey jz phi rho -diag1.file_prefix = ./magnetostatic_eb_3d_mr_plt diff --git a/Examples/Tests/magnetostatic_eb/PICMI_inputs_3d.py b/Examples/Tests/magnetostatic_eb/inputs_test_3d_magnetostatic_eb_picmi.py similarity index 97% rename from Examples/Tests/magnetostatic_eb/PICMI_inputs_3d.py rename to Examples/Tests/magnetostatic_eb/inputs_test_3d_magnetostatic_eb_picmi.py index 6a3fe9e2988..d3c35daf261 100755 --- a/Examples/Tests/magnetostatic_eb/PICMI_inputs_3d.py +++ b/Examples/Tests/magnetostatic_eb/inputs_test_3d_magnetostatic_eb_picmi.py @@ -122,8 +122,6 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=1, - write_dir=".", - warpx_file_prefix="Python_magnetostatic_eb_3d_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", @@ -145,8 +143,6 @@ "phi", "rho", ], - write_dir=".", - warpx_file_prefix="Python_magnetostatic_eb_3d_plt", ) ########################## diff --git a/Examples/Tests/magnetostatic_eb/PICMI_inputs_rz.py b/Examples/Tests/magnetostatic_eb/inputs_test_rz_magnetostatic_eb_picmi.py similarity index 97% rename from Examples/Tests/magnetostatic_eb/PICMI_inputs_rz.py rename to Examples/Tests/magnetostatic_eb/inputs_test_rz_magnetostatic_eb_picmi.py index 0ccf4460dfe..d0f1787a5a2 100755 --- a/Examples/Tests/magnetostatic_eb/PICMI_inputs_rz.py +++ b/Examples/Tests/magnetostatic_eb/inputs_test_rz_magnetostatic_eb_picmi.py @@ -122,16 +122,12 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=1, - write_dir=".", - warpx_file_prefix="Python_magnetostatic_eb_rz_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=1, data_list=["Er", "Bt", "Az", "Jz", "phi", "rho"], - write_dir=".", - warpx_file_prefix="Python_magnetostatic_eb_rz_plt", ) ########################## diff --git a/Examples/Tests/maxwell_hybrid_qed/CMakeLists.txt b/Examples/Tests/maxwell_hybrid_qed/CMakeLists.txt new file mode 100644 index 00000000000..9e315b7536d --- /dev/null +++ b/Examples/Tests/maxwell_hybrid_qed/CMakeLists.txt @@ -0,0 +1,15 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_FFT) + add_warpx_test( + test_2d_maxwell_hybrid_qed_solver # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_maxwell_hybrid_qed_solver # inputs + analysis.py # analysis + diags/diag1000300 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/maxwell_hybrid_qed/analysis_Maxwell_QED_Hybrid.py b/Examples/Tests/maxwell_hybrid_qed/analysis.py similarity index 100% rename from Examples/Tests/maxwell_hybrid_qed/analysis_Maxwell_QED_Hybrid.py rename to Examples/Tests/maxwell_hybrid_qed/analysis.py diff --git a/Examples/Tests/maxwell_hybrid_qed/inputs_2d b/Examples/Tests/maxwell_hybrid_qed/inputs_test_2d_maxwell_hybrid_qed_solver similarity index 98% rename from Examples/Tests/maxwell_hybrid_qed/inputs_2d rename to Examples/Tests/maxwell_hybrid_qed/inputs_test_2d_maxwell_hybrid_qed_solver index 2baa72c0990..8e1091c91e2 100644 --- a/Examples/Tests/maxwell_hybrid_qed/inputs_2d +++ b/Examples/Tests/maxwell_hybrid_qed/inputs_test_2d_maxwell_hybrid_qed_solver @@ -24,7 +24,7 @@ boundary.field_hi = periodic periodic algo.maxwell_solver = psatd warpx.verbose = 0 warpx.use_filter = 1 -warpx.cfl = 1. +warpx.cfl = 0.7071067811865475 warpx.use_hybrid_QED = 1 ################################# diff --git a/Examples/Tests/nci_fdtd_stability/CMakeLists.txt b/Examples/Tests/nci_fdtd_stability/CMakeLists.txt new file mode 100644 index 00000000000..73d0f38beec --- /dev/null +++ b/Examples/Tests/nci_fdtd_stability/CMakeLists.txt @@ -0,0 +1,24 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_nci_corrector # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_nci_corrector # inputs + analysis_ncicorr.py # analysis + diags/diag1000600 # output + OFF # dependency +) + +add_warpx_test( + test_2d_nci_corrector_mr # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_nci_corrector_mr # inputs + analysis_ncicorr.py # analysis + diags/diag1000600 # output + OFF # dependency +) diff --git a/Examples/Tests/nci_fdtd_stability/inputs_2d b/Examples/Tests/nci_fdtd_stability/inputs_base_2d similarity index 100% rename from Examples/Tests/nci_fdtd_stability/inputs_2d rename to Examples/Tests/nci_fdtd_stability/inputs_base_2d diff --git a/Examples/Tests/nci_fdtd_stability/inputs_test_2d_nci_corrector b/Examples/Tests/nci_fdtd_stability/inputs_test_2d_nci_corrector new file mode 100644 index 00000000000..83d537fd856 --- /dev/null +++ b/Examples/Tests/nci_fdtd_stability/inputs_test_2d_nci_corrector @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +amr.max_level = 0 +particles.use_fdtd_nci_corr = 1 diff --git a/Examples/Tests/nci_fdtd_stability/inputs_test_2d_nci_corrector_mr b/Examples/Tests/nci_fdtd_stability/inputs_test_2d_nci_corrector_mr new file mode 100644 index 00000000000..0f53af0443a --- /dev/null +++ b/Examples/Tests/nci_fdtd_stability/inputs_test_2d_nci_corrector_mr @@ -0,0 +1,9 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +amr.max_level = 1 +amr.n_cell = 64 64 +particles.use_fdtd_nci_corr = 1 +warpx.fine_tag_hi = 20.e-6 20.e-6 +warpx.fine_tag_lo = -20.e-6 -20.e-6 diff --git a/Examples/Tests/nci_psatd_stability/CMakeLists.txt b/Examples/Tests/nci_psatd_stability/CMakeLists.txt new file mode 100644 index 00000000000..6a27abdc783 --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/CMakeLists.txt @@ -0,0 +1,223 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_FFT) + add_warpx_test( + test_2d_averaged_galilean_psatd # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_averaged_galilean_psatd # inputs + analysis_galilean.py # analysis + diags/diag1000400 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_averaged_galilean_psatd_hybrid # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_averaged_galilean_psatd_hybrid # inputs + analysis_galilean.py # analysis + diags/diag1000400 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_comoving_psatd_hybrid # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_comoving_psatd_hybrid # inputs + analysis_default_regression.py # analysis + diags/diag1000400 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_galilean_psatd # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_galilean_psatd # inputs + analysis_galilean.py # analysis + diags/diag1000400 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_galilean_psatd_current_correction # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_galilean_psatd_current_correction # inputs + analysis_galilean.py # analysis + diags/diag1000400 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_galilean_psatd_current_correction_psb # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_galilean_psatd_current_correction_psb # inputs + analysis_galilean.py # analysis + diags/diag1000400 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_galilean_psatd_hybrid # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_galilean_psatd_hybrid # inputs + analysis_default_regression.py # analysis + diags/diag1000400 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_averaged_galilean_psatd # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_averaged_galilean_psatd # inputs + analysis_galilean.py # analysis + diags/diag1000160 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_averaged_galilean_psatd_hybrid # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_averaged_galilean_psatd_hybrid # inputs + analysis_galilean.py # analysis + diags/diag1000160 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_galilean_psatd # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_galilean_psatd # inputs + analysis_galilean.py # analysis + diags/diag1000300 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_galilean_psatd_current_correction # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_galilean_psatd_current_correction # inputs + analysis_galilean.py # analysis + diags/diag1000300 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_galilean_psatd_current_correction_psb # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_galilean_psatd_current_correction_psb # inputs + analysis_galilean.py # analysis + diags/diag1000300 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_uniform_plasma_multiJ # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_uniform_plasma_multiJ # inputs + analysis_multiJ.py # analysis + diags/diag1000300 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_rz_galilean_psatd # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_galilean_psatd # inputs + analysis_galilean.py # analysis + diags/diag1000400 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_rz_galilean_psatd_current_correction # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_galilean_psatd_current_correction # inputs + analysis_galilean.py # analysis + diags/diag1000400 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_rz_galilean_psatd_current_correction_psb # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_galilean_psatd_current_correction_psb # inputs + analysis_galilean.py # analysis + diags/diag1000400 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_rz_multiJ_psatd # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_multiJ_psatd # inputs + analysis_default_regression.py # analysis + diags/diag1000050 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/nci_psatd_stability/analysis_default_regression.py b/Examples/Tests/nci_psatd_stability/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/nci_psatd_stability/inputs_2d b/Examples/Tests/nci_psatd_stability/inputs_base_2d similarity index 100% rename from Examples/Tests/nci_psatd_stability/inputs_2d rename to Examples/Tests/nci_psatd_stability/inputs_base_2d diff --git a/Examples/Tests/nci_psatd_stability/inputs_avg_2d b/Examples/Tests/nci_psatd_stability/inputs_base_2d_averaged similarity index 100% rename from Examples/Tests/nci_psatd_stability/inputs_avg_2d rename to Examples/Tests/nci_psatd_stability/inputs_base_2d_averaged diff --git a/Examples/Tests/nci_psatd_stability/inputs_3d b/Examples/Tests/nci_psatd_stability/inputs_base_3d similarity index 100% rename from Examples/Tests/nci_psatd_stability/inputs_3d rename to Examples/Tests/nci_psatd_stability/inputs_base_3d diff --git a/Examples/Tests/nci_psatd_stability/inputs_avg_3d b/Examples/Tests/nci_psatd_stability/inputs_base_3d_averaged similarity index 100% rename from Examples/Tests/nci_psatd_stability/inputs_avg_3d rename to Examples/Tests/nci_psatd_stability/inputs_base_3d_averaged diff --git a/Examples/Tests/nci_psatd_stability/inputs_rz b/Examples/Tests/nci_psatd_stability/inputs_base_rz similarity index 100% rename from Examples/Tests/nci_psatd_stability/inputs_rz rename to Examples/Tests/nci_psatd_stability/inputs_base_rz diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_2d_averaged_galilean_psatd b/Examples/Tests/nci_psatd_stability/inputs_test_2d_averaged_galilean_psatd new file mode 100644 index 00000000000..62f93dbd473 --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_2d_averaged_galilean_psatd @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_2d_averaged + +# test input parameters +psatd.current_correction = 0 +warpx.abort_on_warning_threshold = medium diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_2d_averaged_galilean_psatd_hybrid b/Examples/Tests/nci_psatd_stability/inputs_test_2d_averaged_galilean_psatd_hybrid new file mode 100644 index 00000000000..0ef3668b103 --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_2d_averaged_galilean_psatd_hybrid @@ -0,0 +1,9 @@ +# base input parameters +FILE = inputs_base_2d_averaged + +# test input parameters +amr.max_grid_size_x = 128 +amr.max_grid_size_y = 64 +psatd.current_correction = 0 +warpx.abort_on_warning_threshold = medium +warpx.grid_type = hybrid diff --git a/Examples/Tests/comoving/inputs_2d_hybrid b/Examples/Tests/nci_psatd_stability/inputs_test_2d_comoving_psatd_hybrid similarity index 97% rename from Examples/Tests/comoving/inputs_2d_hybrid rename to Examples/Tests/nci_psatd_stability/inputs_test_2d_comoving_psatd_hybrid index 393e18d2077..32b155cf0b6 100644 --- a/Examples/Tests/comoving/inputs_2d_hybrid +++ b/Examples/Tests/nci_psatd_stability/inputs_test_2d_comoving_psatd_hybrid @@ -23,6 +23,7 @@ algo.particle_pusher = vay algo.particle_shape = 3 psatd.use_default_v_comoving = 1 +psatd.current_correction = 0 warpx.cfl = 1. @@ -40,6 +41,7 @@ warpx.use_filter = 1 warpx.serialize_initial_conditions = 1 warpx.verbose = 1 +warpx.abort_on_warning_threshold = medium particles.species_names = electrons ions beam particles.use_fdtd_nci_corr = 0 diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd b/Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd new file mode 100644 index 00000000000..caebf987434 --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd @@ -0,0 +1,8 @@ +# base input parameters +FILE = inputs_base_2d + +# test input paramters +algo.current_deposition = direct +psatd.current_correction = 0 +warpx.grid_type = collocated +warpx.abort_on_warning_threshold = medium diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd_current_correction b/Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd_current_correction new file mode 100644 index 00000000000..177cf7bcd0c --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd_current_correction @@ -0,0 +1,10 @@ +# base input parameters +FILE = inputs_base_2d + +# test input paramters +amr.blocking_factor = 64 +amr.max_grid_size = 64 +diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho divE +psatd.current_correction = 1 +psatd.periodic_single_box_fft = 0 +psatd.update_with_rho = 0 diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd_current_correction_psb b/Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd_current_correction_psb new file mode 100644 index 00000000000..437059d6bd8 --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd_current_correction_psb @@ -0,0 +1,8 @@ +# base input parameters +FILE = inputs_base_2d + +# test input paramters +diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho divE +psatd.current_correction = 1 +psatd.periodic_single_box_fft = 1 +psatd.update_with_rho = 0 diff --git a/Examples/Tests/nci_psatd_stability/inputs_2d_hybrid b/Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd_hybrid similarity index 97% rename from Examples/Tests/nci_psatd_stability/inputs_2d_hybrid rename to Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd_hybrid index 90dfd58c4ae..501c964353f 100644 --- a/Examples/Tests/nci_psatd_stability/inputs_2d_hybrid +++ b/Examples/Tests/nci_psatd_stability/inputs_test_2d_galilean_psatd_hybrid @@ -21,6 +21,7 @@ algo.particle_pusher = vay algo.particle_shape = 3 psatd.use_default_v_galilean = 1 +psatd.current_correction = 0 warpx.cfl = 1. @@ -38,6 +39,7 @@ warpx.use_filter = 1 warpx.serialize_initial_conditions = 1 warpx.verbose = 1 +warpx.abort_on_warning_threshold = medium particles.species_names = electrons ions beam particles.use_fdtd_nci_corr = 0 diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_3d_averaged_galilean_psatd b/Examples/Tests/nci_psatd_stability/inputs_test_3d_averaged_galilean_psatd new file mode 100644 index 00000000000..7c978874145 --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_3d_averaged_galilean_psatd @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_3d_averaged + +# test input parameters +psatd.current_correction = 0 +warpx.abort_on_warning_threshold = medium diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_3d_averaged_galilean_psatd_hybrid b/Examples/Tests/nci_psatd_stability/inputs_test_3d_averaged_galilean_psatd_hybrid new file mode 100644 index 00000000000..4996f476854 --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_3d_averaged_galilean_psatd_hybrid @@ -0,0 +1,7 @@ +# base input parameters +FILE = inputs_base_3d_averaged + +# test input parameters +psatd.current_correction = 0 +warpx.abort_on_warning_threshold = medium +warpx.grid_type = hybrid diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_3d_galilean_psatd b/Examples/Tests/nci_psatd_stability/inputs_test_3d_galilean_psatd new file mode 100644 index 00000000000..3ec82981aea --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_3d_galilean_psatd @@ -0,0 +1,7 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +psatd.current_correction = 0 +psatd.v_galilean = 0. 0. 0.99498743710662 +warpx.abort_on_warning_threshold = medium diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_3d_galilean_psatd_current_correction b/Examples/Tests/nci_psatd_stability/inputs_test_3d_galilean_psatd_current_correction new file mode 100644 index 00000000000..8b596c9a633 --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_3d_galilean_psatd_current_correction @@ -0,0 +1,10 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho divE +psatd.current_correction = 1 +psatd.periodic_single_box_fft = 0 +psatd.update_with_rho = 0 +psatd.v_galilean = 0. 0. 0.99498743710662 +warpx.numprocs = 1 1 2 diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_3d_galilean_psatd_current_correction_psb b/Examples/Tests/nci_psatd_stability/inputs_test_3d_galilean_psatd_current_correction_psb new file mode 100644 index 00000000000..87ce1b7ed92 --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_3d_galilean_psatd_current_correction_psb @@ -0,0 +1,10 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho divE +psatd.current_correction = 1 +psatd.periodic_single_box_fft = 1 +psatd.v_galilean = 0. 0. 0.99498743710662 +psatd.update_with_rho = 0 +warpx.numprocs = 1 1 1 diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_3d_uniform_plasma_multiJ b/Examples/Tests/nci_psatd_stability/inputs_test_3d_uniform_plasma_multiJ new file mode 100644 index 00000000000..70e9c5e992c --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_3d_uniform_plasma_multiJ @@ -0,0 +1,13 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +diag1.fields_to_plot = Bx By Bz divE Ex Ey Ez F G jx jy jz rho +psatd.J_in_time = constant +psatd.rho_in_time = constant +psatd.solution_type = first-order +warpx.abort_on_warning_threshold = medium +warpx.do_divb_cleaning = 1 +warpx.do_dive_cleaning = 1 +warpx.do_multi_J = 1 +warpx.do_multi_J_n_depositions = 1 diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_rz_galilean_psatd b/Examples/Tests/nci_psatd_stability/inputs_test_rz_galilean_psatd new file mode 100644 index 00000000000..30bcfc160cf --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_rz_galilean_psatd @@ -0,0 +1,8 @@ +# base input parameters +FILE = inputs_base_rz + +# test input paramters +electrons.random_theta = 0 +ions.random_theta = 0 +psatd.current_correction = 0 +warpx.abort_on_warning_threshold = medium diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_rz_galilean_psatd_current_correction b/Examples/Tests/nci_psatd_stability/inputs_test_rz_galilean_psatd_current_correction new file mode 100644 index 00000000000..378535e12bc --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_rz_galilean_psatd_current_correction @@ -0,0 +1,10 @@ +# base input parameters +FILE = inputs_base_rz + +# test input paramters +amr.blocking_factor = 32 +amr.max_grid_size = 32 +electrons.random_theta = 0 +ions.random_theta = 0 +psatd.current_correction = 1 +psatd.periodic_single_box_fft = 0 diff --git a/Examples/Tests/nci_psatd_stability/inputs_test_rz_galilean_psatd_current_correction_psb b/Examples/Tests/nci_psatd_stability/inputs_test_rz_galilean_psatd_current_correction_psb new file mode 100644 index 00000000000..6eb35754a90 --- /dev/null +++ b/Examples/Tests/nci_psatd_stability/inputs_test_rz_galilean_psatd_current_correction_psb @@ -0,0 +1,8 @@ +# base input parameters +FILE = inputs_base_rz + +# test input paramters +electrons.random_theta = 0 +ions.random_theta = 0 +psatd.current_correction = 1 +psatd.periodic_single_box_fft = 1 diff --git a/Examples/Tests/multi_j/inputs_rz b/Examples/Tests/nci_psatd_stability/inputs_test_rz_multiJ_psatd similarity index 97% rename from Examples/Tests/multi_j/inputs_rz rename to Examples/Tests/nci_psatd_stability/inputs_test_rz_multiJ_psatd index dd440d60667..5e263856256 100644 --- a/Examples/Tests/multi_j/inputs_rz +++ b/Examples/Tests/nci_psatd_stability/inputs_test_rz_multiJ_psatd @@ -28,6 +28,7 @@ warpx.moving_window_v = 1. warpx.n_rz_azimuthal_modes = 1 warpx.use_filter = 1 warpx.verbose = 1 +warpx.abort_on_warning_threshold = medium warpx.cfl = 1. #warpx.gamma_boost = 1. @@ -42,6 +43,7 @@ psatd.do_time_averaging = 1 # PSATD psatd.update_with_rho = 1 #psatd.v_galilean = 0. 0. -0.9373391857121336 +psatd.J_in_time = linear # Particles diff --git a/Examples/Tests/nodal_electrostatic/CMakeLists.txt b/Examples/Tests/nodal_electrostatic/CMakeLists.txt new file mode 100644 index 00000000000..62627eb576a --- /dev/null +++ b/Examples/Tests/nodal_electrostatic/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_nodal_electrostatic_solver # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_nodal_electrostatic_solver # inputs + analysis.py # analysis + diags/diag1000010 # output + OFF # dependency +) diff --git a/Examples/Tests/nodal_electrostatic/analysis_3d.py b/Examples/Tests/nodal_electrostatic/analysis.py similarity index 100% rename from Examples/Tests/nodal_electrostatic/analysis_3d.py rename to Examples/Tests/nodal_electrostatic/analysis.py diff --git a/Examples/Tests/nodal_electrostatic/inputs_3d b/Examples/Tests/nodal_electrostatic/inputs_test_3d_nodal_electrostatic_solver similarity index 98% rename from Examples/Tests/nodal_electrostatic/inputs_3d rename to Examples/Tests/nodal_electrostatic/inputs_test_3d_nodal_electrostatic_solver index 91732a2c8ff..f1fd206eee3 100644 --- a/Examples/Tests/nodal_electrostatic/inputs_3d +++ b/Examples/Tests/nodal_electrostatic/inputs_test_3d_nodal_electrostatic_solver @@ -35,6 +35,7 @@ boundary.field_hi = PEC PEC PEC warpx.do_electrostatic = relativistic warpx.const_dt = dt warpx.grid_type = collocated +warpx.abort_on_warning_threshold = high algo.particle_pusher = vay algo.particle_shape = 3 diff --git a/Examples/Tests/nuclear_fusion/CMakeLists.txt b/Examples/Tests/nuclear_fusion/CMakeLists.txt new file mode 100644 index 00000000000..4ed47607c8d --- /dev/null +++ b/Examples/Tests/nuclear_fusion/CMakeLists.txt @@ -0,0 +1,68 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_proton_boron_fusion # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_proton_boron_fusion # inputs + analysis_proton_boron_fusion.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_3d_deuterium_deuterium_fusion # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_deuterium_deuterium_fusion # inputs + analysis_two_product_fusion.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_3d_deuterium_deuterium_fusion_intraspecies # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_deuterium_deuterium_fusion_intraspecies # inputs + analysis_deuterium_deuterium_3d_intraspecies.py # analysis + diags/diag1000010 # output + OFF # dependency +) + +add_warpx_test( + test_3d_deuterium_tritium_fusion # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_deuterium_tritium_fusion # inputs + analysis_two_product_fusion.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_3d_proton_boron_fusion # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_proton_boron_fusion # inputs + analysis_proton_boron_fusion.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_rz_deuterium_tritium_fusion # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_deuterium_tritium_fusion # inputs + analysis_two_product_fusion.py # analysis + diags/diag1000001 # output + OFF # dependency +) diff --git a/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py b/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py index b4f77bb9caa..25e898c05be 100755 --- a/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py +++ b/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py @@ -6,6 +6,7 @@ # License: BSD-3-Clause-LBNL import os +import re import sys import yt @@ -82,7 +83,9 @@ E_fusion_total = E_fusion + E_decay # Energy released during p + B -> 3*alpha ## Checks whether this is the 2D or the 3D test -is_2D = "2D" in sys.argv[1] +with open("./warpx_used_inputs") as warpx_used_inputs: + is_2D = re.search("geometry.dims\s*=\s*2", warpx_used_inputs.read()) +warpx_used_inputs.close() ## Some numerical parameters for this test size_x = 8 diff --git a/Examples/Tests/nuclear_fusion/inputs_proton_boron_2d b/Examples/Tests/nuclear_fusion/inputs_test_2d_proton_boron_fusion similarity index 100% rename from Examples/Tests/nuclear_fusion/inputs_proton_boron_2d rename to Examples/Tests/nuclear_fusion/inputs_test_2d_proton_boron_fusion diff --git a/Examples/Tests/nuclear_fusion/inputs_deuterium_deuterium_3d b/Examples/Tests/nuclear_fusion/inputs_test_3d_deuterium_deuterium_fusion similarity index 100% rename from Examples/Tests/nuclear_fusion/inputs_deuterium_deuterium_3d rename to Examples/Tests/nuclear_fusion/inputs_test_3d_deuterium_deuterium_fusion diff --git a/Examples/Tests/nuclear_fusion/inputs_deuterium_deuterium_3d_intraspecies b/Examples/Tests/nuclear_fusion/inputs_test_3d_deuterium_deuterium_fusion_intraspecies similarity index 100% rename from Examples/Tests/nuclear_fusion/inputs_deuterium_deuterium_3d_intraspecies rename to Examples/Tests/nuclear_fusion/inputs_test_3d_deuterium_deuterium_fusion_intraspecies diff --git a/Examples/Tests/nuclear_fusion/inputs_deuterium_tritium_3d b/Examples/Tests/nuclear_fusion/inputs_test_3d_deuterium_tritium_fusion similarity index 100% rename from Examples/Tests/nuclear_fusion/inputs_deuterium_tritium_3d rename to Examples/Tests/nuclear_fusion/inputs_test_3d_deuterium_tritium_fusion diff --git a/Examples/Tests/nuclear_fusion/inputs_proton_boron_3d b/Examples/Tests/nuclear_fusion/inputs_test_3d_proton_boron_fusion similarity index 100% rename from Examples/Tests/nuclear_fusion/inputs_proton_boron_3d rename to Examples/Tests/nuclear_fusion/inputs_test_3d_proton_boron_fusion diff --git a/Examples/Tests/nuclear_fusion/inputs_deuterium_tritium_rz b/Examples/Tests/nuclear_fusion/inputs_test_rz_deuterium_tritium_fusion similarity index 100% rename from Examples/Tests/nuclear_fusion/inputs_deuterium_tritium_rz rename to Examples/Tests/nuclear_fusion/inputs_test_rz_deuterium_tritium_fusion diff --git a/Examples/Tests/ohm_solver_em_modes/CMakeLists.txt b/Examples/Tests/ohm_solver_em_modes/CMakeLists.txt new file mode 100644 index 00000000000..ce5bed2c587 --- /dev/null +++ b/Examples/Tests/ohm_solver_em_modes/CMakeLists.txt @@ -0,0 +1,24 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_ohm_solver_em_modes_picmi # name + 1 # dims + 2 # nprocs + OFF # eb + "inputs_test_1d_ohm_solver_em_modes_picmi.py --test --dim 1 --bdir z" # inputs + analysis.py # analysis + diags/field_diag000250 # output + OFF # dependency +) + +add_warpx_test( + test_rz_ohm_solver_em_modes_picmi # name + RZ # dims + 2 # nprocs + OFF # eb + "inputs_test_rz_ohm_solver_em_modes_picmi.py --test" # inputs + analysis_rz.py # analysis + diags/diag1000100 # output + OFF # dependency +) diff --git a/Examples/Tests/ohm_solver_EM_modes/README.rst b/Examples/Tests/ohm_solver_em_modes/README similarity index 100% rename from Examples/Tests/ohm_solver_EM_modes/README.rst rename to Examples/Tests/ohm_solver_em_modes/README diff --git a/Examples/Tests/ohm_solver_EM_modes/analysis.py b/Examples/Tests/ohm_solver_em_modes/analysis.py similarity index 100% rename from Examples/Tests/ohm_solver_EM_modes/analysis.py rename to Examples/Tests/ohm_solver_em_modes/analysis.py diff --git a/Examples/Tests/ohm_solver_EM_modes/analysis_rz.py b/Examples/Tests/ohm_solver_em_modes/analysis_rz.py similarity index 100% rename from Examples/Tests/ohm_solver_EM_modes/analysis_rz.py rename to Examples/Tests/ohm_solver_em_modes/analysis_rz.py diff --git a/Examples/Tests/ohm_solver_EM_modes/PICMI_inputs.py b/Examples/Tests/ohm_solver_em_modes/inputs_test_1d_ohm_solver_em_modes_picmi.py similarity index 98% rename from Examples/Tests/ohm_solver_EM_modes/PICMI_inputs.py rename to Examples/Tests/ohm_solver_em_modes/inputs_test_1d_ohm_solver_em_modes_picmi.py index 11394029062..ac0c2369c0e 100644 --- a/Examples/Tests/ohm_solver_EM_modes/PICMI_inputs.py +++ b/Examples/Tests/ohm_solver_em_modes/inputs_test_1d_ohm_solver_em_modes_picmi.py @@ -257,8 +257,6 @@ def setup_run(self): particle_diag = picmi.ParticleDiagnostic( name="field_diag", period=self.total_steps, - write_dir=".", - warpx_file_prefix="Python_ohms_law_solver_EM_modes_1d_plt", # warpx_format = 'openpmd', # warpx_openpmd_backend = 'h5' ) @@ -268,8 +266,6 @@ def setup_run(self): grid=self.grid, period=self.total_steps, data_list=["B", "E", "J_displacement"], - write_dir=".", - warpx_file_prefix="Python_ohms_law_solver_EM_modes_1d_plt", # warpx_format = 'openpmd', # warpx_openpmd_backend = 'h5' ) diff --git a/Examples/Tests/ohm_solver_EM_modes/PICMI_inputs_rz.py b/Examples/Tests/ohm_solver_em_modes/inputs_test_rz_ohm_solver_em_modes_picmi.py similarity index 98% rename from Examples/Tests/ohm_solver_EM_modes/PICMI_inputs_rz.py rename to Examples/Tests/ohm_solver_em_modes/inputs_test_rz_ohm_solver_em_modes_picmi.py index ace91bad4d5..ba922dbdc9f 100644 --- a/Examples/Tests/ohm_solver_EM_modes/PICMI_inputs_rz.py +++ b/Examples/Tests/ohm_solver_em_modes/inputs_test_rz_ohm_solver_em_modes_picmi.py @@ -224,8 +224,6 @@ def setup_run(self): period=self.total_steps, species=[self.ions], data_list=["ux", "uy", "uz", "weighting"], - write_dir=".", - warpx_file_prefix="Python_ohms_law_solver_EM_modes_rz_plt", ) simulation.add_diagnostic(part_diag) diff --git a/Examples/Tests/ohm_solver_ion_Landau_damping/CMakeLists.txt b/Examples/Tests/ohm_solver_ion_Landau_damping/CMakeLists.txt new file mode 100644 index 00000000000..e5017318f19 --- /dev/null +++ b/Examples/Tests/ohm_solver_ion_Landau_damping/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_ohm_solver_landau_damping_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + "inputs_test_2d_ohm_solver_landau_damping_picmi.py --test --dim 2 --temp_ratio 0.1" # inputs + analysis.py # analysis + diags/diag1000100 # output + OFF # dependency +) diff --git a/Examples/Tests/ohm_solver_ion_Landau_damping/README.rst b/Examples/Tests/ohm_solver_ion_Landau_damping/README similarity index 100% rename from Examples/Tests/ohm_solver_ion_Landau_damping/README.rst rename to Examples/Tests/ohm_solver_ion_Landau_damping/README diff --git a/Examples/Tests/ohm_solver_ion_Landau_damping/PICMI_inputs.py b/Examples/Tests/ohm_solver_ion_Landau_damping/inputs_test_2d_ohm_solver_landau_damping_picmi.py similarity index 98% rename from Examples/Tests/ohm_solver_ion_Landau_damping/PICMI_inputs.py rename to Examples/Tests/ohm_solver_ion_Landau_damping/inputs_test_2d_ohm_solver_landau_damping_picmi.py index 4f7c26bb403..7c1709d059f 100644 --- a/Examples/Tests/ohm_solver_ion_Landau_damping/PICMI_inputs.py +++ b/Examples/Tests/ohm_solver_ion_Landau_damping/inputs_test_2d_ohm_solver_landau_damping_picmi.py @@ -219,19 +219,15 @@ def setup_run(self): particle_diag = picmi.ParticleDiagnostic( name="diag1", period=100, - write_dir=".", species=[self.ions], data_list=["ux", "uy", "uz", "x", "z", "weighting"], - warpx_file_prefix=f"Python_ohms_law_solver_landau_damping_{self.dim}d_plt", ) simulation.add_diagnostic(particle_diag) field_diag = picmi.FieldDiagnostic( name="diag1", grid=self.grid, period=100, - write_dir=".", data_list=["Bx", "By", "Bz", "Ex", "Ey", "Ez", "Jx", "Jy", "Jz"], - warpx_file_prefix=f"Python_ohms_law_solver_landau_damping_{self.dim}d_plt", ) simulation.add_diagnostic(field_diag) diff --git a/Examples/Tests/ohm_solver_ion_beam_instability/CMakeLists.txt b/Examples/Tests/ohm_solver_ion_beam_instability/CMakeLists.txt new file mode 100644 index 00000000000..a6c978ba3ef --- /dev/null +++ b/Examples/Tests/ohm_solver_ion_beam_instability/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_ohm_solver_ion_beam_picmi # name + 1 # dims + 2 # nprocs + OFF # eb + "inputs_test_1d_ohm_solver_ion_beam_picmi.py --test --dim 1 --resonant" # inputs + analysis.py # analysis + diags/diag1002500 # output + OFF # dependency +) diff --git a/Examples/Tests/ohm_solver_ion_beam_instability/README.rst b/Examples/Tests/ohm_solver_ion_beam_instability/README similarity index 100% rename from Examples/Tests/ohm_solver_ion_beam_instability/README.rst rename to Examples/Tests/ohm_solver_ion_beam_instability/README diff --git a/Examples/Tests/ohm_solver_ion_beam_instability/PICMI_inputs.py b/Examples/Tests/ohm_solver_ion_beam_instability/inputs_test_1d_ohm_solver_ion_beam_picmi.py similarity index 98% rename from Examples/Tests/ohm_solver_ion_beam_instability/PICMI_inputs.py rename to Examples/Tests/ohm_solver_ion_beam_instability/inputs_test_1d_ohm_solver_ion_beam_picmi.py index 2558d70b4b8..19569a04e5b 100644 --- a/Examples/Tests/ohm_solver_ion_beam_instability/PICMI_inputs.py +++ b/Examples/Tests/ohm_solver_ion_beam_instability/inputs_test_1d_ohm_solver_ion_beam_picmi.py @@ -259,8 +259,6 @@ def setup_run(self): period=1250, species=[self.ions, self.beam_ions], data_list=["ux", "uy", "uz", "z", "weighting"], - write_dir=".", - warpx_file_prefix="Python_ohms_law_solver_ion_beam_1d_plt", ) simulation.add_diagnostic(part_diag) field_diag = picmi.FieldDiagnostic( @@ -268,8 +266,6 @@ def setup_run(self): grid=self.grid, period=1250, data_list=["Bx", "By", "Bz", "Ex", "Ey", "Ez", "Jx", "Jy", "Jz"], - write_dir=".", - warpx_file_prefix="Python_ohms_law_solver_ion_beam_1d_plt", ) simulation.add_diagnostic(field_diag) diff --git a/Examples/Tests/ohm_solver_magnetic_reconnection/CMakeLists.txt b/Examples/Tests/ohm_solver_magnetic_reconnection/CMakeLists.txt new file mode 100644 index 00000000000..849d4c3b2a3 --- /dev/null +++ b/Examples/Tests/ohm_solver_magnetic_reconnection/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_ohm_solver_magnetic_reconnection_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + "inputs_test_2d_ohm_solver_magnetic_reconnection_picmi.py --test" # inputs + analysis.py # analysis + diags/diag1000020 # output + OFF # dependency +) diff --git a/Examples/Tests/ohm_solver_magnetic_reconnection/README.rst b/Examples/Tests/ohm_solver_magnetic_reconnection/README similarity index 100% rename from Examples/Tests/ohm_solver_magnetic_reconnection/README.rst rename to Examples/Tests/ohm_solver_magnetic_reconnection/README diff --git a/Examples/Tests/ohm_solver_magnetic_reconnection/PICMI_inputs.py b/Examples/Tests/ohm_solver_magnetic_reconnection/inputs_test_2d_ohm_solver_magnetic_reconnection_picmi.py similarity index 98% rename from Examples/Tests/ohm_solver_magnetic_reconnection/PICMI_inputs.py rename to Examples/Tests/ohm_solver_magnetic_reconnection/inputs_test_2d_ohm_solver_magnetic_reconnection_picmi.py index b776c48f5ab..4f13c76e208 100644 --- a/Examples/Tests/ohm_solver_magnetic_reconnection/PICMI_inputs.py +++ b/Examples/Tests/ohm_solver_magnetic_reconnection/inputs_test_2d_ohm_solver_magnetic_reconnection_picmi.py @@ -247,10 +247,8 @@ def setup_run(self): particle_diag = picmi.ParticleDiagnostic( name="diag1", period=self.total_steps, - write_dir=".", species=[self.ions], data_list=["ux", "uy", "uz", "x", "z", "weighting"], - warpx_file_prefix="Python_ohms_law_solver_magnetic_reconnection_2d_plt", # warpx_format='openpmd', # warpx_openpmd_backend='h5', ) @@ -260,8 +258,6 @@ def setup_run(self): grid=self.grid, period=self.total_steps, data_list=["Bx", "By", "Bz", "Ex", "Ey", "Ez"], - write_dir=".", - warpx_file_prefix="Python_ohms_law_solver_magnetic_reconnection_2d_plt", # warpx_format='openpmd', # warpx_openpmd_backend='h5', ) diff --git a/Examples/Tests/open_bc_poisson_solver/CMakeLists.txt b/Examples/Tests/open_bc_poisson_solver/CMakeLists.txt new file mode 100644 index 00000000000..1f921ae98b2 --- /dev/null +++ b/Examples/Tests/open_bc_poisson_solver/CMakeLists.txt @@ -0,0 +1,15 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_FFT) + add_warpx_test( + test_3d_open_bc_poisson_solver # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_open_bc_poisson_solver # inputs + analysis.py # analysis + diags/diag1000001 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/openbc_poisson_solver/analysis.py b/Examples/Tests/open_bc_poisson_solver/analysis.py similarity index 100% rename from Examples/Tests/openbc_poisson_solver/analysis.py rename to Examples/Tests/open_bc_poisson_solver/analysis.py diff --git a/Examples/Tests/openbc_poisson_solver/inputs_3d b/Examples/Tests/open_bc_poisson_solver/inputs_test_3d_open_bc_poisson_solver similarity index 100% rename from Examples/Tests/openbc_poisson_solver/inputs_3d rename to Examples/Tests/open_bc_poisson_solver/inputs_test_3d_open_bc_poisson_solver diff --git a/Examples/Tests/particle_boundary_interaction/CMakeLists.txt b/Examples/Tests/particle_boundary_interaction/CMakeLists.txt new file mode 100644 index 00000000000..b7517ef9bc4 --- /dev/null +++ b/Examples/Tests/particle_boundary_interaction/CMakeLists.txt @@ -0,0 +1,15 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_rz_particle_boundary_interaction_picmi # name + RZ # dims + 2 # nprocs + ON # eb + inputs_test_rz_particle_boundary_interaction_picmi.py # inputs + analysis.py # analysis + diags/diag1/ # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/particle_boundary_interaction/analysis.py b/Examples/Tests/particle_boundary_interaction/analysis.py index 9d8baf774b7..b80cf4b52aa 100755 --- a/Examples/Tests/particle_boundary_interaction/analysis.py +++ b/Examples/Tests/particle_boundary_interaction/analysis.py @@ -24,7 +24,7 @@ test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, filename, output_format="openpmd") -ts = OpenPMDTimeSeries("./particle_boundary_interaction_plt") +ts = OpenPMDTimeSeries(filename) it = ts.iterations x, y, z = ts.get_particle(["x", "y", "z"], species="electrons", iteration=it[-1]) diff --git a/Examples/Tests/particle_boundary_interaction/PICMI_inputs_rz.py b/Examples/Tests/particle_boundary_interaction/inputs_test_rz_particle_boundary_interaction_picmi.py similarity index 97% rename from Examples/Tests/particle_boundary_interaction/PICMI_inputs_rz.py rename to Examples/Tests/particle_boundary_interaction/inputs_test_rz_particle_boundary_interaction_picmi.py index 7d33de6b5dd..4b491ac6873 100644 --- a/Examples/Tests/particle_boundary_interaction/PICMI_inputs_rz.py +++ b/Examples/Tests/particle_boundary_interaction/inputs_test_rz_particle_boundary_interaction_picmi.py @@ -78,8 +78,6 @@ period=diagnostic_interval, data_list=["Er", "Ez", "phi", "rho", "rho_electrons"], warpx_format="openpmd", - write_dir=".", - warpx_file_prefix="particle_boundary_interaction_plt", ) part_diag = picmi.ParticleDiagnostic( @@ -87,8 +85,6 @@ period=diagnostic_interval, species=[electrons], warpx_format="openpmd", - write_dir=".", - warpx_file_prefix="particle_boundary_interaction_plt", ) ########################## diff --git a/Examples/Tests/particle_boundary_process/CMakeLists.txt b/Examples/Tests/particle_boundary_process/CMakeLists.txt new file mode 100644 index 00000000000..a674c72abe3 --- /dev/null +++ b/Examples/Tests/particle_boundary_process/CMakeLists.txt @@ -0,0 +1,26 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_particle_reflection_picmi # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_particle_reflection_picmi.py # inputs + analysis_reflection.py # analysis + diags/diag1000010 # output + OFF # dependency +) + +if(WarpX_EB) + add_warpx_test( + test_3d_particle_absorption # name + 3 # dims + 2 # nprocs + ON # eb + inputs_test_3d_particle_absorption # inputs + analysis_absorption.py # analysis + diags/diag1000060 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/particle_boundary_process/analysis_absorption.py b/Examples/Tests/particle_boundary_process/analysis_absorption.py index 47ef02937a7..fdde2622684 100755 --- a/Examples/Tests/particle_boundary_process/analysis_absorption.py +++ b/Examples/Tests/particle_boundary_process/analysis_absorption.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +import sys + import yt # This test shoots a beam of electrons at cubic embedded boundary geometry @@ -9,11 +11,12 @@ # the problem domain yet. # all particles are still there -ds40 = yt.load("particle_absorption_plt000040") +ds40 = yt.load("diags/diag1000040") np40 = ds40.index.particle_headers["electrons"].num_particles assert np40 == 612 # all particles have been removed -ds60 = yt.load("particle_absorption_plt000060") +filename = sys.argv[1] +ds60 = yt.load(filename) np60 = ds60.index.particle_headers["electrons"].num_particles assert np60 == 0 diff --git a/Examples/Tests/particle_boundary_process/PICMI_inputs_reflection.py b/Examples/Tests/particle_boundary_process/inputs_test_2d_particle_reflection_picmi.py similarity index 100% rename from Examples/Tests/particle_boundary_process/PICMI_inputs_reflection.py rename to Examples/Tests/particle_boundary_process/inputs_test_2d_particle_reflection_picmi.py diff --git a/Examples/Tests/particle_boundary_process/inputs_absorption b/Examples/Tests/particle_boundary_process/inputs_test_3d_particle_absorption similarity index 100% rename from Examples/Tests/particle_boundary_process/inputs_absorption rename to Examples/Tests/particle_boundary_process/inputs_test_3d_particle_absorption diff --git a/Examples/Tests/particle_boundary_scrape/CMakeLists.txt b/Examples/Tests/particle_boundary_scrape/CMakeLists.txt new file mode 100644 index 00000000000..361f99bfb09 --- /dev/null +++ b/Examples/Tests/particle_boundary_scrape/CMakeLists.txt @@ -0,0 +1,28 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_3d_particle_scrape # name + 3 # dims + 2 # nprocs + ON # eb + inputs_test_3d_particle_scrape # inputs + analysis_scrape.py # analysis + diags/diag1000060 # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_3d_particle_scrape_picmi # name + 3 # dims + 2 # nprocs + ON # eb + inputs_test_3d_particle_scrape_picmi.py # inputs + analysis_scrape.py # analysis + diags/diag1000060 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/particle_boundary_scrape/analysis_scrape.py b/Examples/Tests/particle_boundary_scrape/analysis_scrape.py index cb737ebd5d6..1b3a97da228 100755 --- a/Examples/Tests/particle_boundary_scrape/analysis_scrape.py +++ b/Examples/Tests/particle_boundary_scrape/analysis_scrape.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 -from pathlib import Path + +import sys import yt @@ -11,19 +12,13 @@ # the problem domain yet. # all particles are still there -if Path("particle_scrape_plt000040").is_dir(): - filename = "particle_scrape_plt000040" -else: - filename = "Python_particle_scrape_plt000040" +filename = "diags/diag1000040" ds40 = yt.load(filename) np40 = ds40.index.particle_headers["electrons"].num_particles assert np40 == 612 # all particles have been removed -if Path("particle_scrape_plt000060").is_dir(): - filename = "particle_scrape_plt000060" -else: - filename = "Python_particle_scrape_plt000060" +filename = sys.argv[1] ds60 = yt.load(filename) np60 = ds60.index.particle_headers["electrons"].num_particles assert np60 == 0 diff --git a/Examples/Tests/particle_boundary_scrape/inputs_scrape b/Examples/Tests/particle_boundary_scrape/inputs_test_3d_particle_scrape similarity index 100% rename from Examples/Tests/particle_boundary_scrape/inputs_scrape rename to Examples/Tests/particle_boundary_scrape/inputs_test_3d_particle_scrape diff --git a/Examples/Tests/particle_boundary_scrape/PICMI_inputs_scrape.py b/Examples/Tests/particle_boundary_scrape/inputs_test_3d_particle_scrape_picmi.py similarity index 96% rename from Examples/Tests/particle_boundary_scrape/PICMI_inputs_scrape.py rename to Examples/Tests/particle_boundary_scrape/inputs_test_3d_particle_scrape_picmi.py index 02c22a4723d..1be71d4c397 100755 --- a/Examples/Tests/particle_boundary_scrape/PICMI_inputs_scrape.py +++ b/Examples/Tests/particle_boundary_scrape/inputs_test_3d_particle_scrape_picmi.py @@ -80,16 +80,12 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=diagnostic_intervals, - write_dir=".", - warpx_file_prefix="Python_particle_scrape_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=diagnostic_intervals, data_list=["Ex", "Ey", "Ez", "Bx", "By", "Bz"], - write_dir=".", - warpx_file_prefix="Python_particle_scrape_plt", ) ########################## diff --git a/Examples/Tests/particle_data_python/CMakeLists.txt b/Examples/Tests/particle_data_python/CMakeLists.txt new file mode 100644 index 00000000000..45bed4e9cf6 --- /dev/null +++ b/Examples/Tests/particle_data_python/CMakeLists.txt @@ -0,0 +1,35 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_particle_attr_access_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_particle_attr_access_picmi.py # inputs + analysis.py # analysis + diags/diag1000010 # output + OFF # dependency +) + +add_warpx_test( + test_2d_particle_attr_access_unique_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + "inputs_test_2d_particle_attr_access_picmi.py --unique" # inputs + analysis.py # analysis + diags/diag1000010 # output + OFF # dependency +) + +add_warpx_test( + test_2d_prev_positions_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_prev_positions_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency +) diff --git a/Examples/Tests/particle_data_python/analysis_default_regression.py b/Examples/Tests/particle_data_python/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/particle_data_python/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/particle_data_python/PICMI_inputs_2d.py b/Examples/Tests/particle_data_python/inputs_test_2d_particle_attr_access_picmi.py similarity index 94% rename from Examples/Tests/particle_data_python/PICMI_inputs_2d.py rename to Examples/Tests/particle_data_python/inputs_test_2d_particle_attr_access_picmi.py index 4ef9e9b40ed..dbd29a43bc7 100755 --- a/Examples/Tests/particle_data_python/PICMI_inputs_2d.py +++ b/Examples/Tests/particle_data_python/inputs_test_2d_particle_attr_access_picmi.py @@ -75,16 +75,12 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=10, - write_dir=".", - warpx_file_prefix=f"Python_particle_attr_access_{'unique_' if args.unique else ''}plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=10, data_list=["phi"], - write_dir=".", - warpx_file_prefix=f"Python_particle_attr_access_{'unique_' if args.unique else ''}plt", ) ########################## diff --git a/Examples/Tests/particle_data_python/PICMI_inputs_prev_pos_2d.py b/Examples/Tests/particle_data_python/inputs_test_2d_prev_positions_picmi.py similarity index 95% rename from Examples/Tests/particle_data_python/PICMI_inputs_prev_pos_2d.py rename to Examples/Tests/particle_data_python/inputs_test_2d_prev_positions_picmi.py index 97a4619e314..2ad86ecea95 100755 --- a/Examples/Tests/particle_data_python/PICMI_inputs_prev_pos_2d.py +++ b/Examples/Tests/particle_data_python/inputs_test_2d_prev_positions_picmi.py @@ -78,16 +78,12 @@ name="diag1", period=10, species=[electrons], - write_dir=".", - warpx_file_prefix="Python_prev_positions_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", data_list=["Bx", "By", "Bz", "Ex", "Ey", "Ez", "Jx", "Jy", "Jz"], period=10, grid=grid, - write_dir=".", - warpx_file_prefix="Python_prev_positions_plt", ) ########################## # simulation setup diff --git a/Examples/Tests/particle_fields_diags/CMakeLists.txt b/Examples/Tests/particle_fields_diags/CMakeLists.txt new file mode 100644 index 00000000000..b35ffe46713 --- /dev/null +++ b/Examples/Tests/particle_fields_diags/CMakeLists.txt @@ -0,0 +1,25 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_particle_fields_diags # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_particle_fields_diags # inputs + analysis_particle_diags.py # analysis + diags/diag1000200 # output + OFF # dependency +) + +# FIXME +#add_warpx_test( +# test_3d_particle_fields_diags_single_precision # name +# 3 # dims +# 2 # nprocs +# OFF # eb +# inputs_test_3d_particle_fields_diags # inputs +# analysis_particle_diags_single.py # analysis +# diags/diag1000200 # output +# OFF # dependency +#) diff --git a/Examples/Tests/particle_fields_diags/inputs b/Examples/Tests/particle_fields_diags/inputs_test_3d_particle_fields_diags similarity index 100% rename from Examples/Tests/particle_fields_diags/inputs rename to Examples/Tests/particle_fields_diags/inputs_test_3d_particle_fields_diags diff --git a/Examples/Tests/particle_pusher/CMakeLists.txt b/Examples/Tests/particle_pusher/CMakeLists.txt new file mode 100644 index 00000000000..583106014a5 --- /dev/null +++ b/Examples/Tests/particle_pusher/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_particle_pusher # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_particle_pusher # inputs + analysis.py # analysis + diags/diag1010000 # output + OFF # dependency +) diff --git a/Examples/Tests/particle_pusher/analysis_pusher.py b/Examples/Tests/particle_pusher/analysis.py similarity index 100% rename from Examples/Tests/particle_pusher/analysis_pusher.py rename to Examples/Tests/particle_pusher/analysis.py diff --git a/Examples/Tests/particle_pusher/inputs_3d b/Examples/Tests/particle_pusher/inputs_test_3d_particle_pusher similarity index 100% rename from Examples/Tests/particle_pusher/inputs_3d rename to Examples/Tests/particle_pusher/inputs_test_3d_particle_pusher diff --git a/Examples/Tests/particle_thermal_boundary/CMakeLists.txt b/Examples/Tests/particle_thermal_boundary/CMakeLists.txt new file mode 100644 index 00000000000..26478b59c07 --- /dev/null +++ b/Examples/Tests/particle_thermal_boundary/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_particle_thermal_boundary # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_particle_thermal_boundary # inputs + analysis.py # analysis + diags/diag1002000 # output + OFF # dependency +) diff --git a/Examples/Tests/particle_thermal_boundary/analysis_2d.py b/Examples/Tests/particle_thermal_boundary/analysis.py similarity index 100% rename from Examples/Tests/particle_thermal_boundary/analysis_2d.py rename to Examples/Tests/particle_thermal_boundary/analysis.py diff --git a/Examples/Tests/particle_thermal_boundary/inputs_2d b/Examples/Tests/particle_thermal_boundary/inputs_test_2d_particle_thermal_boundary similarity index 100% rename from Examples/Tests/particle_thermal_boundary/inputs_2d rename to Examples/Tests/particle_thermal_boundary/inputs_test_2d_particle_thermal_boundary diff --git a/Examples/Tests/particles_in_pml/CMakeLists.txt b/Examples/Tests/particles_in_pml/CMakeLists.txt new file mode 100644 index 00000000000..e8f1a13601d --- /dev/null +++ b/Examples/Tests/particles_in_pml/CMakeLists.txt @@ -0,0 +1,46 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_particles_in_pml # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_particles_in_pml # inputs + analysis_particles_in_pml.py # analysis + diags/diag1000180 # output + OFF # dependency +) + +add_warpx_test( + test_2d_particles_in_pml_mr # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_particles_in_pml_mr # inputs + analysis_particles_in_pml.py # analysis + diags/diag1000300 # output + OFF # dependency +) + +add_warpx_test( + test_3d_particles_in_pml # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_particles_in_pml # inputs + analysis_particles_in_pml.py # analysis + diags/diag1000120 # output + OFF # dependency +) + +add_warpx_test( + test_3d_particles_in_pml_mr # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_particles_in_pml_mr # inputs + analysis_particles_in_pml.py # analysis + diags/diag1000200 # output + OFF # dependency +) diff --git a/Examples/Tests/particles_in_pml/inputs_2d b/Examples/Tests/particles_in_pml/inputs_test_2d_particles_in_pml similarity index 100% rename from Examples/Tests/particles_in_pml/inputs_2d rename to Examples/Tests/particles_in_pml/inputs_test_2d_particles_in_pml diff --git a/Examples/Tests/particles_in_pml/inputs_mr_2d b/Examples/Tests/particles_in_pml/inputs_test_2d_particles_in_pml_mr similarity index 100% rename from Examples/Tests/particles_in_pml/inputs_mr_2d rename to Examples/Tests/particles_in_pml/inputs_test_2d_particles_in_pml_mr diff --git a/Examples/Tests/particles_in_pml/inputs_3d b/Examples/Tests/particles_in_pml/inputs_test_3d_particles_in_pml similarity index 100% rename from Examples/Tests/particles_in_pml/inputs_3d rename to Examples/Tests/particles_in_pml/inputs_test_3d_particles_in_pml diff --git a/Examples/Tests/particles_in_pml/inputs_mr_3d b/Examples/Tests/particles_in_pml/inputs_test_3d_particles_in_pml_mr similarity index 100% rename from Examples/Tests/particles_in_pml/inputs_mr_3d rename to Examples/Tests/particles_in_pml/inputs_test_3d_particles_in_pml_mr diff --git a/Examples/Tests/pass_mpi_communicator/CMakeLists.txt b/Examples/Tests/pass_mpi_communicator/CMakeLists.txt new file mode 100644 index 00000000000..f68986d363a --- /dev/null +++ b/Examples/Tests/pass_mpi_communicator/CMakeLists.txt @@ -0,0 +1,17 @@ +# Add tests (alphabetical order) ############################################## +# + +# TODO +# - Enable in pyAMReX (https://github.com/AMReX-Codes/pyamrex/issues/163) +# - Enable related lines in input script +# - Enable analysis script +add_warpx_test( + test_2d_pass_mpi_comm_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_pass_mpi_comm_picmi.py # inputs + OFF #analysis.py # analysis + OFF # output + OFF # dependency +) diff --git a/Examples/Tests/pass_mpi_communicator/PICMI_inputs_2d.py b/Examples/Tests/pass_mpi_communicator/inputs_test_2d_pass_mpi_comm_picmi.py similarity index 99% rename from Examples/Tests/pass_mpi_communicator/PICMI_inputs_2d.py rename to Examples/Tests/pass_mpi_communicator/inputs_test_2d_pass_mpi_comm_picmi.py index 55ebf64d8e6..200cea7be0f 100755 --- a/Examples/Tests/pass_mpi_communicator/PICMI_inputs_2d.py +++ b/Examples/Tests/pass_mpi_communicator/inputs_test_2d_pass_mpi_comm_picmi.py @@ -91,7 +91,6 @@ grid=grid, period=diagnostic_intervals, data_list=["Ex", "Jx"], - write_dir=".", warpx_file_prefix=f"Python_pass_mpi_comm_plt{color + 1}_", ) diff --git a/Examples/Tests/pec/CMakeLists.txt b/Examples/Tests/pec/CMakeLists.txt new file mode 100644 index 00000000000..69c68ec5329 --- /dev/null +++ b/Examples/Tests/pec/CMakeLists.txt @@ -0,0 +1,35 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_pec_field # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_pec_field # inputs + analysis_pec.py # analysis + diags/diag1000125 # output + OFF # dependency +) + +add_warpx_test( + test_3d_pec_field_mr # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_pec_field_mr # inputs + analysis_pec_mr.py # analysis + diags/diag1000125 # output + OFF # dependency +) + +add_warpx_test( + test_3d_pec_particle # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_pec_particle # inputs + analysis_default_regression.py # analysis + diags/diag1000020 # output + OFF # dependency +) diff --git a/Examples/Tests/pec/analysis_default_regression.py b/Examples/Tests/pec/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/pec/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/pec/inputs_field_PEC_3d b/Examples/Tests/pec/inputs_test_3d_pec_field similarity index 100% rename from Examples/Tests/pec/inputs_field_PEC_3d rename to Examples/Tests/pec/inputs_test_3d_pec_field diff --git a/Examples/Tests/pec/inputs_field_PEC_mr_3d b/Examples/Tests/pec/inputs_test_3d_pec_field_mr similarity index 100% rename from Examples/Tests/pec/inputs_field_PEC_mr_3d rename to Examples/Tests/pec/inputs_test_3d_pec_field_mr diff --git a/Examples/Tests/pec/inputs_particle_PEC_3d b/Examples/Tests/pec/inputs_test_3d_pec_particle similarity index 100% rename from Examples/Tests/pec/inputs_particle_PEC_3d rename to Examples/Tests/pec/inputs_test_3d_pec_particle diff --git a/Examples/Tests/photon_pusher/CMakeLists.txt b/Examples/Tests/photon_pusher/CMakeLists.txt new file mode 100644 index 00000000000..491906e0466 --- /dev/null +++ b/Examples/Tests/photon_pusher/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_photon_pusher # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_photon_pusher # inputs + analysis.py # analysis + diags/diag1000050 # output + OFF # dependency +) diff --git a/Examples/Tests/photon_pusher/analysis_photon_pusher.py b/Examples/Tests/photon_pusher/analysis.py similarity index 100% rename from Examples/Tests/photon_pusher/analysis_photon_pusher.py rename to Examples/Tests/photon_pusher/analysis.py diff --git a/Examples/Tests/photon_pusher/inputs_3d b/Examples/Tests/photon_pusher/inputs_test_3d_photon_pusher similarity index 100% rename from Examples/Tests/photon_pusher/inputs_3d rename to Examples/Tests/photon_pusher/inputs_test_3d_photon_pusher diff --git a/Examples/Tests/plasma_lens/CMakeLists.txt b/Examples/Tests/plasma_lens/CMakeLists.txt new file mode 100644 index 00000000000..cdba552db9e --- /dev/null +++ b/Examples/Tests/plasma_lens/CMakeLists.txt @@ -0,0 +1,57 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_plasma_lens # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_plasma_lens # inputs + analysis.py # analysis + diags/diag1000084 # output + OFF # dependency +) + +add_warpx_test( + test_3d_plasma_lens_boosted # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_plasma_lens_boosted # inputs + analysis.py # analysis + diags/diag1000084 # output + OFF # dependency +) + +add_warpx_test( + test_3d_plasma_lens_hard_edged # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_plasma_lens_hard_edged # inputs + analysis.py # analysis + diags/diag1000084 # output + OFF # dependency +) + +add_warpx_test( + test_3d_plasma_lens_picmi # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_plasma_lens_picmi.py # inputs + analysis.py # analysis + diags/diag1000084 # output + OFF # dependency +) + +add_warpx_test( + test_3d_plasma_lens_short # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_plasma_lens_short # inputs + analysis.py # analysis + diags/diag1000084 # output + OFF # dependency +) diff --git a/Examples/Tests/plasma_lens/analysis.py b/Examples/Tests/plasma_lens/analysis.py index 8cbbe86c927..11e2a084ac5 100755 --- a/Examples/Tests/plasma_lens/analysis.py +++ b/Examples/Tests/plasma_lens/analysis.py @@ -16,6 +16,7 @@ """ import os +import re import sys import numpy as np @@ -194,10 +195,8 @@ def applylens(x0, vx0, vz0, gamma, lens_length, lens_strength): "error in y particle velocity" ) +# The PICMI and native input versions run the same test, so +# their results are compared to the same benchmark file test_name = os.path.split(os.getcwd())[1] -# The PICMI and native input versions of `inputs_3d` run the same test, so -# their results are compared to the same benchmark file. -if test_name == "Python_plasma_lens": - test_name = "Plasma_lens" - +test_name = re.sub("_picmi", "", test_name) checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/plasma_lens/inputs_3d b/Examples/Tests/plasma_lens/inputs_test_3d_plasma_lens similarity index 100% rename from Examples/Tests/plasma_lens/inputs_3d rename to Examples/Tests/plasma_lens/inputs_test_3d_plasma_lens diff --git a/Examples/Tests/plasma_lens/inputs_boosted_3d b/Examples/Tests/plasma_lens/inputs_test_3d_plasma_lens_boosted similarity index 100% rename from Examples/Tests/plasma_lens/inputs_boosted_3d rename to Examples/Tests/plasma_lens/inputs_test_3d_plasma_lens_boosted diff --git a/Examples/Tests/plasma_lens/inputs_lattice_3d b/Examples/Tests/plasma_lens/inputs_test_3d_plasma_lens_hard_edged similarity index 100% rename from Examples/Tests/plasma_lens/inputs_lattice_3d rename to Examples/Tests/plasma_lens/inputs_test_3d_plasma_lens_hard_edged diff --git a/Examples/Tests/plasma_lens/PICMI_inputs_3d.py b/Examples/Tests/plasma_lens/inputs_test_3d_plasma_lens_picmi.py similarity index 94% rename from Examples/Tests/plasma_lens/PICMI_inputs_3d.py rename to Examples/Tests/plasma_lens/inputs_test_3d_plasma_lens_picmi.py index 32b2ab3abf7..b9672e17e1a 100644 --- a/Examples/Tests/plasma_lens/PICMI_inputs_3d.py +++ b/Examples/Tests/plasma_lens/inputs_test_3d_plasma_lens_picmi.py @@ -67,8 +67,6 @@ period=max_steps, species=[electrons], data_list=["ux", "uy", "uz", "x", "y", "z"], - write_dir=".", - warpx_file_prefix="Python_plasma_lens_plt", ) field_diag1 = picmi.FieldDiagnostic( @@ -76,8 +74,6 @@ grid=grid, period=max_steps, data_list=["Bx", "By", "Bz", "Ex", "Ey", "Ez", "Jx", "Jy", "Jz"], - write_dir=".", - warpx_file_prefix="Python_plasma_lens_plt", ) # Set up simulation sim = picmi.Simulation( diff --git a/Examples/Tests/plasma_lens/inputs_short_3d b/Examples/Tests/plasma_lens/inputs_test_3d_plasma_lens_short similarity index 100% rename from Examples/Tests/plasma_lens/inputs_short_3d rename to Examples/Tests/plasma_lens/inputs_test_3d_plasma_lens_short diff --git a/Examples/Tests/pml/CMakeLists.txt b/Examples/Tests/pml/CMakeLists.txt new file mode 100644 index 00000000000..92847dfff24 --- /dev/null +++ b/Examples/Tests/pml/CMakeLists.txt @@ -0,0 +1,100 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_pml_x_ckc # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_pml_x_ckc # inputs + analysis_pml_ckc.py # analysis + diags/diag1000300 # output + OFF # dependency +) + +if(WarpX_FFT) + add_warpx_test( + test_2d_pml_x_galilean # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_pml_x_galilean # inputs + analysis_pml_psatd.py # analysis + diags/diag1000300 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_pml_x_psatd # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_pml_x_psatd # inputs + analysis_pml_psatd.py # analysis + diags/diag1000300 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_2d_pml_x_psatd_restart # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_pml_x_psatd_restart # inputs + analysis_default_restart.py # analysis + diags/diag1000300 # output + test_2d_pml_x_psatd # dependency + ) +endif() + +add_warpx_test( + test_2d_pml_x_yee # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_pml_x_yee # inputs + analysis_pml_yee.py # analysis + diags/diag1000300 # output + OFF # dependency +) + +add_warpx_test( + test_2d_pml_x_yee_restart # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_pml_x_yee_restart # inputs + analysis_default_restart.py # analysis + diags/diag1000300 # output + test_2d_pml_x_yee # dependency +) + +if(WarpX_FFT) + add_warpx_test( + test_3d_pml_psatd_dive_divb_cleaning # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_pml_psatd_dive_divb_cleaning # inputs + analysis_default_regression.py # analysis + diags/diag1000100 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_rz_pml_psatd # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_pml_psatd # inputs + analysis_pml_psatd_rz.py # analysis + diags/diag1000500 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/pml/analysis_default_regression.py b/Examples/Tests/pml/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/pml/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/pml/analysis_default_restart.py b/Examples/Tests/pml/analysis_default_restart.py new file mode 120000 index 00000000000..0459986eebc --- /dev/null +++ b/Examples/Tests/pml/analysis_default_restart.py @@ -0,0 +1 @@ +../../analysis_default_restart.py \ No newline at end of file diff --git a/Examples/Tests/pml/analysis_pml_psatd.py b/Examples/Tests/pml/analysis_pml_psatd.py index de2f48810e4..00b867857f9 100755 --- a/Examples/Tests/pml/analysis_pml_psatd.py +++ b/Examples/Tests/pml/analysis_pml_psatd.py @@ -21,14 +21,14 @@ filename = sys.argv[1] -galilean = True if re.search("galilean", filename) else False +cwd = os.getcwd() +filename_init = os.path.join(cwd, "diags/diag1000050") +galilean = True if re.search("galilean", cwd) else False # Initial laser energy (at iteration 50) if galilean: - filename_init = "pml_x_galilean_plt000050" energy_start = 4.439376199524034e-08 else: - filename_init = "pml_x_psatd_plt000050" energy_start = 7.282940107273505e-08 # Check consistency of field energy diagnostics with initial energy above @@ -75,12 +75,5 @@ assert reflectivity < reflectivity_max -# Check restart data v. original data -sys.path.insert(0, "../../../../warpx/Examples/") -from analysis_default_restart import check_restart - -if not galilean: - check_restart(filename) - test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/pml/analysis_pml_yee.py b/Examples/Tests/pml/analysis_pml_yee.py index 962036bad0e..a24854af095 100755 --- a/Examples/Tests/pml/analysis_pml_yee.py +++ b/Examples/Tests/pml/analysis_pml_yee.py @@ -57,11 +57,5 @@ assert error_rel < tolerance_rel -# Check restart data v. original data -sys.path.insert(0, "../../../../warpx/Examples/") -from analysis_default_restart import check_restart - -check_restart(filename) - test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, filename) diff --git a/Examples/Tests/pml/inputs_2d b/Examples/Tests/pml/inputs_base_2d similarity index 100% rename from Examples/Tests/pml/inputs_2d rename to Examples/Tests/pml/inputs_base_2d diff --git a/Examples/Tests/pml/inputs_test_2d_pml_x_ckc b/Examples/Tests/pml/inputs_test_2d_pml_x_ckc new file mode 100644 index 00000000000..f686674ae14 --- /dev/null +++ b/Examples/Tests/pml/inputs_test_2d_pml_x_ckc @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.maxwell_solver = ckc diff --git a/Examples/Tests/pml/inputs_test_2d_pml_x_galilean b/Examples/Tests/pml/inputs_test_2d_pml_x_galilean new file mode 100644 index 00000000000..34a9081a181 --- /dev/null +++ b/Examples/Tests/pml/inputs_test_2d_pml_x_galilean @@ -0,0 +1,14 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.maxwell_solver = psatd +diag1.fields_to_plot = Ex Ey Ez Bx By Bz rho divE +psatd.current_correction = 0 +psatd.update_with_rho = 1 +psatd.v_galilean = 0. 0. 0.99 +warpx.abort_on_warning_threshold = medium +warpx.cfl = 0.7071067811865475 +warpx.do_pml_divb_cleaning = 1 +warpx.do_pml_dive_cleaning = 1 +warpx.grid_type = collocated diff --git a/Examples/Tests/pml/inputs_test_2d_pml_x_psatd b/Examples/Tests/pml/inputs_test_2d_pml_x_psatd new file mode 100644 index 00000000000..191d5774530 --- /dev/null +++ b/Examples/Tests/pml/inputs_test_2d_pml_x_psatd @@ -0,0 +1,12 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.maxwell_solver = psatd +diag1.fields_to_plot = Ex Ey Ez Bx By Bz rho divE +warpx.abort_on_warning_threshold = medium +warpx.cfl = 0.7071067811865475 +warpx.do_pml_divb_cleaning = 0 +warpx.do_pml_dive_cleaning = 0 +psatd.current_correction = 0 +psatd.update_with_rho = 1 diff --git a/Examples/Tests/pml/inputs_test_2d_pml_x_psatd_restart b/Examples/Tests/pml/inputs_test_2d_pml_x_psatd_restart new file mode 100644 index 00000000000..44b9be4494a --- /dev/null +++ b/Examples/Tests/pml/inputs_test_2d_pml_x_psatd_restart @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_test_2d_pml_x_psatd + +# test input parameters +amr.restart = "../test_2d_pml_x_psatd/diags/chk000150" diff --git a/Examples/Tests/pml/inputs_test_2d_pml_x_yee b/Examples/Tests/pml/inputs_test_2d_pml_x_yee new file mode 100644 index 00000000000..390cf079c16 --- /dev/null +++ b/Examples/Tests/pml/inputs_test_2d_pml_x_yee @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_base_2d + +# test input parameters +algo.maxwell_solver = yee diff --git a/Examples/Tests/pml/inputs_test_2d_pml_x_yee_restart b/Examples/Tests/pml/inputs_test_2d_pml_x_yee_restart new file mode 100644 index 00000000000..b626e3aa662 --- /dev/null +++ b/Examples/Tests/pml/inputs_test_2d_pml_x_yee_restart @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_test_2d_pml_x_yee + +# test input parameters +amr.restart = "../test_2d_pml_x_yee/diags/chk000150" diff --git a/Examples/Tests/pml/inputs_3d b/Examples/Tests/pml/inputs_test_3d_pml_psatd_dive_divb_cleaning similarity index 94% rename from Examples/Tests/pml/inputs_3d rename to Examples/Tests/pml/inputs_test_3d_pml_psatd_dive_divb_cleaning index e152afc7cc7..4e8c3c78329 100644 --- a/Examples/Tests/pml/inputs_3d +++ b/Examples/Tests/pml/inputs_test_3d_pml_psatd_dive_divb_cleaning @@ -14,12 +14,15 @@ boundary.field_lo = pml pml pml boundary.field_hi = pml pml pml # Numerical parameters +ablastr.fillboundary_always_sync = 1 +warpx.abort_on_warning_threshold = medium warpx.cfl = 1.0 warpx.grid_type = staggered warpx.do_dive_cleaning = 1 warpx.do_divb_cleaning = 1 warpx.do_pml_dive_cleaning = 1 warpx.do_pml_divb_cleaning = 1 +warpx.do_similar_dm_pml = 0 warpx.use_filter = 1 warpx.verbose = 1 diff --git a/Examples/Tests/pml/inputs_rz b/Examples/Tests/pml/inputs_test_rz_pml_psatd similarity index 93% rename from Examples/Tests/pml/inputs_rz rename to Examples/Tests/pml/inputs_test_rz_pml_psatd index f5e23fe0399..87b4d7a5b3f 100644 --- a/Examples/Tests/pml/inputs_rz +++ b/Examples/Tests/pml/inputs_test_rz_pml_psatd @@ -25,8 +25,11 @@ warpx.do_pml_in_domain = 0 ############ NUMERICS ########### ################################# algo.maxwell_solver = psatd +warpx.abort_on_warning_threshold = medium +warpx.cfl = 0.7 warpx.use_filter = 0 algo.particle_shape = 1 +psatd.current_correction = 0 ################################# ############ PARTICLE ########### diff --git a/Examples/Tests/point_of_contact_eb/CMakeLists.txt b/Examples/Tests/point_of_contact_eb/CMakeLists.txt new file mode 100644 index 00000000000..25bf4b977de --- /dev/null +++ b/Examples/Tests/point_of_contact_eb/CMakeLists.txt @@ -0,0 +1,28 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_3d_point_of_contact_eb # name + 3 # dims + 2 # nprocs + ON # eb + inputs_test_3d_point_of_contact_eb # inputs + analysis.py # analysis + diags/diag1/ # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_rz_point_of_contact_eb # name + RZ # dims + 2 # nprocs + ON # eb + inputs_test_rz_point_of_contact_eb # inputs + analysis.py # analysis + diags/diag1/ # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/point_of_contact_EB/analysis.py b/Examples/Tests/point_of_contact_eb/analysis.py similarity index 100% rename from Examples/Tests/point_of_contact_EB/analysis.py rename to Examples/Tests/point_of_contact_eb/analysis.py diff --git a/Examples/Tests/point_of_contact_EB/inputs_3d b/Examples/Tests/point_of_contact_eb/inputs_test_3d_point_of_contact_eb similarity index 100% rename from Examples/Tests/point_of_contact_EB/inputs_3d rename to Examples/Tests/point_of_contact_eb/inputs_test_3d_point_of_contact_eb diff --git a/Examples/Tests/point_of_contact_EB/inputs_rz b/Examples/Tests/point_of_contact_eb/inputs_test_rz_point_of_contact_eb similarity index 100% rename from Examples/Tests/point_of_contact_EB/inputs_rz rename to Examples/Tests/point_of_contact_eb/inputs_test_rz_point_of_contact_eb diff --git a/Examples/Tests/projection_divb_cleaner/CMakeLists.txt b/Examples/Tests/projection_divb_cleaner/CMakeLists.txt new file mode 100644 index 00000000000..91dd6bdc592 --- /dev/null +++ b/Examples/Tests/projection_divb_cleaner/CMakeLists.txt @@ -0,0 +1,35 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_projection_divb_cleaner_callback_picmi # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_projection_divb_cleaner_callback_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_3d_projection_divb_cleaner_picmi # name + 3 # dims + 1 # nprocs + OFF # eb + inputs_test_3d_projection_divb_cleaner_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_rz_projection_divb_cleaner # name + RZ # dims + 1 # nprocs + OFF # eb + inputs_test_rz_projection_divb_cleaner # inputs + analysis.py # analysis + diags/diag1000001 # output + OFF # dependency +) diff --git a/Examples/Tests/projection_divb_cleaner/analysis_rz.py b/Examples/Tests/projection_divb_cleaner/analysis.py similarity index 100% rename from Examples/Tests/projection_divb_cleaner/analysis_rz.py rename to Examples/Tests/projection_divb_cleaner/analysis.py diff --git a/Examples/Tests/projection_divb_cleaner/analysis_default_regression.py b/Examples/Tests/projection_divb_cleaner/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/projection_divb_cleaner/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/projection_divb_cleaner/PICMI_inputs_3D_pyload.py b/Examples/Tests/projection_divb_cleaner/inputs_test_3d_projection_divb_cleaner_callback_picmi.py similarity index 98% rename from Examples/Tests/projection_divb_cleaner/PICMI_inputs_3D_pyload.py rename to Examples/Tests/projection_divb_cleaner/inputs_test_3d_projection_divb_cleaner_callback_picmi.py index 2e8474af01d..e6eb7ecf904 100644 --- a/Examples/Tests/projection_divb_cleaner/PICMI_inputs_3D_pyload.py +++ b/Examples/Tests/projection_divb_cleaner/inputs_test_3d_projection_divb_cleaner_callback_picmi.py @@ -178,12 +178,10 @@ def __init__(self): ####################################################################### field_diag = picmi.FieldDiagnostic( - name="field_diag", + name="diag1", grid=self.grid, period=self.diag_steps, data_list=["B"], - write_dir=".", - warpx_file_prefix="Python_projection_divb_cleaner_callback_3d_plt", warpx_format="plotfile", ) simulation.add_diagnostic(field_diag) diff --git a/Examples/Tests/projection_divb_cleaner/PICMI_inputs_3d.py b/Examples/Tests/projection_divb_cleaner/inputs_test_3d_projection_divb_cleaner_picmi.py similarity index 95% rename from Examples/Tests/projection_divb_cleaner/PICMI_inputs_3d.py rename to Examples/Tests/projection_divb_cleaner/inputs_test_3d_projection_divb_cleaner_picmi.py index 8769a74dde3..f4347f30e56 100644 --- a/Examples/Tests/projection_divb_cleaner/PICMI_inputs_3d.py +++ b/Examples/Tests/projection_divb_cleaner/inputs_test_3d_projection_divb_cleaner_picmi.py @@ -69,8 +69,6 @@ grid=grid, period=1, data_list=["Bx", "By", "Bz"], - write_dir=".", - warpx_file_prefix="Python_projection_divb_cleaner_3d_plt", warpx_plot_raw_fields=True, warpx_plot_raw_fields_guards=True, ) @@ -107,7 +105,7 @@ ##### SIMULATION ANALYSIS ###### ################################# -filename = "Python_projection_divb_cleaner_3d_plt000001" +filename = "diags/diag1000001" ds = yt.load(filename) grid0 = ds.index.grids[0] diff --git a/Examples/Tests/projection_divb_cleaner/inputs_rz b/Examples/Tests/projection_divb_cleaner/inputs_test_rz_projection_divb_cleaner similarity index 96% rename from Examples/Tests/projection_divb_cleaner/inputs_rz rename to Examples/Tests/projection_divb_cleaner/inputs_test_rz_projection_divb_cleaner index 86e12cd39d1..3e8f69ee411 100644 --- a/Examples/Tests/projection_divb_cleaner/inputs_rz +++ b/Examples/Tests/projection_divb_cleaner/inputs_test_rz_projection_divb_cleaner @@ -45,7 +45,6 @@ diagnostics.diags_names = diag1 diag1.intervals = 1 diag1.diag_type = Full diag1.fields_to_plot = Br Bt Bz -diag1.file_prefix= projection_divb_cleaner_rz_plt diag1.plot_raw_fields = true diag1.plot_raw_fields_guards = true diag1.format = plotfile diff --git a/Examples/Tests/python_wrappers/CMakeLists.txt b/Examples/Tests/python_wrappers/CMakeLists.txt new file mode 100644 index 00000000000..83fc6e16f7d --- /dev/null +++ b/Examples/Tests/python_wrappers/CMakeLists.txt @@ -0,0 +1,15 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_FFT) + add_warpx_test( + test_2d_python_wrappers_picmi # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_python_wrappers_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000100 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/python_wrappers/analysis_default_regression.py b/Examples/Tests/python_wrappers/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/python_wrappers/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/python_wrappers/PICMI_inputs_2d.py b/Examples/Tests/python_wrappers/inputs_test_2d_python_wrappers_picmi.py similarity index 99% rename from Examples/Tests/python_wrappers/PICMI_inputs_2d.py rename to Examples/Tests/python_wrappers/inputs_test_2d_python_wrappers_picmi.py index c3aa9eac8b0..66917b4146b 100755 --- a/Examples/Tests/python_wrappers/PICMI_inputs_2d.py +++ b/Examples/Tests/python_wrappers/inputs_test_2d_python_wrappers_picmi.py @@ -71,16 +71,12 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=10, - write_dir=".", - warpx_file_prefix="Python_wrappers_plt", data_list=diag_field_list, ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=10, - write_dir=".", - warpx_file_prefix="Python_wrappers_plt", data_list=diag_field_list, ) diff --git a/Examples/Tests/qed/CMakeLists.txt b/Examples/Tests/qed/CMakeLists.txt new file mode 100644 index 00000000000..77690642f07 --- /dev/null +++ b/Examples/Tests/qed/CMakeLists.txt @@ -0,0 +1,112 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_qed_breit_wheeler # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_qed_breit_wheeler # inputs + analysis_breit_wheeler_yt.py # analysis + diags/diag1000002 # output + OFF # dependency +) + +add_warpx_test( + test_2d_qed_breit_wheeler_opmd # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_qed_breit_wheeler_opmd # inputs + analysis_breit_wheeler_opmd.py # analysis + diags/diag1/ # output + OFF # dependency +) + +add_warpx_test( + test_2d_qed_quantum_sync # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_qed_quantum_sync # inputs + analysis_quantum_sync.py # analysis + diags/diag1000002 # output + OFF # dependency +) + +add_warpx_test( + test_3d_qed_breit_wheeler # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_qed_breit_wheeler # inputs + analysis_breit_wheeler_yt.py # analysis + diags/diag1000002 # output + OFF # dependency +) + +add_warpx_test( + test_3d_qed_breit_wheeler_opmd # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_qed_breit_wheeler_opmd # inputs + analysis_breit_wheeler_opmd.py # analysis + diags/diag1/ # output + OFF # dependency +) + +add_warpx_test( + test_3d_qed_quantum_sync # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_qed_quantum_sync # inputs + analysis_quantum_sync.py # analysis + diags/diag1000002 # output + OFF # dependency +) + +add_warpx_test( + test_3d_qed_schwinger_1 # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_qed_schwinger_1 # inputs + analysis_schwinger.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_3d_qed_schwinger_2 # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_qed_schwinger_2 # inputs + analysis_schwinger.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_3d_qed_schwinger_3 # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_qed_schwinger_3 # inputs + analysis_schwinger.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_3d_qed_schwinger_4 # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_qed_schwinger_4 # inputs + analysis_schwinger.py # analysis + diags/diag1000001 # output + OFF # dependency +) diff --git a/Examples/Tests/qed/breit_wheeler/analysis_core.py b/Examples/Tests/qed/analysis_breit_wheeler_core.py similarity index 100% rename from Examples/Tests/qed/breit_wheeler/analysis_core.py rename to Examples/Tests/qed/analysis_breit_wheeler_core.py diff --git a/Examples/Tests/qed/breit_wheeler/analysis_opmd.py b/Examples/Tests/qed/analysis_breit_wheeler_opmd.py similarity index 95% rename from Examples/Tests/qed/breit_wheeler/analysis_opmd.py rename to Examples/Tests/qed/analysis_breit_wheeler_opmd.py index 21b1024a665..25547eda438 100755 --- a/Examples/Tests/qed/breit_wheeler/analysis_opmd.py +++ b/Examples/Tests/qed/analysis_breit_wheeler_opmd.py @@ -9,7 +9,7 @@ import sys -import analysis_core as ac +import analysis_breit_wheeler_core as ac import openpmd_api as io # sys.path.insert(1, '../../../../warpx/Regression/Checksum/') @@ -17,7 +17,7 @@ # This script is a frontend for the analysis routines -# in analysis_core.py (please refer to this file for +# in analysis_breit_wheeler_core.py (please refer to this file for # a full description). It reads output files in openPMD # format and extracts the data needed for # the analysis routines. diff --git a/Examples/Tests/qed/breit_wheeler/analysis_yt.py b/Examples/Tests/qed/analysis_breit_wheeler_yt.py similarity index 94% rename from Examples/Tests/qed/breit_wheeler/analysis_yt.py rename to Examples/Tests/qed/analysis_breit_wheeler_yt.py index dbba6bfb56a..9836e3e8894 100755 --- a/Examples/Tests/qed/breit_wheeler/analysis_yt.py +++ b/Examples/Tests/qed/analysis_breit_wheeler_yt.py @@ -13,11 +13,11 @@ import yt sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -import analysis_core as ac +import analysis_breit_wheeler_core as ac import checksumAPI # This script is a frontend for the analysis routines -# in analysis_core.py (please refer to this file for +# in analysis_breit_wheeler_core.py (please refer to this file for # a full description). It reads output files in yt # format and extracts the data needed for # the analysis routines. diff --git a/Examples/Tests/qed/quantum_synchrotron/analysis.py b/Examples/Tests/qed/analysis_quantum_sync.py similarity index 100% rename from Examples/Tests/qed/quantum_synchrotron/analysis.py rename to Examples/Tests/qed/analysis_quantum_sync.py diff --git a/Examples/Tests/qed/schwinger/analysis_schwinger.py b/Examples/Tests/qed/analysis_schwinger.py similarity index 97% rename from Examples/Tests/qed/schwinger/analysis_schwinger.py rename to Examples/Tests/qed/analysis_schwinger.py index 4b320cc267a..30a25e6a956 100755 --- a/Examples/Tests/qed/schwinger/analysis_schwinger.py +++ b/Examples/Tests/qed/analysis_schwinger.py @@ -41,7 +41,8 @@ Bz_test = 0.0 # Find which test we are doing -test_number = re.search("qed_schwinger([1234])", filename).group(1) +test_name = os.path.split(os.getcwd())[1] +test_number = re.search("qed_schwinger_([1234])", test_name).group(1) if test_number == "1": # First Schwinger test with "weak" EM field. No pair should be created. Ex_test = 1.0e16 diff --git a/Examples/Tests/qed/breit_wheeler/inputs_2d b/Examples/Tests/qed/inputs_base_2d_breit_wheeler similarity index 99% rename from Examples/Tests/qed/breit_wheeler/inputs_2d rename to Examples/Tests/qed/inputs_base_2d_breit_wheeler index 857b3243ac6..201520966c2 100644 --- a/Examples/Tests/qed/breit_wheeler/inputs_2d +++ b/Examples/Tests/qed/inputs_base_2d_breit_wheeler @@ -28,6 +28,7 @@ warpx.do_dive_cleaning = 0 warpx.use_filter = 1 warpx.cfl = 1. # if 1., the time step is set to its CFL limit warpx.serialize_initial_conditions = 1 +warpx.abort_on_warning_threshold = high # Order of particle shape factors algo.particle_shape = 3 diff --git a/Examples/Tests/qed/breit_wheeler/inputs_3d b/Examples/Tests/qed/inputs_base_3d_breit_wheeler similarity index 100% rename from Examples/Tests/qed/breit_wheeler/inputs_3d rename to Examples/Tests/qed/inputs_base_3d_breit_wheeler diff --git a/Examples/Tests/qed/schwinger/inputs_3d_schwinger b/Examples/Tests/qed/inputs_base_3d_schwinger similarity index 100% rename from Examples/Tests/qed/schwinger/inputs_3d_schwinger rename to Examples/Tests/qed/inputs_base_3d_schwinger diff --git a/Examples/Tests/qed/inputs_test_2d_qed_breit_wheeler b/Examples/Tests/qed/inputs_test_2d_qed_breit_wheeler new file mode 100644 index 00000000000..53d3cf9e97c --- /dev/null +++ b/Examples/Tests/qed/inputs_test_2d_qed_breit_wheeler @@ -0,0 +1,2 @@ +# base input parameters +FILE = inputs_base_2d_breit_wheeler diff --git a/Examples/Tests/qed/inputs_test_2d_qed_breit_wheeler_opmd b/Examples/Tests/qed/inputs_test_2d_qed_breit_wheeler_opmd new file mode 100644 index 00000000000..7edecbcd0a3 --- /dev/null +++ b/Examples/Tests/qed/inputs_test_2d_qed_breit_wheeler_opmd @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_2d_breit_wheeler + +# test input parameters +diag1.format = openpmd +diag1.openpmd_backend = h5 diff --git a/Examples/Tests/qed/quantum_synchrotron/inputs_2d b/Examples/Tests/qed/inputs_test_2d_qed_quantum_sync similarity index 99% rename from Examples/Tests/qed/quantum_synchrotron/inputs_2d rename to Examples/Tests/qed/inputs_test_2d_qed_quantum_sync index 2ac2c782ccd..83d0cee16aa 100644 --- a/Examples/Tests/qed/quantum_synchrotron/inputs_2d +++ b/Examples/Tests/qed/inputs_test_2d_qed_quantum_sync @@ -28,6 +28,7 @@ warpx.do_dive_cleaning = 0 warpx.use_filter = 1 warpx.cfl = 1. # if 1., the time step is set to its CFL limit warpx.serialize_initial_conditions = 1 +warpx.abort_on_warning_threshold = high # Order of particle shape factors algo.particle_shape = 3 diff --git a/Examples/Tests/qed/inputs_test_3d_qed_breit_wheeler b/Examples/Tests/qed/inputs_test_3d_qed_breit_wheeler new file mode 100644 index 00000000000..2058dccb493 --- /dev/null +++ b/Examples/Tests/qed/inputs_test_3d_qed_breit_wheeler @@ -0,0 +1,2 @@ +# base input parameters +FILE = inputs_base_3d_breit_wheeler diff --git a/Examples/Tests/qed/inputs_test_3d_qed_breit_wheeler_opmd b/Examples/Tests/qed/inputs_test_3d_qed_breit_wheeler_opmd new file mode 100644 index 00000000000..78847d0a0d4 --- /dev/null +++ b/Examples/Tests/qed/inputs_test_3d_qed_breit_wheeler_opmd @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_3d_breit_wheeler + +# test input parameters +diag1.format = openpmd +diag1.openpmd_backend = h5 diff --git a/Examples/Tests/qed/quantum_synchrotron/inputs_3d b/Examples/Tests/qed/inputs_test_3d_qed_quantum_sync similarity index 99% rename from Examples/Tests/qed/quantum_synchrotron/inputs_3d rename to Examples/Tests/qed/inputs_test_3d_qed_quantum_sync index 429666ef938..87ffd746ec8 100644 --- a/Examples/Tests/qed/quantum_synchrotron/inputs_3d +++ b/Examples/Tests/qed/inputs_test_3d_qed_quantum_sync @@ -28,6 +28,7 @@ warpx.do_dive_cleaning = 0 warpx.use_filter = 1 warpx.cfl = 1. # if 1., the time step is set to its CFL limit warpx.serialize_initial_conditions = 1 +warpx.abort_on_warning_threshold = high # Order of particle shape factors algo.particle_shape = 3 diff --git a/Examples/Tests/qed/inputs_test_3d_qed_schwinger_1 b/Examples/Tests/qed/inputs_test_3d_qed_schwinger_1 new file mode 100644 index 00000000000..cfa0ca80845 --- /dev/null +++ b/Examples/Tests/qed/inputs_test_3d_qed_schwinger_1 @@ -0,0 +1,6 @@ +# base input parameters +FILE = inputs_base_3d_schwinger + +# test input parameters +warpx.B_external_grid = 16792888.570516706 5256650.141557486 18363530.799561853 +warpx.E_external_grid = 1.e16 0 0 diff --git a/Examples/Tests/qed/inputs_test_3d_qed_schwinger_2 b/Examples/Tests/qed/inputs_test_3d_qed_schwinger_2 new file mode 100644 index 00000000000..420e6bce31f --- /dev/null +++ b/Examples/Tests/qed/inputs_test_3d_qed_schwinger_2 @@ -0,0 +1,8 @@ +# base input parameters +FILE = inputs_base_3d_schwinger + +# test input parameters +warpx.B_external_grid = 1679288857.0516706 525665014.1557486 1836353079.9561853 +warpx.E_external_grid = 1.e18 0 0 +qed_schwinger.xmin = -2.5e-7 +qed_schwinger.xmax = 2.49e-7 diff --git a/Examples/Tests/qed/inputs_test_3d_qed_schwinger_3 b/Examples/Tests/qed/inputs_test_3d_qed_schwinger_3 new file mode 100644 index 00000000000..e77ce567f32 --- /dev/null +++ b/Examples/Tests/qed/inputs_test_3d_qed_schwinger_3 @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_base_3d_schwinger + +# test input parameters +warpx.E_external_grid = 0 1.090934525450495e+17 0 diff --git a/Examples/Tests/qed/inputs_test_3d_qed_schwinger_4 b/Examples/Tests/qed/inputs_test_3d_qed_schwinger_4 new file mode 100644 index 00000000000..78454e8bb75 --- /dev/null +++ b/Examples/Tests/qed/inputs_test_3d_qed_schwinger_4 @@ -0,0 +1,8 @@ +# base input parameters +FILE = inputs_base_3d_schwinger + +# test input parameters +warpx.B_external_grid = 0 833910140000. 0 +warpx.E_external_grid = 0 0 2.5e+20 +qed_schwinger.ymin = -2.5e-7 +qed_schwinger.zmax = 2.49e-7 diff --git a/Examples/Tests/radiation_reaction/CMakeLists.txt b/Examples/Tests/radiation_reaction/CMakeLists.txt new file mode 100644 index 00000000000..63814f30f29 --- /dev/null +++ b/Examples/Tests/radiation_reaction/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_radiation_reaction # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_radiation_reaction # inputs + analysis.py # analysis + diags/diag1000064 # output + OFF # dependency +) diff --git a/Examples/Tests/radiation_reaction/test_const_B_analytical/analysis_classicalRR.py b/Examples/Tests/radiation_reaction/analysis.py similarity index 100% rename from Examples/Tests/radiation_reaction/test_const_B_analytical/analysis_classicalRR.py rename to Examples/Tests/radiation_reaction/analysis.py diff --git a/Examples/Tests/radiation_reaction/test_const_B_analytical/inputs_3d b/Examples/Tests/radiation_reaction/inputs_test_3d_radiation_reaction similarity index 100% rename from Examples/Tests/radiation_reaction/test_const_B_analytical/inputs_3d rename to Examples/Tests/radiation_reaction/inputs_test_3d_radiation_reaction diff --git a/Examples/Tests/reduced_diags/CMakeLists.txt b/Examples/Tests/reduced_diags/CMakeLists.txt new file mode 100644 index 00000000000..a09d5403270 --- /dev/null +++ b/Examples/Tests/reduced_diags/CMakeLists.txt @@ -0,0 +1,59 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_reduced_diags # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_reduced_diags # inputs + analysis_reduced_diags.py # analysis + diags/diag1000200 # output + OFF # dependency +) + +add_warpx_test( + test_3d_reduced_diags_load_balance_costs_heuristic # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_reduced_diags_load_balance_costs_heuristic # inputs + analysis_reduced_diags_load_balance_costs.py # analysis + diags/diag1000003 # output + OFF # dependency +) + +add_warpx_test( + test_3d_reduced_diags_load_balance_costs_timers # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_reduced_diags_load_balance_costs_timers # inputs + analysis_reduced_diags_load_balance_costs.py # analysis + diags/diag1000003 # output + OFF # dependency +) + +add_warpx_test( + test_3d_reduced_diags_load_balance_costs_timers_picmi # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_reduced_diags_load_balance_costs_timers_picmi.py # inputs + analysis_reduced_diags_load_balance_costs.py # analysis + diags/diag1000003 # output + OFF # dependency +) + +if(WarpX_FFT) + add_warpx_test( + test_3d_reduced_diags_load_balance_costs_timers_psatd # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_reduced_diags_load_balance_costs_timers_psatd # inputs + analysis_reduced_diags_load_balance_costs.py # analysis + diags/diag1000003 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/reduced_diags/analysis_reduced_diags_loadbalancecosts.py b/Examples/Tests/reduced_diags/analysis_reduced_diags_load_balance_costs.py similarity index 92% rename from Examples/Tests/reduced_diags/analysis_reduced_diags_loadbalancecosts.py rename to Examples/Tests/reduced_diags/analysis_reduced_diags_load_balance_costs.py index 0494b84b0d8..05f696e2fe6 100755 --- a/Examples/Tests/reduced_diags/analysis_reduced_diags_loadbalancecosts.py +++ b/Examples/Tests/reduced_diags/analysis_reduced_diags_load_balance_costs.py @@ -17,6 +17,8 @@ # Possible running time: ~ 1 s +import os +import re import sys import numpy as np @@ -75,5 +77,8 @@ def get_efficiency(i): # than non-load balanced case assert efficiency_before < efficiency_after -test_name = "reduced_diags_loadbalancecosts_timers" +# The PICMI and native input versions run the same test, so +# their results are compared to the same benchmark file +test_name = os.path.split(os.getcwd())[1] +test_name = re.sub("_picmi", "", test_name) checksumAPI.evaluate_checksum(test_name, fn) diff --git a/Examples/Tests/reduced_diags/inputs_loadbalancecosts b/Examples/Tests/reduced_diags/inputs_base_3d similarity index 100% rename from Examples/Tests/reduced_diags/inputs_loadbalancecosts rename to Examples/Tests/reduced_diags/inputs_base_3d diff --git a/Examples/Tests/reduced_diags/inputs b/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags similarity index 100% rename from Examples/Tests/reduced_diags/inputs rename to Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags diff --git a/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_heuristic b/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_heuristic new file mode 100644 index 00000000000..18777d5a1fa --- /dev/null +++ b/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_heuristic @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.load_balance_costs_update = Heuristic diff --git a/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_timers b/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_timers new file mode 100644 index 00000000000..7d8586cd913 --- /dev/null +++ b/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_timers @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.load_balance_costs_update = Timers diff --git a/Examples/Tests/reduced_diags/PICMI_inputs_loadbalancecosts.py b/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_timers_picmi.py similarity index 93% rename from Examples/Tests/reduced_diags/PICMI_inputs_loadbalancecosts.py rename to Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_timers_picmi.py index 73050b910d8..d1dc6935bb7 100644 --- a/Examples/Tests/reduced_diags/PICMI_inputs_loadbalancecosts.py +++ b/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_timers_picmi.py @@ -77,16 +77,12 @@ period=3, species=[electrons], data_list=["ux", "uy", "uz", "x", "y", "z", "weighting"], - write_dir=".", - warpx_file_prefix="Python_reduced_diags_loadbalancecosts_timers_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=3, data_list=["Bx", "By", "Bz", "Ex", "Ey", "Ez", "Jx", "Jy", "Jz"], - write_dir=".", - warpx_file_prefix="Python_reduced_diags_loadbalancecosts_timers_plt", ) # Set up simulation @@ -98,6 +94,7 @@ warpx_current_deposition_algo="esirkepov", warpx_field_gathering_algo="energy-conserving", warpx_load_balance_intervals=2, + warpx_load_balance_costs_update="timers", ) # Add species diff --git a/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_timers_psatd b/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_timers_psatd new file mode 100644 index 00000000000..7d8586cd913 --- /dev/null +++ b/Examples/Tests/reduced_diags/inputs_test_3d_reduced_diags_load_balance_costs_timers_psatd @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.load_balance_costs_update = Timers diff --git a/Examples/Tests/relativistic_space_charge_initialization/CMakeLists.txt b/Examples/Tests/relativistic_space_charge_initialization/CMakeLists.txt new file mode 100644 index 00000000000..9ee2a63d2d2 --- /dev/null +++ b/Examples/Tests/relativistic_space_charge_initialization/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_3d_relativistic_space_charge_initialization # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_relativistic_space_charge_initialization # inputs + analysis.py # analysis + diags/diag1000001 # output + OFF # dependency +) diff --git a/Examples/Tests/relativistic_space_charge_initialization/inputs_3d b/Examples/Tests/relativistic_space_charge_initialization/inputs_test_3d_relativistic_space_charge_initialization similarity index 100% rename from Examples/Tests/relativistic_space_charge_initialization/inputs_3d rename to Examples/Tests/relativistic_space_charge_initialization/inputs_test_3d_relativistic_space_charge_initialization diff --git a/Examples/Tests/repelling_particles/CMakeLists.txt b/Examples/Tests/repelling_particles/CMakeLists.txt new file mode 100644 index 00000000000..ed662b67332 --- /dev/null +++ b/Examples/Tests/repelling_particles/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_repelling_particles # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_repelling_particles # inputs + analysis.py # analysis + diags/diag1000200 # output + OFF # dependency +) diff --git a/Examples/Tests/repelling_particles/analysis_repelling.py b/Examples/Tests/repelling_particles/analysis.py similarity index 100% rename from Examples/Tests/repelling_particles/analysis_repelling.py rename to Examples/Tests/repelling_particles/analysis.py diff --git a/Examples/Tests/repelling_particles/inputs_2d b/Examples/Tests/repelling_particles/inputs_test_2d_repelling_particles similarity index 100% rename from Examples/Tests/repelling_particles/inputs_2d rename to Examples/Tests/repelling_particles/inputs_test_2d_repelling_particles diff --git a/Examples/Tests/resampling/CMakeLists.txt b/Examples/Tests/resampling/CMakeLists.txt new file mode 100644 index 00000000000..10d51e0ea47 --- /dev/null +++ b/Examples/Tests/resampling/CMakeLists.txt @@ -0,0 +1,35 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_resample_velocity_coincidence_thinning # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_resample_velocity_coincidence_thinning # inputs + analysis_default_regression.py # analysis + diags/diag1000004 # output + OFF # dependency +) + +add_warpx_test( + test_1d_resample_velocity_coincidence_thinning_cartesian # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_resample_velocity_coincidence_thinning_cartesian # inputs + analysis_default_regression.py # analysis + diags/diag1000004 # output + OFF # dependency +) + +add_warpx_test( + test_2d_leveling_thinning # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_leveling_thinning # inputs + analysis.py # analysis + diags/diag1000008 # output + OFF # dependency +) diff --git a/Examples/Tests/resampling/analysis_leveling_thinning.py b/Examples/Tests/resampling/analysis.py similarity index 100% rename from Examples/Tests/resampling/analysis_leveling_thinning.py rename to Examples/Tests/resampling/analysis.py diff --git a/Examples/Tests/resampling/analysis_default_regression.py b/Examples/Tests/resampling/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/resampling/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/resampling/inputs_1d_velocity_coincidence_thinning b/Examples/Tests/resampling/inputs_test_1d_resample_velocity_coincidence_thinning similarity index 100% rename from Examples/Tests/resampling/inputs_1d_velocity_coincidence_thinning rename to Examples/Tests/resampling/inputs_test_1d_resample_velocity_coincidence_thinning diff --git a/Examples/Tests/resampling/inputs_1d_velocity_coincidence_thinning_cartesian b/Examples/Tests/resampling/inputs_test_1d_resample_velocity_coincidence_thinning_cartesian similarity index 100% rename from Examples/Tests/resampling/inputs_1d_velocity_coincidence_thinning_cartesian rename to Examples/Tests/resampling/inputs_test_1d_resample_velocity_coincidence_thinning_cartesian diff --git a/Examples/Tests/resampling/inputs_leveling_thinning b/Examples/Tests/resampling/inputs_test_2d_leveling_thinning similarity index 100% rename from Examples/Tests/resampling/inputs_leveling_thinning rename to Examples/Tests/resampling/inputs_test_2d_leveling_thinning diff --git a/Examples/Tests/restart/CMakeLists.txt b/Examples/Tests/restart/CMakeLists.txt new file mode 100644 index 00000000000..33770495dc6 --- /dev/null +++ b/Examples/Tests/restart/CMakeLists.txt @@ -0,0 +1,115 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_id_cpu_read_picmi # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_id_cpu_read_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency +) + +# TODO +# - Add checksums file +# - Enable analysis +add_warpx_test( + test_2d_runtime_components_picmi # name + 2 # dims + 1 # nprocs + OFF # eb + inputs_test_2d_runtime_components_picmi.py # inputs + OFF #analysis_default_regression.py # analysis + OFF #diags/diag1000010 # output + OFF # dependency +) + +# TODO +# - Add checksums file +# - Enable analysis +add_warpx_test( + test_2d_runtime_components_picmi_restart # name + 2 # dims + 1 # nprocs + OFF # eb + "inputs_test_2d_runtime_components_picmi.py amr.restart='../test_2d_runtime_components_picmi/diags/chk000005'" # inputs + OFF #analysis_default_restart.py # analysis + OFF #diags/diag1000010 # output + test_2d_runtime_components_picmi # dependency +) + +add_warpx_test( + test_3d_acceleration # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_acceleration # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency +) + +add_warpx_test( + test_3d_acceleration_restart # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_acceleration_restart # inputs + analysis_default_restart.py # analysis + diags/diag1000010 # output + test_3d_acceleration # dependency +) + +if(WarpX_FFT) + add_warpx_test( + test_3d_acceleration_psatd # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_acceleration_psatd # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_acceleration_psatd_restart # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_acceleration_psatd_restart # inputs + analysis_default_restart.py # analysis + diags/diag1000010 # output + test_3d_acceleration_psatd # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_acceleration_psatd_time_avg # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_acceleration_psatd_time_avg # inputs + analysis_default_regression.py # analysis + diags/diag1000010 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_acceleration_psatd_time_avg_restart # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_acceleration_psatd_time_avg_restart # inputs + analysis_default_restart.py # analysis + diags/diag1000010 # output + test_3d_acceleration_psatd_time_avg # dependency + ) +endif() diff --git a/Examples/Tests/restart/analysis_default_regression.py b/Examples/Tests/restart/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/restart/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/restart/analysis_default_restart.py b/Examples/Tests/restart/analysis_default_restart.py new file mode 120000 index 00000000000..0459986eebc --- /dev/null +++ b/Examples/Tests/restart/analysis_default_restart.py @@ -0,0 +1 @@ +../../analysis_default_restart.py \ No newline at end of file diff --git a/Examples/Tests/restart/inputs b/Examples/Tests/restart/inputs_base_3d similarity index 99% rename from Examples/Tests/restart/inputs rename to Examples/Tests/restart/inputs_base_3d index f6aef120466..6724bae64b3 100644 --- a/Examples/Tests/restart/inputs +++ b/Examples/Tests/restart/inputs_base_3d @@ -1,7 +1,6 @@ ################################# ####### GENERAL PARAMETERS ###### ################################# -#amr.restart = diags/chk00005/ max_step = 10 amr.n_cell = 32 32 256 amr.max_grid_size = 64 diff --git a/Examples/Tests/restart/PICMI_inputs_id_cpu_read.py b/Examples/Tests/restart/inputs_test_2d_id_cpu_read_picmi.py similarity index 95% rename from Examples/Tests/restart/PICMI_inputs_id_cpu_read.py rename to Examples/Tests/restart/inputs_test_2d_id_cpu_read_picmi.py index 8c2be7b8750..be6e621653f 100755 --- a/Examples/Tests/restart/PICMI_inputs_id_cpu_read.py +++ b/Examples/Tests/restart/inputs_test_2d_id_cpu_read_picmi.py @@ -65,16 +65,12 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=10, - write_dir=".", - warpx_file_prefix="Python_restart_runtime_components_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=10, data_list=["phi"], - write_dir=".", - warpx_file_prefix="Python_restart_runtime_components_plt", ) checkpoint = picmi.Checkpoint( diff --git a/Examples/Tests/restart/PICMI_inputs_runtime_component_analyze.py b/Examples/Tests/restart/inputs_test_2d_runtime_components_picmi.py similarity index 91% rename from Examples/Tests/restart/PICMI_inputs_runtime_component_analyze.py rename to Examples/Tests/restart/inputs_test_2d_runtime_components_picmi.py index 3061a3c1ff6..e90bfd266a7 100755 --- a/Examples/Tests/restart/PICMI_inputs_runtime_component_analyze.py +++ b/Examples/Tests/restart/inputs_test_2d_runtime_components_picmi.py @@ -66,25 +66,15 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=10, - write_dir=".", - warpx_file_prefix="Python_restart_runtime_components_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=10, data_list=["phi"], - write_dir=".", - warpx_file_prefix="Python_restart_runtime_components_plt", ) -checkpoint = picmi.Checkpoint( - name="chkpoint", - period=5, - write_dir=".", - warpx_file_min_digits=5, - warpx_file_prefix="Python_restart_runtime_components_chk", -) +checkpoint = picmi.Checkpoint(name="chk", period=5) ########################## # simulation setup diff --git a/Examples/Tests/restart/inputs_test_3d_acceleration b/Examples/Tests/restart/inputs_test_3d_acceleration new file mode 100644 index 00000000000..7665a846eef --- /dev/null +++ b/Examples/Tests/restart/inputs_test_3d_acceleration @@ -0,0 +1,2 @@ +# base input parameters +FILE = inputs_base_3d diff --git a/Examples/Tests/restart/inputs_test_3d_acceleration_psatd b/Examples/Tests/restart/inputs_test_3d_acceleration_psatd new file mode 100644 index 00000000000..1f4e258b964 --- /dev/null +++ b/Examples/Tests/restart/inputs_test_3d_acceleration_psatd @@ -0,0 +1,11 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.maxwell_solver = psatd +boundary.field_hi = periodic periodic damped +boundary.field_lo = periodic periodic damped +particles.use_fdtd_nci_corr = 0 +psatd.current_correction = 0 +psatd.use_default_v_galilean = 1 +warpx.abort_on_warning_threshold = medium diff --git a/Examples/Tests/restart/inputs_test_3d_acceleration_psatd_restart b/Examples/Tests/restart/inputs_test_3d_acceleration_psatd_restart new file mode 100644 index 00000000000..ac2a354dcb9 --- /dev/null +++ b/Examples/Tests/restart/inputs_test_3d_acceleration_psatd_restart @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_test_3d_acceleration_psatd + +# test input parameters +amr.restart = "../test_3d_acceleration_psatd/diags/chk000005" diff --git a/Examples/Tests/restart/inputs_test_3d_acceleration_psatd_time_avg b/Examples/Tests/restart/inputs_test_3d_acceleration_psatd_time_avg new file mode 100644 index 00000000000..d9625a7f058 --- /dev/null +++ b/Examples/Tests/restart/inputs_test_3d_acceleration_psatd_time_avg @@ -0,0 +1,12 @@ +# base input parameters +FILE = inputs_base_3d + +# test input parameters +algo.maxwell_solver = psatd +boundary.field_hi = periodic periodic damped +boundary.field_lo = periodic periodic damped +particles.use_fdtd_nci_corr = 0 +psatd.current_correction = 0 +psatd.do_time_averaging = 1 +psatd.use_default_v_galilean = 1 +warpx.abort_on_warning_threshold = medium diff --git a/Examples/Tests/restart/inputs_test_3d_acceleration_psatd_time_avg_restart b/Examples/Tests/restart/inputs_test_3d_acceleration_psatd_time_avg_restart new file mode 100644 index 00000000000..44956c2259b --- /dev/null +++ b/Examples/Tests/restart/inputs_test_3d_acceleration_psatd_time_avg_restart @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_test_3d_acceleration_psatd_time_avg + +# test input parameters +amr.restart = "../test_3d_acceleration_psatd_time_avg/diags/chk000005" diff --git a/Examples/Tests/restart/inputs_test_3d_acceleration_restart b/Examples/Tests/restart/inputs_test_3d_acceleration_restart new file mode 100644 index 00000000000..320224f6c16 --- /dev/null +++ b/Examples/Tests/restart/inputs_test_3d_acceleration_restart @@ -0,0 +1,5 @@ +# base input parameters +FILE = inputs_test_3d_acceleration + +# test input parameters +amr.restart = "../test_3d_acceleration/diags/chk000005" diff --git a/Examples/Tests/restart_eb/CMakeLists.txt b/Examples/Tests/restart_eb/CMakeLists.txt new file mode 100644 index 00000000000..54d1d3ea574 --- /dev/null +++ b/Examples/Tests/restart_eb/CMakeLists.txt @@ -0,0 +1,29 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_3d_eb_picmi # name + 3 # dims + 1 # nprocs + ON # eb + inputs_test_3d_eb_picmi.py # inputs + analysis_default_regression.py # analysis + diags/diag1000060 # output + OFF # dependency + ) +endif() + +# FIXME +#if(WarpX_EB) +# add_warpx_test( +# test_3d_eb_picmi_restart # name +# 3 # dims +# 1 # nprocs +# ON # eb +# "inputs_test_3d_eb_picmi.py amr.restart='../test_3d_eb_picmi/diags/chk000030'" # inputs +# analysis_default_restart.py # analysis +# diags/diag1000060 # output +# test_3d_eb_picmi # dependency +# ) +#endif() diff --git a/Examples/Tests/restart_eb/analysis_default_regression.py b/Examples/Tests/restart_eb/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/restart_eb/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/restart_eb/analysis_default_restart.py b/Examples/Tests/restart_eb/analysis_default_restart.py new file mode 120000 index 00000000000..0459986eebc --- /dev/null +++ b/Examples/Tests/restart_eb/analysis_default_restart.py @@ -0,0 +1 @@ +../../analysis_default_restart.py \ No newline at end of file diff --git a/Examples/Tests/restart_eb/PICMI_inputs_restart_eb.py b/Examples/Tests/restart_eb/inputs_test_3d_eb_picmi.py similarity index 92% rename from Examples/Tests/restart_eb/PICMI_inputs_restart_eb.py rename to Examples/Tests/restart_eb/inputs_test_3d_eb_picmi.py index 0cfd0bcff5f..0f701ba999b 100755 --- a/Examples/Tests/restart_eb/PICMI_inputs_restart_eb.py +++ b/Examples/Tests/restart_eb/inputs_test_3d_eb_picmi.py @@ -80,24 +80,17 @@ particle_diag = picmi.ParticleDiagnostic( name="diag1", period=diagnostic_intervals, - write_dir=".", - warpx_file_prefix="Python_restart_eb_plt", ) field_diag = picmi.FieldDiagnostic( name="diag1", grid=grid, period=diagnostic_intervals, data_list=["Ex", "Ey", "Ez", "Bx", "By", "Bz"], - write_dir=".", - warpx_file_prefix="Python_restart_eb_plt", ) checkpoint = picmi.Checkpoint( - name="chkpoint", + name="chk", period=diagnostic_intervals, - write_dir=".", - warpx_file_min_digits=5, - warpx_file_prefix="Python_restart_eb_chk", ) ########################## diff --git a/Examples/Tests/rigid_injection/CMakeLists.txt b/Examples/Tests/rigid_injection/CMakeLists.txt new file mode 100644 index 00000000000..210cc86418f --- /dev/null +++ b/Examples/Tests/rigid_injection/CMakeLists.txt @@ -0,0 +1,24 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_rigid_injection_btd # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_rigid_injection_btd # inputs + analysis_rigid_injection_btd.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_2d_rigid_injection_lab # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_rigid_injection_lab # inputs + analysis_rigid_injection_lab.py # analysis + diags/diag1000289 # output + OFF # dependency +) diff --git a/Examples/Tests/rigid_injection/analysis_rigid_injection_BoostedFrame.py b/Examples/Tests/rigid_injection/analysis_rigid_injection_btd.py similarity index 100% rename from Examples/Tests/rigid_injection/analysis_rigid_injection_BoostedFrame.py rename to Examples/Tests/rigid_injection/analysis_rigid_injection_btd.py diff --git a/Examples/Tests/rigid_injection/analysis_rigid_injection_LabFrame.py b/Examples/Tests/rigid_injection/analysis_rigid_injection_lab.py similarity index 100% rename from Examples/Tests/rigid_injection/analysis_rigid_injection_LabFrame.py rename to Examples/Tests/rigid_injection/analysis_rigid_injection_lab.py diff --git a/Examples/Tests/rigid_injection/inputs_2d_BoostedFrame b/Examples/Tests/rigid_injection/inputs_test_2d_rigid_injection_btd similarity index 100% rename from Examples/Tests/rigid_injection/inputs_2d_BoostedFrame rename to Examples/Tests/rigid_injection/inputs_test_2d_rigid_injection_btd diff --git a/Examples/Tests/rigid_injection/inputs_2d_LabFrame b/Examples/Tests/rigid_injection/inputs_test_2d_rigid_injection_lab similarity index 100% rename from Examples/Tests/rigid_injection/inputs_2d_LabFrame rename to Examples/Tests/rigid_injection/inputs_test_2d_rigid_injection_lab diff --git a/Examples/Tests/scraping/CMakeLists.txt b/Examples/Tests/scraping/CMakeLists.txt new file mode 100644 index 00000000000..94ec04e35d7 --- /dev/null +++ b/Examples/Tests/scraping/CMakeLists.txt @@ -0,0 +1,28 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_EB) + add_warpx_test( + test_rz_scraping # name + RZ # dims + 2 # nprocs + ON # eb + inputs_test_rz_scraping # inputs + analysis_rz.py # analysis + diags/diag1000037 # output + OFF # dependency + ) +endif() + +if(WarpX_EB) + add_warpx_test( + test_rz_scraping_filter # name + RZ # dims + 2 # nprocs + ON # eb + inputs_test_rz_scraping_filter # inputs + analysis_rz_filter.py # analysis + diags/diag1000037 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/scraping/inputs_rz b/Examples/Tests/scraping/inputs_test_rz_scraping similarity index 97% rename from Examples/Tests/scraping/inputs_rz rename to Examples/Tests/scraping/inputs_test_rz_scraping index 0dab9ebedd2..b332de2229a 100644 --- a/Examples/Tests/scraping/inputs_rz +++ b/Examples/Tests/scraping/inputs_test_rz_scraping @@ -21,6 +21,7 @@ boundary.potential_hi_y = 0 boundary.potential_lo_z = 0 boundary.potential_hi_z = 0 +warpx.abort_on_warning_threshold = medium warpx.const_dt = 1.216119097e-11 warpx.eb_implicit_function = "-(x**2-0.1**2)" diff --git a/Examples/Tests/scraping/inputs_rz_filter b/Examples/Tests/scraping/inputs_test_rz_scraping_filter similarity index 97% rename from Examples/Tests/scraping/inputs_rz_filter rename to Examples/Tests/scraping/inputs_test_rz_scraping_filter index 0d67fb96f6c..3a3ab78a226 100644 --- a/Examples/Tests/scraping/inputs_rz_filter +++ b/Examples/Tests/scraping/inputs_test_rz_scraping_filter @@ -21,6 +21,7 @@ boundary.potential_hi_y = 0 boundary.potential_lo_z = 0 boundary.potential_hi_z = 0 +warpx.abort_on_warning_threshold = medium warpx.const_dt = 1.216119097e-11 warpx.eb_implicit_function = "-(x**2-0.1**2)" diff --git a/Examples/Tests/silver_mueller/CMakeLists.txt b/Examples/Tests/silver_mueller/CMakeLists.txt new file mode 100644 index 00000000000..5b9cd278ef0 --- /dev/null +++ b/Examples/Tests/silver_mueller/CMakeLists.txt @@ -0,0 +1,46 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_1d_silver_mueller # name + 1 # dims + 2 # nprocs + OFF # eb + inputs_test_1d_silver_mueller # inputs + analysis.py # analysis + diags/diag1000500 # output + OFF # dependency +) + +add_warpx_test( + test_2d_silver_mueller_x # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_silver_mueller_x # inputs + analysis.py # analysis + diags/diag1000500 # output + OFF # dependency +) + +add_warpx_test( + test_2d_silver_mueller_z # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_silver_mueller_z # inputs + analysis.py # analysis + diags/diag1000500 # output + OFF # dependency +) + +add_warpx_test( + test_rz_silver_mueller_z # name + RZ # dims + 2 # nprocs + OFF # eb + inputs_test_rz_silver_mueller_z # inputs + analysis.py # analysis + diags/diag1000500 # output + OFF # dependency +) diff --git a/Examples/Tests/silver_mueller/analysis_silver_mueller.py b/Examples/Tests/silver_mueller/analysis.py similarity index 100% rename from Examples/Tests/silver_mueller/analysis_silver_mueller.py rename to Examples/Tests/silver_mueller/analysis.py diff --git a/Examples/Tests/silver_mueller/inputs_1d b/Examples/Tests/silver_mueller/inputs_test_1d_silver_mueller similarity index 100% rename from Examples/Tests/silver_mueller/inputs_1d rename to Examples/Tests/silver_mueller/inputs_test_1d_silver_mueller diff --git a/Examples/Tests/silver_mueller/inputs_2d_x b/Examples/Tests/silver_mueller/inputs_test_2d_silver_mueller_x similarity index 100% rename from Examples/Tests/silver_mueller/inputs_2d_x rename to Examples/Tests/silver_mueller/inputs_test_2d_silver_mueller_x diff --git a/Examples/Tests/silver_mueller/inputs_2d_z b/Examples/Tests/silver_mueller/inputs_test_2d_silver_mueller_z similarity index 100% rename from Examples/Tests/silver_mueller/inputs_2d_z rename to Examples/Tests/silver_mueller/inputs_test_2d_silver_mueller_z diff --git a/Examples/Tests/silver_mueller/inputs_rz_z b/Examples/Tests/silver_mueller/inputs_test_rz_silver_mueller_z similarity index 100% rename from Examples/Tests/silver_mueller/inputs_rz_z rename to Examples/Tests/silver_mueller/inputs_test_rz_silver_mueller_z diff --git a/Examples/Tests/single_particle/CMakeLists.txt b/Examples/Tests/single_particle/CMakeLists.txt new file mode 100644 index 00000000000..b2719bee681 --- /dev/null +++ b/Examples/Tests/single_particle/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_bilinear_filter # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_bilinear_filter # inputs + analysis.py # analysis + diags/diag1000001 # output + OFF # dependency +) diff --git a/Examples/Tests/single_particle/analysis_bilinear_filter.py b/Examples/Tests/single_particle/analysis.py similarity index 100% rename from Examples/Tests/single_particle/analysis_bilinear_filter.py rename to Examples/Tests/single_particle/analysis.py diff --git a/Examples/Tests/single_particle/inputs_2d b/Examples/Tests/single_particle/inputs_test_2d_bilinear_filter similarity index 93% rename from Examples/Tests/single_particle/inputs_2d rename to Examples/Tests/single_particle/inputs_test_2d_bilinear_filter index 71ca2101c22..6f8eb6fdcea 100644 --- a/Examples/Tests/single_particle/inputs_2d +++ b/Examples/Tests/single_particle/inputs_test_2d_bilinear_filter @@ -14,6 +14,8 @@ boundary.field_hi = pec pec algo.charge_deposition = standard algo.field_gathering = energy-conserving warpx.cfl = 1.0 +warpx.use_filter = 1 +warpx.filter_npass_each_dir = 1 5 # Order of particle shape factors algo.particle_shape = 1 diff --git a/Examples/Tests/space_charge_initialization/CMakeLists.txt b/Examples/Tests/space_charge_initialization/CMakeLists.txt new file mode 100644 index 00000000000..af07d677775 --- /dev/null +++ b/Examples/Tests/space_charge_initialization/CMakeLists.txt @@ -0,0 +1,24 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_space_charge_initialization # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_space_charge_initialization # inputs + analysis.py # analysis + diags/diag1000001 # output + OFF # dependency +) + +add_warpx_test( + test_3d_space_charge_initialization # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_space_charge_initialization # inputs + analysis.py # analysis + diags/diag1000001 # output + OFF # dependency +) diff --git a/Examples/Tests/space_charge_initialization/inputs_test_2d_space_charge_initialization b/Examples/Tests/space_charge_initialization/inputs_test_2d_space_charge_initialization new file mode 100644 index 00000000000..4445217225c --- /dev/null +++ b/Examples/Tests/space_charge_initialization/inputs_test_2d_space_charge_initialization @@ -0,0 +1,37 @@ +max_step = 1 +amr.n_cell = 128 128 +amr.max_grid_size = 32 +amr.max_level = 0 + +geometry.dims = 3 +boundary.field_lo = pec pec +boundary.field_hi = pec pec +geometry.prob_lo = -50.e-6 -50.e-6 +geometry.prob_hi = 50.e-6 50.e-6 +geometry.dims = 2 + +warpx.cfl = 1.e-3 + +# Order of particle shape factors +algo.particle_shape = 1 + +particles.species_names = beam +beam.charge = -q_e +beam.mass = m_e +beam.injection_style = "gaussian_beam" +beam.initialize_self_fields = 1 +beam.x_rms = 2.e-6 +beam.y_rms = 2.e-6 +beam.z_rms = 2.e-6 +beam.x_m = 0. +beam.y_m = 0. +beam.z_m = 0.e-6 +beam.npart = 20000 +beam.q_tot = -1.e-20 +beam.momentum_distribution_type = "at_rest" + +# Diagnostics +diagnostics.diags_names = diag1 +diag1.intervals = 1 +diag1.diag_type = Full +diag1.fields_to_plot = Ex Ey Ez jx jy jz diff --git a/Examples/Tests/space_charge_initialization/inputs_3d b/Examples/Tests/space_charge_initialization/inputs_test_3d_space_charge_initialization similarity index 97% rename from Examples/Tests/space_charge_initialization/inputs_3d rename to Examples/Tests/space_charge_initialization/inputs_test_3d_space_charge_initialization index c8058fac519..d7a9f42fa70 100644 --- a/Examples/Tests/space_charge_initialization/inputs_3d +++ b/Examples/Tests/space_charge_initialization/inputs_test_3d_space_charge_initialization @@ -8,6 +8,7 @@ boundary.field_lo = pec pec pec boundary.field_hi = pec pec pec geometry.prob_lo = -50.e-6 -50.e-6 -50.e-6 geometry.prob_hi = 50.e-6 50.e-6 50.e-6 +geometry.dims = 3 warpx.cfl = 1.e-3 diff --git a/Examples/Tests/subcycling/CMakeLists.txt b/Examples/Tests/subcycling/CMakeLists.txt new file mode 100644 index 00000000000..ccea031f5a4 --- /dev/null +++ b/Examples/Tests/subcycling/CMakeLists.txt @@ -0,0 +1,13 @@ +# Add tests (alphabetical order) ############################################## +# + +add_warpx_test( + test_2d_subcycling_mr # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_subcycling_mr # inputs + analysis_default_regression.py # analysis + diags/diag1000250 # output + OFF # dependency +) diff --git a/Examples/Tests/subcycling/analysis_default_regression.py b/Examples/Tests/subcycling/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/subcycling/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/subcycling/inputs_2d b/Examples/Tests/subcycling/inputs_test_2d_subcycling_mr similarity index 100% rename from Examples/Tests/subcycling/inputs_2d rename to Examples/Tests/subcycling/inputs_test_2d_subcycling_mr diff --git a/Examples/Tests/vay_deposition/CMakeLists.txt b/Examples/Tests/vay_deposition/CMakeLists.txt new file mode 100644 index 00000000000..9ebe4ec0dba --- /dev/null +++ b/Examples/Tests/vay_deposition/CMakeLists.txt @@ -0,0 +1,28 @@ +# Add tests (alphabetical order) ############################################## +# + +if(WarpX_FFT) + add_warpx_test( + test_2d_vay_deposition # name + 2 # dims + 2 # nprocs + OFF # eb + inputs_test_2d_vay_deposition # inputs + analysis.py # analysis + diags/diag1000050 # output + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_vay_deposition # name + 3 # dims + 2 # nprocs + OFF # eb + inputs_test_3d_vay_deposition # inputs + analysis.py # analysis + diags/diag1000025 # output + OFF # dependency + ) +endif() diff --git a/Examples/Tests/vay_deposition/inputs_2d b/Examples/Tests/vay_deposition/inputs_test_2d_vay_deposition similarity index 100% rename from Examples/Tests/vay_deposition/inputs_2d rename to Examples/Tests/vay_deposition/inputs_test_2d_vay_deposition diff --git a/Examples/Tests/vay_deposition/inputs_3d b/Examples/Tests/vay_deposition/inputs_test_3d_vay_deposition similarity index 100% rename from Examples/Tests/vay_deposition/inputs_3d rename to Examples/Tests/vay_deposition/inputs_test_3d_vay_deposition diff --git a/Examples/analysis_default_regression.py b/Examples/analysis_default_regression.py index 5e1e88ee28b..519bbeeea64 100755 --- a/Examples/analysis_default_regression.py +++ b/Examples/analysis_default_regression.py @@ -17,4 +17,5 @@ if re.search("single_precision", fn): checksumAPI.evaluate_checksum(test_name, fn, rtol=2.0e-6) else: + # using default relative tolerance checksumAPI.evaluate_checksum(test_name, fn) diff --git a/Examples/analysis_default_restart.py b/Examples/analysis_default_restart.py index 30491ad59e9..55bab253dbc 100755 --- a/Examples/analysis_default_restart.py +++ b/Examples/analysis_default_restart.py @@ -1,8 +1,14 @@ #!/usr/bin/env python3 +import os +import sys + import numpy as np import yt +sys.path.insert(1, "../../../../warpx/Regression/Checksum/") +import checksumAPI + def check_restart(filename, tolerance=1e-12): """ @@ -31,7 +37,7 @@ def check_restart(filename, tolerance=1e-12): ) # Load output data generated from initial run - benchmark = "orig_" + filename + benchmark = os.path.join(os.getcwd().replace("_restart", ""), filename) ds_benchmark = yt.load(benchmark) # yt 4.0+ has rounding issues with our domain data: @@ -48,7 +54,7 @@ def check_restart(filename, tolerance=1e-12): # Loop over all fields (all particle species, all particle attributes, all grid fields) # and compare output data generated from initial run with output data generated after restart - print("\ntolerance = {:g}".format(tolerance)) + print(f"\ntolerance = {tolerance}") print() for field in ds_benchmark.field_list: dr = ad_restart[field].squeeze().v @@ -56,6 +62,17 @@ def check_restart(filename, tolerance=1e-12): error = np.amax(np.abs(dr - db)) if np.amax(np.abs(db)) != 0.0: error /= np.amax(np.abs(db)) - print("field: {}; error = {:g}".format(field, error)) + print(f"field: {field}; error = {error}") assert error < tolerance print() + + +filename = sys.argv[1] + +# compare restart results against original results +check_restart(filename) + +# compare restart checksums against original checksums +testname = os.path.split(os.getcwd())[1] +testname = testname.replace("_restart", "") +checksumAPI.evaluate_checksum(testname, filename, rtol=1e-12) diff --git a/Regression/Checksum/benchmarks_json/LaserIonAcc3d.json b/Regression/Checksum/benchmarks_json/LaserIonAcc3d.json deleted file mode 100644 index de5472105d9..00000000000 --- a/Regression/Checksum/benchmarks_json/LaserIonAcc3d.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "electrons": { - "particle_momentum_x": 1.6966182372218133e-16, - "particle_momentum_y": 2.6850066145197374e-17, - "particle_momentum_z": 2.0052710316284176e-16, - "particle_position_x": 0.3393352015355679, - "particle_position_y": 1.1078675395554147, - "particle_position_z": 0.3419438867441836, - "particle_weight": 26433181926540.81 - }, - "hydrogen": { - "particle_momentum_x": 1.7161831722699107e-16, - "particle_momentum_y": 4.9196233343263506e-17, - "particle_momentum_z": 2.1370961936359413e-16, - "particle_position_x": 0.3375134789944616, - "particle_position_y": 1.1080021730384098, - "particle_position_z": 0.33939049172256086, - "particle_weight": 26441597005520.95 - }, - "lev=0": { - "Bx": 41555976.87146437, - "By": 175750876.1712573, - "Bz": 35156983.723599546, - "Ex": 3.872657491899755e+17, - "Ey": 3.3815796095277564e+16, - "Ez": 3.937276394651024e+17, - "jx": 3.5072653955241413e+21, - "jy": 4.011484251839508e+20, - "jz": 3.787151010057889e+21, - "rho": 7429502184315.598 - } -} \ No newline at end of file diff --git a/Regression/Checksum/benchmarks_json/TwoParticle_electrostatic.json b/Regression/Checksum/benchmarks_json/TwoParticle_electrostatic.json deleted file mode 100644 index aaf04f8a74c..00000000000 --- a/Regression/Checksum/benchmarks_json/TwoParticle_electrostatic.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "electron1": { - "particle_momentum_x": 3.346088201352191e-29, - "particle_momentum_y": 3.346088199932699e-29, - "particle_momentum_z": 3.3460881978884573e-29, - "particle_position_x": 0.1545496421786394, - "particle_position_y": 0.15454964213891717, - "particle_position_z": 0.15454964208395047, - "particle_weight": 1.0 - }, - "electron2": { - "particle_momentum_x": 3.346088199424244e-29, - "particle_momentum_y": 3.346088202432085e-29, - "particle_momentum_z": 3.346088202108714e-29, - "particle_position_x": 0.15454964215048347, - "particle_position_y": 0.15454964222866666, - "particle_position_z": 0.15454964222208387, - "particle_weight": 1.0 - }, - "lev=0": { - "Ex": 7.101527209952963e-05, - "Ey": 7.10152721046017e-05, - "Ez": 7.101527211163835e-05, - "rho": 1.3125030985727997e-15 - } -} \ No newline at end of file diff --git a/Regression/Checksum/benchmarks_json/collisionZ.json b/Regression/Checksum/benchmarks_json/test_1d_collision_z.json similarity index 100% rename from Regression/Checksum/benchmarks_json/collisionZ.json rename to Regression/Checksum/benchmarks_json/test_1d_collision_z.json diff --git a/Regression/Checksum/benchmarks_json/Python_dsmc_1d.json b/Regression/Checksum/benchmarks_json/test_1d_dsmc_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_dsmc_1d.json rename to Regression/Checksum/benchmarks_json/test_1d_dsmc_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_fluid_1D.json b/Regression/Checksum/benchmarks_json/test_1d_langmuir_fluid.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_fluid_1D.json rename to Regression/Checksum/benchmarks_json/test_1d_langmuir_fluid.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_1d.json b/Regression/Checksum/benchmarks_json/test_1d_langmuir_multi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_1d.json rename to Regression/Checksum/benchmarks_json/test_1d_langmuir_multi.json diff --git a/Regression/Checksum/benchmarks_json/LaserAcceleration_1d.json b/Regression/Checksum/benchmarks_json/test_1d_laser_acceleration.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserAcceleration_1d.json rename to Regression/Checksum/benchmarks_json/test_1d_laser_acceleration.json diff --git a/Regression/Checksum/benchmarks_json/LaserAcceleration_1d_fluid.json b/Regression/Checksum/benchmarks_json/test_1d_laser_acceleration_fluid.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserAcceleration_1d_fluid.json rename to Regression/Checksum/benchmarks_json/test_1d_laser_acceleration_fluid.json diff --git a/Regression/Checksum/benchmarks_json/LaserAcceleration_1d_fluid_boosted.json b/Regression/Checksum/benchmarks_json/test_1d_laser_acceleration_fluid_boosted.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserAcceleration_1d_fluid_boosted.json rename to Regression/Checksum/benchmarks_json/test_1d_laser_acceleration_fluid_boosted.json diff --git a/Regression/Checksum/benchmarks_json/Python_LaserAcceleration_1d.json b/Regression/Checksum/benchmarks_json/test_1d_laser_acceleration_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_LaserAcceleration_1d.json rename to Regression/Checksum/benchmarks_json/test_1d_laser_acceleration_picmi.json diff --git a/Regression/Checksum/benchmarks_json/LaserInjection_1d.json b/Regression/Checksum/benchmarks_json/test_1d_laser_injection.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserInjection_1d.json rename to Regression/Checksum/benchmarks_json/test_1d_laser_injection.json diff --git a/Regression/Checksum/benchmarks_json/LaserInjectionFromLASYFile_1d.json b/Regression/Checksum/benchmarks_json/test_1d_laser_injection_from_lasy_file.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserInjectionFromLASYFile_1d.json rename to Regression/Checksum/benchmarks_json/test_1d_laser_injection_from_lasy_file.json diff --git a/Regression/Checksum/benchmarks_json/LaserInjectionFromLASYFile_1d_boost.json b/Regression/Checksum/benchmarks_json/test_1d_laser_injection_from_lasy_file_boost.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserInjectionFromLASYFile_1d_boost.json rename to Regression/Checksum/benchmarks_json/test_1d_laser_injection_from_lasy_file_boost.json diff --git a/Regression/Checksum/benchmarks_json/Python_ohms_law_solver_EM_modes_1d.json b/Regression/Checksum/benchmarks_json/test_1d_ohm_solver_em_modes_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_ohms_law_solver_EM_modes_1d.json rename to Regression/Checksum/benchmarks_json/test_1d_ohm_solver_em_modes_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Python_ohms_law_solver_ion_beam_1d.json b/Regression/Checksum/benchmarks_json/test_1d_ohm_solver_ion_beam_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_ohms_law_solver_ion_beam_1d.json rename to Regression/Checksum/benchmarks_json/test_1d_ohm_solver_ion_beam_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Python_PlasmaAcceleration1d.json b/Regression/Checksum/benchmarks_json/test_1d_plasma_acceleration_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_PlasmaAcceleration1d.json rename to Regression/Checksum/benchmarks_json/test_1d_plasma_acceleration_picmi.json diff --git a/Regression/Checksum/benchmarks_json/resample_velocity_coincidence_thinning.json b/Regression/Checksum/benchmarks_json/test_1d_resample_velocity_coincidence_thinning.json similarity index 100% rename from Regression/Checksum/benchmarks_json/resample_velocity_coincidence_thinning.json rename to Regression/Checksum/benchmarks_json/test_1d_resample_velocity_coincidence_thinning.json diff --git a/Regression/Checksum/benchmarks_json/resample_velocity_coincidence_thinning_cartesian.json b/Regression/Checksum/benchmarks_json/test_1d_resample_velocity_coincidence_thinning_cartesian.json similarity index 100% rename from Regression/Checksum/benchmarks_json/resample_velocity_coincidence_thinning_cartesian.json rename to Regression/Checksum/benchmarks_json/test_1d_resample_velocity_coincidence_thinning_cartesian.json diff --git a/Regression/Checksum/benchmarks_json/SemiImplicitPicard_1d.json b/Regression/Checksum/benchmarks_json/test_1d_semi_implicit_picard.json similarity index 100% rename from Regression/Checksum/benchmarks_json/SemiImplicitPicard_1d.json rename to Regression/Checksum/benchmarks_json/test_1d_semi_implicit_picard.json diff --git a/Regression/Checksum/benchmarks_json/silver_mueller_1d.json b/Regression/Checksum/benchmarks_json/test_1d_silver_mueller.json similarity index 100% rename from Regression/Checksum/benchmarks_json/silver_mueller_1d.json rename to Regression/Checksum/benchmarks_json/test_1d_silver_mueller.json diff --git a/Regression/Checksum/benchmarks_json/ThetaImplicitPicard_1d.json b/Regression/Checksum/benchmarks_json/test_1d_theta_implicit_picard.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ThetaImplicitPicard_1d.json rename to Regression/Checksum/benchmarks_json/test_1d_theta_implicit_picard.json diff --git a/Regression/Checksum/benchmarks_json/averaged_galilean_2d_psatd.json b/Regression/Checksum/benchmarks_json/test_2d_averaged_galilean_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/averaged_galilean_2d_psatd.json rename to Regression/Checksum/benchmarks_json/test_2d_averaged_galilean_psatd.json diff --git a/Regression/Checksum/benchmarks_json/averaged_galilean_2d_psatd_hybrid.json b/Regression/Checksum/benchmarks_json/test_2d_averaged_galilean_psatd_hybrid.json similarity index 100% rename from Regression/Checksum/benchmarks_json/averaged_galilean_2d_psatd_hybrid.json rename to Regression/Checksum/benchmarks_json/test_2d_averaged_galilean_psatd_hybrid.json diff --git a/Regression/Checksum/benchmarks_json/background_mcc.json b/Regression/Checksum/benchmarks_json/test_2d_background_mcc.json similarity index 100% rename from Regression/Checksum/benchmarks_json/background_mcc.json rename to Regression/Checksum/benchmarks_json/test_2d_background_mcc.json diff --git a/Regression/Checksum/benchmarks_json/background_mcc_dp_psp.json b/Regression/Checksum/benchmarks_json/test_2d_background_mcc_dp_psp.json similarity index 100% rename from Regression/Checksum/benchmarks_json/background_mcc_dp_psp.json rename to Regression/Checksum/benchmarks_json/test_2d_background_mcc_dp_psp.json diff --git a/Regression/Checksum/benchmarks_json/bilinear_filter.json b/Regression/Checksum/benchmarks_json/test_2d_bilinear_filter.json similarity index 100% rename from Regression/Checksum/benchmarks_json/bilinear_filter.json rename to Regression/Checksum/benchmarks_json/test_2d_bilinear_filter.json diff --git a/Regression/Checksum/benchmarks_json/collisionXZ.json b/Regression/Checksum/benchmarks_json/test_2d_collision_xz.json similarity index 100% rename from Regression/Checksum/benchmarks_json/collisionXZ.json rename to Regression/Checksum/benchmarks_json/test_2d_collision_xz.json diff --git a/Regression/Checksum/benchmarks_json/comoving_2d_psatd_hybrid.json b/Regression/Checksum/benchmarks_json/test_2d_comoving_psatd_hybrid.json similarity index 100% rename from Regression/Checksum/benchmarks_json/comoving_2d_psatd_hybrid.json rename to Regression/Checksum/benchmarks_json/test_2d_comoving_psatd_hybrid.json diff --git a/Regression/Checksum/benchmarks_json/dive_cleaning_2d.json b/Regression/Checksum/benchmarks_json/test_2d_dive_cleaning.json similarity index 100% rename from Regression/Checksum/benchmarks_json/dive_cleaning_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_dive_cleaning.json diff --git a/Regression/Checksum/benchmarks_json/embedded_boundary_cube_2d.json b/Regression/Checksum/benchmarks_json/test_2d_embedded_boundary_cube.json similarity index 100% rename from Regression/Checksum/benchmarks_json/embedded_boundary_cube_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_embedded_boundary_cube.json diff --git a/Regression/Checksum/benchmarks_json/embedded_boundary_rotated_cube_2d.json b/Regression/Checksum/benchmarks_json/test_2d_embedded_boundary_rotated_cube.json similarity index 100% rename from Regression/Checksum/benchmarks_json/embedded_boundary_rotated_cube_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_embedded_boundary_rotated_cube.json diff --git a/Regression/Checksum/benchmarks_json/embedded_circle.json b/Regression/Checksum/benchmarks_json/test_2d_embedded_circle.json similarity index 100% rename from Regression/Checksum/benchmarks_json/embedded_circle.json rename to Regression/Checksum/benchmarks_json/test_2d_embedded_circle.json diff --git a/Regression/Checksum/benchmarks_json/EnergyConservingThermalPlasma.json b/Regression/Checksum/benchmarks_json/test_2d_energy_conserving_thermal_plasma.json similarity index 100% rename from Regression/Checksum/benchmarks_json/EnergyConservingThermalPlasma.json rename to Regression/Checksum/benchmarks_json/test_2d_energy_conserving_thermal_plasma.json diff --git a/Regression/Checksum/benchmarks_json/galilean_2d_psatd.json b/Regression/Checksum/benchmarks_json/test_2d_galilean_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/galilean_2d_psatd.json rename to Regression/Checksum/benchmarks_json/test_2d_galilean_psatd.json diff --git a/Regression/Checksum/benchmarks_json/galilean_2d_psatd_current_correction.json b/Regression/Checksum/benchmarks_json/test_2d_galilean_psatd_current_correction.json similarity index 100% rename from Regression/Checksum/benchmarks_json/galilean_2d_psatd_current_correction.json rename to Regression/Checksum/benchmarks_json/test_2d_galilean_psatd_current_correction.json diff --git a/Regression/Checksum/benchmarks_json/galilean_2d_psatd_current_correction_psb.json b/Regression/Checksum/benchmarks_json/test_2d_galilean_psatd_current_correction_psb.json similarity index 100% rename from Regression/Checksum/benchmarks_json/galilean_2d_psatd_current_correction_psb.json rename to Regression/Checksum/benchmarks_json/test_2d_galilean_psatd_current_correction_psb.json diff --git a/Regression/Checksum/benchmarks_json/galilean_2d_psatd_hybrid.json b/Regression/Checksum/benchmarks_json/test_2d_galilean_psatd_hybrid.json similarity index 100% rename from Regression/Checksum/benchmarks_json/galilean_2d_psatd_hybrid.json rename to Regression/Checksum/benchmarks_json/test_2d_galilean_psatd_hybrid.json diff --git a/Regression/Checksum/benchmarks_json/test_2d_id_cpu_read_picmi.json b/Regression/Checksum/benchmarks_json/test_2d_id_cpu_read_picmi.json new file mode 100644 index 00000000000..a59b780ba38 --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_2d_id_cpu_read_picmi.json @@ -0,0 +1,14 @@ +{ + "lev=0": { + "phi": 0.001516261625969309 + }, + "electrons": { + "particle_momentum_x": 7.751654441658017e-26, + "particle_momentum_y": 6.938526597814195e-26, + "particle_momentum_z": 6.572520038890184e-26, + "particle_newPid": 500.0, + "particle_position_x": 1.4999588764815643, + "particle_position_y": 1.4999551809411737, + "particle_weight": 200.0 + } +} diff --git a/Regression/Checksum/benchmarks_json/ionization_boost.json b/Regression/Checksum/benchmarks_json/test_2d_ionization_boost.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ionization_boost.json rename to Regression/Checksum/benchmarks_json/test_2d_ionization_boost.json diff --git a/Regression/Checksum/benchmarks_json/ionization_lab.json b/Regression/Checksum/benchmarks_json/test_2d_ionization_lab.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ionization_lab.json rename to Regression/Checksum/benchmarks_json/test_2d_ionization_lab.json diff --git a/Regression/Checksum/benchmarks_json/Python_ionization.json b/Regression/Checksum/benchmarks_json/test_2d_ionization_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_ionization.json rename to Regression/Checksum/benchmarks_json/test_2d_ionization_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_fluid_2D.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_fluid.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_fluid_2D.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_fluid.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_MR.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_mr.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_MR.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_mr.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_MR_anisotropic.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_mr_anisotropic.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_MR_anisotropic.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_mr_anisotropic.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_MR_momentum_conserving.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_mr_momentum_conserving.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_MR_momentum_conserving.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_mr_momentum_conserving.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_MR_psatd.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_mr_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_MR_psatd.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_mr_psatd.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_nodal.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_nodal.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_nodal.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_nodal.json diff --git a/Regression/Checksum/benchmarks_json/Python_Langmuir_2d.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_Langmuir_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_current_correction.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_current_correction.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_current_correction.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_current_correction.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_current_correction_nodal.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_current_correction_nodal.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_current_correction_nodal.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_current_correction_nodal.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_momentum_conserving.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_momentum_conserving.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_momentum_conserving.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_momentum_conserving.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_multiJ.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_multiJ.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_multiJ.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_multiJ.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_multiJ_nodal.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_multiJ_nodal.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_multiJ_nodal.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_multiJ_nodal.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_nodal.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_nodal.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_nodal.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_nodal.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_Vay_deposition.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_vay_deposition.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_Vay_deposition.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_vay_deposition.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_Vay_deposition_nodal.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_vay_deposition_nodal.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_Vay_deposition_nodal.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_vay_deposition_nodal.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_Vay_deposition_particle_shape_4.json b/Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_vay_deposition_particle_shape_4.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_2d_psatd_Vay_deposition_particle_shape_4.json rename to Regression/Checksum/benchmarks_json/test_2d_langmuir_multi_psatd_vay_deposition_particle_shape_4.json diff --git a/Regression/Checksum/benchmarks_json/Larmor.json b/Regression/Checksum/benchmarks_json/test_2d_larmor.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Larmor.json rename to Regression/Checksum/benchmarks_json/test_2d_larmor.json diff --git a/Regression/Checksum/benchmarks_json/LaserAccelerationBoost.json b/Regression/Checksum/benchmarks_json/test_2d_laser_acceleration_boosted.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserAccelerationBoost.json rename to Regression/Checksum/benchmarks_json/test_2d_laser_acceleration_boosted.json diff --git a/Regression/Checksum/benchmarks_json/LaserAccelerationMR.json b/Regression/Checksum/benchmarks_json/test_2d_laser_acceleration_mr.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserAccelerationMR.json rename to Regression/Checksum/benchmarks_json/test_2d_laser_acceleration_mr.json diff --git a/Regression/Checksum/benchmarks_json/Python_LaserAccelerationMR.json b/Regression/Checksum/benchmarks_json/test_2d_laser_acceleration_mr_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_LaserAccelerationMR.json rename to Regression/Checksum/benchmarks_json/test_2d_laser_acceleration_mr_picmi.json diff --git a/Regression/Checksum/benchmarks_json/LaserInjection_2d.json b/Regression/Checksum/benchmarks_json/test_2d_laser_injection.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserInjection_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_laser_injection.json diff --git a/Regression/Checksum/benchmarks_json/LaserInjectionFromBINARYFile.json b/Regression/Checksum/benchmarks_json/test_2d_laser_injection_from_binary_file.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserInjectionFromBINARYFile.json rename to Regression/Checksum/benchmarks_json/test_2d_laser_injection_from_binary_file.json diff --git a/Regression/Checksum/benchmarks_json/LaserInjectionFromLASYFile_2d.json b/Regression/Checksum/benchmarks_json/test_2d_laser_injection_from_lasy_file.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserInjectionFromLASYFile_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_laser_injection_from_lasy_file.json diff --git a/Regression/Checksum/benchmarks_json/LaserIonAcc2d.json b/Regression/Checksum/benchmarks_json/test_2d_laser_ion_acc.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserIonAcc2d.json rename to Regression/Checksum/benchmarks_json/test_2d_laser_ion_acc.json diff --git a/Regression/Checksum/benchmarks_json/LaserIonAcc2d_no_field_diag.json b/Regression/Checksum/benchmarks_json/test_2d_laser_ion_acc_no_field_diag.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserIonAcc2d_no_field_diag.json rename to Regression/Checksum/benchmarks_json/test_2d_laser_ion_acc_no_field_diag.json diff --git a/Regression/Checksum/benchmarks_json/Python_LaserIonAcc2d.json b/Regression/Checksum/benchmarks_json/test_2d_laser_ion_acc_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_LaserIonAcc2d.json rename to Regression/Checksum/benchmarks_json/test_2d_laser_ion_acc_picmi.json diff --git a/Regression/Checksum/benchmarks_json/LaserOnFine.json b/Regression/Checksum/benchmarks_json/test_2d_laser_on_fine.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserOnFine.json rename to Regression/Checksum/benchmarks_json/test_2d_laser_on_fine.json diff --git a/Regression/Checksum/benchmarks_json/leveling_thinning.json b/Regression/Checksum/benchmarks_json/test_2d_leveling_thinning.json similarity index 100% rename from Regression/Checksum/benchmarks_json/leveling_thinning.json rename to Regression/Checksum/benchmarks_json/test_2d_leveling_thinning.json diff --git a/Regression/Checksum/benchmarks_json/Maxwell_Hybrid_QED_solver.json b/Regression/Checksum/benchmarks_json/test_2d_maxwell_hybrid_qed_solver.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Maxwell_Hybrid_QED_solver.json rename to Regression/Checksum/benchmarks_json/test_2d_maxwell_hybrid_qed_solver.json diff --git a/Regression/Checksum/benchmarks_json/nci_corrector.json b/Regression/Checksum/benchmarks_json/test_2d_nci_corrector.json similarity index 100% rename from Regression/Checksum/benchmarks_json/nci_corrector.json rename to Regression/Checksum/benchmarks_json/test_2d_nci_corrector.json diff --git a/Regression/Checksum/benchmarks_json/nci_correctorMR.json b/Regression/Checksum/benchmarks_json/test_2d_nci_corrector_mr.json similarity index 100% rename from Regression/Checksum/benchmarks_json/nci_correctorMR.json rename to Regression/Checksum/benchmarks_json/test_2d_nci_corrector_mr.json diff --git a/Regression/Checksum/benchmarks_json/Python_ohms_law_solver_landau_damping_2d.json b/Regression/Checksum/benchmarks_json/test_2d_ohm_solver_landau_damping_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_ohms_law_solver_landau_damping_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_ohm_solver_landau_damping_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Python_ohms_law_solver_magnetic_reconnection_2d.json b/Regression/Checksum/benchmarks_json/test_2d_ohm_solver_magnetic_reconnection_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_ohms_law_solver_magnetic_reconnection_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_ohm_solver_magnetic_reconnection_picmi.json diff --git a/Regression/Checksum/benchmarks_json/parabolic_channel_initialization_2d_single_precision.json b/Regression/Checksum/benchmarks_json/test_2d_parabolic_channel_initialization.json similarity index 100% rename from Regression/Checksum/benchmarks_json/parabolic_channel_initialization_2d_single_precision.json rename to Regression/Checksum/benchmarks_json/test_2d_parabolic_channel_initialization.json diff --git a/Regression/Checksum/benchmarks_json/particle_thermal_boundary.json b/Regression/Checksum/benchmarks_json/test_2d_particle_thermal_boundary.json similarity index 100% rename from Regression/Checksum/benchmarks_json/particle_thermal_boundary.json rename to Regression/Checksum/benchmarks_json/test_2d_particle_thermal_boundary.json diff --git a/Regression/Checksum/benchmarks_json/particles_in_pml_2d.json b/Regression/Checksum/benchmarks_json/test_2d_particles_in_pml.json similarity index 100% rename from Regression/Checksum/benchmarks_json/particles_in_pml_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_particles_in_pml.json diff --git a/Regression/Checksum/benchmarks_json/particles_in_pml_2d_MR.json b/Regression/Checksum/benchmarks_json/test_2d_particles_in_pml_mr.json similarity index 100% rename from Regression/Checksum/benchmarks_json/particles_in_pml_2d_MR.json rename to Regression/Checksum/benchmarks_json/test_2d_particles_in_pml_mr.json diff --git a/Regression/Checksum/benchmarks_json/PlasmaAccelerationBoost2d.json b/Regression/Checksum/benchmarks_json/test_2d_plasma_acceleration_boosted.json similarity index 100% rename from Regression/Checksum/benchmarks_json/PlasmaAccelerationBoost2d.json rename to Regression/Checksum/benchmarks_json/test_2d_plasma_acceleration_boosted.json diff --git a/Regression/Checksum/benchmarks_json/PlasmaAccelerationMR.json b/Regression/Checksum/benchmarks_json/test_2d_plasma_acceleration_mr.json similarity index 100% rename from Regression/Checksum/benchmarks_json/PlasmaAccelerationMR.json rename to Regression/Checksum/benchmarks_json/test_2d_plasma_acceleration_mr.json diff --git a/Regression/Checksum/benchmarks_json/momentum-conserving-gather.json b/Regression/Checksum/benchmarks_json/test_2d_plasma_acceleration_mr_momentum_conserving.json similarity index 100% rename from Regression/Checksum/benchmarks_json/momentum-conserving-gather.json rename to Regression/Checksum/benchmarks_json/test_2d_plasma_acceleration_mr_momentum_conserving.json diff --git a/Regression/Checksum/benchmarks_json/PlasmaMirror.json b/Regression/Checksum/benchmarks_json/test_2d_plasma_mirror.json similarity index 100% rename from Regression/Checksum/benchmarks_json/PlasmaMirror.json rename to Regression/Checksum/benchmarks_json/test_2d_plasma_mirror.json diff --git a/Regression/Checksum/benchmarks_json/pml_x_ckc.json b/Regression/Checksum/benchmarks_json/test_2d_pml_x_ckc.json similarity index 100% rename from Regression/Checksum/benchmarks_json/pml_x_ckc.json rename to Regression/Checksum/benchmarks_json/test_2d_pml_x_ckc.json diff --git a/Regression/Checksum/benchmarks_json/pml_x_galilean.json b/Regression/Checksum/benchmarks_json/test_2d_pml_x_galilean.json similarity index 100% rename from Regression/Checksum/benchmarks_json/pml_x_galilean.json rename to Regression/Checksum/benchmarks_json/test_2d_pml_x_galilean.json diff --git a/Regression/Checksum/benchmarks_json/pml_x_psatd.json b/Regression/Checksum/benchmarks_json/test_2d_pml_x_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/pml_x_psatd.json rename to Regression/Checksum/benchmarks_json/test_2d_pml_x_psatd.json diff --git a/Regression/Checksum/benchmarks_json/pml_x_yee.json b/Regression/Checksum/benchmarks_json/test_2d_pml_x_yee.json similarity index 100% rename from Regression/Checksum/benchmarks_json/pml_x_yee.json rename to Regression/Checksum/benchmarks_json/test_2d_pml_x_yee.json diff --git a/Regression/Checksum/benchmarks_json/pml_x_yee_eb.json b/Regression/Checksum/benchmarks_json/test_2d_pml_x_yee_eb.json similarity index 100% rename from Regression/Checksum/benchmarks_json/pml_x_yee_eb.json rename to Regression/Checksum/benchmarks_json/test_2d_pml_x_yee_eb.json diff --git a/Regression/Checksum/benchmarks_json/Python_prev_positions.json b/Regression/Checksum/benchmarks_json/test_2d_prev_positions_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_prev_positions.json rename to Regression/Checksum/benchmarks_json/test_2d_prev_positions_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Proton_Boron_Fusion_2D.json b/Regression/Checksum/benchmarks_json/test_2d_proton_boron_fusion.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Proton_Boron_Fusion_2D.json rename to Regression/Checksum/benchmarks_json/test_2d_proton_boron_fusion.json diff --git a/Regression/Checksum/benchmarks_json/Python_wrappers.json b/Regression/Checksum/benchmarks_json/test_2d_python_wrappers_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_wrappers.json rename to Regression/Checksum/benchmarks_json/test_2d_python_wrappers_picmi.json diff --git a/Regression/Checksum/benchmarks_json/qed_breit_wheeler_2d.json b/Regression/Checksum/benchmarks_json/test_2d_qed_breit_wheeler.json similarity index 100% rename from Regression/Checksum/benchmarks_json/qed_breit_wheeler_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_qed_breit_wheeler.json diff --git a/Regression/Checksum/benchmarks_json/qed_quantum_sync_2d.json b/Regression/Checksum/benchmarks_json/test_2d_qed_quantum_sync.json similarity index 100% rename from Regression/Checksum/benchmarks_json/qed_quantum_sync_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_qed_quantum_sync.json diff --git a/Regression/Checksum/benchmarks_json/RefinedInjection.json b/Regression/Checksum/benchmarks_json/test_2d_refined_injection.json similarity index 100% rename from Regression/Checksum/benchmarks_json/RefinedInjection.json rename to Regression/Checksum/benchmarks_json/test_2d_refined_injection.json diff --git a/Regression/Checksum/benchmarks_json/RepellingParticles.json b/Regression/Checksum/benchmarks_json/test_2d_repelling_particles.json similarity index 100% rename from Regression/Checksum/benchmarks_json/RepellingParticles.json rename to Regression/Checksum/benchmarks_json/test_2d_repelling_particles.json diff --git a/Regression/Checksum/benchmarks_json/RigidInjection_BTD.json b/Regression/Checksum/benchmarks_json/test_2d_rigid_injection_btd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/RigidInjection_BTD.json rename to Regression/Checksum/benchmarks_json/test_2d_rigid_injection_btd.json diff --git a/Regression/Checksum/benchmarks_json/RigidInjection_lab.json b/Regression/Checksum/benchmarks_json/test_2d_rigid_injection_lab.json similarity index 100% rename from Regression/Checksum/benchmarks_json/RigidInjection_lab.json rename to Regression/Checksum/benchmarks_json/test_2d_rigid_injection_lab.json diff --git a/Regression/Checksum/benchmarks_json/silver_mueller_2d_x.json b/Regression/Checksum/benchmarks_json/test_2d_silver_mueller_x.json similarity index 100% rename from Regression/Checksum/benchmarks_json/silver_mueller_2d_x.json rename to Regression/Checksum/benchmarks_json/test_2d_silver_mueller_x.json diff --git a/Regression/Checksum/benchmarks_json/silver_mueller_2d_z.json b/Regression/Checksum/benchmarks_json/test_2d_silver_mueller_z.json similarity index 100% rename from Regression/Checksum/benchmarks_json/silver_mueller_2d_z.json rename to Regression/Checksum/benchmarks_json/test_2d_silver_mueller_z.json diff --git a/Regression/Checksum/benchmarks_json/space_charge_initialization_2d.json b/Regression/Checksum/benchmarks_json/test_2d_space_charge_initialization.json similarity index 100% rename from Regression/Checksum/benchmarks_json/space_charge_initialization_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_space_charge_initialization.json diff --git a/Regression/Checksum/benchmarks_json/subcyclingMR.json b/Regression/Checksum/benchmarks_json/test_2d_subcycling_mr.json similarity index 100% rename from Regression/Checksum/benchmarks_json/subcyclingMR.json rename to Regression/Checksum/benchmarks_json/test_2d_subcycling_mr.json diff --git a/Regression/Checksum/benchmarks_json/ThetaImplicitJFNK_VandB_2d.json b/Regression/Checksum/benchmarks_json/test_2d_theta_implicit_jfnk_vandb.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ThetaImplicitJFNK_VandB_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_theta_implicit_jfnk_vandb.json diff --git a/Regression/Checksum/benchmarks_json/ThetaImplicitJFNK_VandB_2d_PICMI.json b/Regression/Checksum/benchmarks_json/test_2d_theta_implicit_jfnk_vandb_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ThetaImplicitJFNK_VandB_2d_PICMI.json rename to Regression/Checksum/benchmarks_json/test_2d_theta_implicit_jfnk_vandb_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Uniform_2d.json b/Regression/Checksum/benchmarks_json/test_2d_uniform_plasma.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Uniform_2d.json rename to Regression/Checksum/benchmarks_json/test_2d_uniform_plasma.json diff --git a/Regression/Checksum/benchmarks_json/VayDeposition2D.json b/Regression/Checksum/benchmarks_json/test_2d_vay_deposition.json similarity index 100% rename from Regression/Checksum/benchmarks_json/VayDeposition2D.json rename to Regression/Checksum/benchmarks_json/test_2d_vay_deposition.json diff --git a/Regression/Checksum/benchmarks_json/restart.json b/Regression/Checksum/benchmarks_json/test_3d_acceleration.json similarity index 100% rename from Regression/Checksum/benchmarks_json/restart.json rename to Regression/Checksum/benchmarks_json/test_3d_acceleration.json diff --git a/Regression/Checksum/benchmarks_json/restart_psatd.json b/Regression/Checksum/benchmarks_json/test_3d_acceleration_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/restart_psatd.json rename to Regression/Checksum/benchmarks_json/test_3d_acceleration_psatd.json diff --git a/Regression/Checksum/benchmarks_json/restart_psatd_time_avg.json b/Regression/Checksum/benchmarks_json/test_3d_acceleration_psatd_time_avg.json similarity index 100% rename from Regression/Checksum/benchmarks_json/restart_psatd_time_avg.json rename to Regression/Checksum/benchmarks_json/test_3d_acceleration_psatd_time_avg.json diff --git a/Regression/Checksum/benchmarks_json/averaged_galilean_3d_psatd.json b/Regression/Checksum/benchmarks_json/test_3d_averaged_galilean_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/averaged_galilean_3d_psatd.json rename to Regression/Checksum/benchmarks_json/test_3d_averaged_galilean_psatd.json diff --git a/Regression/Checksum/benchmarks_json/averaged_galilean_3d_psatd_hybrid.json b/Regression/Checksum/benchmarks_json/test_3d_averaged_galilean_psatd_hybrid.json similarity index 100% rename from Regression/Checksum/benchmarks_json/averaged_galilean_3d_psatd_hybrid.json rename to Regression/Checksum/benchmarks_json/test_3d_averaged_galilean_psatd_hybrid.json diff --git a/Regression/Checksum/benchmarks_json/BeamBeamCollision.json b/Regression/Checksum/benchmarks_json/test_3d_beam_beam_collision.json similarity index 100% rename from Regression/Checksum/benchmarks_json/BeamBeamCollision.json rename to Regression/Checksum/benchmarks_json/test_3d_beam_beam_collision.json diff --git a/Regression/Checksum/benchmarks_json/collider_diagnostics.json b/Regression/Checksum/benchmarks_json/test_3d_collider_diagnostics.json similarity index 100% rename from Regression/Checksum/benchmarks_json/collider_diagnostics.json rename to Regression/Checksum/benchmarks_json/test_3d_collider_diagnostics.json diff --git a/Regression/Checksum/benchmarks_json/collisionISO.json b/Regression/Checksum/benchmarks_json/test_3d_collision_iso.json similarity index 100% rename from Regression/Checksum/benchmarks_json/collisionISO.json rename to Regression/Checksum/benchmarks_json/test_3d_collision_iso.json diff --git a/Regression/Checksum/benchmarks_json/collisionXYZ.json b/Regression/Checksum/benchmarks_json/test_3d_collision_xyz.json similarity index 100% rename from Regression/Checksum/benchmarks_json/collisionXYZ.json rename to Regression/Checksum/benchmarks_json/test_3d_collision_xyz.json diff --git a/Regression/Checksum/benchmarks_json/Deuterium_Deuterium_Fusion_3D.json b/Regression/Checksum/benchmarks_json/test_3d_deuterium_deuterium_fusion.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Deuterium_Deuterium_Fusion_3D.json rename to Regression/Checksum/benchmarks_json/test_3d_deuterium_deuterium_fusion.json diff --git a/Regression/Checksum/benchmarks_json/Deuterium_Deuterium_Fusion_3D_intraspecies.json b/Regression/Checksum/benchmarks_json/test_3d_deuterium_deuterium_fusion_intraspecies.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Deuterium_Deuterium_Fusion_3D_intraspecies.json rename to Regression/Checksum/benchmarks_json/test_3d_deuterium_deuterium_fusion_intraspecies.json diff --git a/Regression/Checksum/benchmarks_json/Deuterium_Tritium_Fusion_3D.json b/Regression/Checksum/benchmarks_json/test_3d_deuterium_tritium_fusion.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Deuterium_Tritium_Fusion_3D.json rename to Regression/Checksum/benchmarks_json/test_3d_deuterium_tritium_fusion.json diff --git a/Regression/Checksum/benchmarks_json/diff_lumi_diag.json b/Regression/Checksum/benchmarks_json/test_3d_diff_lumi_diag.json similarity index 100% rename from Regression/Checksum/benchmarks_json/diff_lumi_diag.json rename to Regression/Checksum/benchmarks_json/test_3d_diff_lumi_diag.json diff --git a/Regression/Checksum/benchmarks_json/divb_cleaning_3d.json b/Regression/Checksum/benchmarks_json/test_3d_divb_cleaning.json similarity index 100% rename from Regression/Checksum/benchmarks_json/divb_cleaning_3d.json rename to Regression/Checksum/benchmarks_json/test_3d_divb_cleaning.json diff --git a/Regression/Checksum/benchmarks_json/dive_cleaning_3d.json b/Regression/Checksum/benchmarks_json/test_3d_dive_cleaning.json similarity index 100% rename from Regression/Checksum/benchmarks_json/dive_cleaning_3d.json rename to Regression/Checksum/benchmarks_json/test_3d_dive_cleaning.json diff --git a/Regression/Checksum/benchmarks_json/Python_restart_eb.json b/Regression/Checksum/benchmarks_json/test_3d_eb_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_restart_eb.json rename to Regression/Checksum/benchmarks_json/test_3d_eb_picmi.json diff --git a/Regression/Checksum/benchmarks_json/ElectrostaticSphere.json b/Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ElectrostaticSphere.json rename to Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere.json diff --git a/Regression/Checksum/benchmarks_json/ElectrostaticSphereEB.json b/Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_eb.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ElectrostaticSphereEB.json rename to Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_eb.json diff --git a/Regression/Checksum/benchmarks_json/ElectrostaticSphereEB_mixedBCs.json b/Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_eb_mixed_bc.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ElectrostaticSphereEB_mixedBCs.json rename to Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_eb_mixed_bc.json diff --git a/Regression/Checksum/benchmarks_json/Python_ElectrostaticSphereEB.json b/Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_eb_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_ElectrostaticSphereEB.json rename to Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_eb_picmi.json diff --git a/Regression/Checksum/benchmarks_json/ElectrostaticSphereLabFrame.json b/Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_lab_frame.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ElectrostaticSphereLabFrame.json rename to Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_lab_frame.json diff --git a/Regression/Checksum/benchmarks_json/ElectrostaticSphereLabFrame_MR_emass_10.json b/Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_lab_frame_mr_emass_10.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ElectrostaticSphereLabFrame_MR_emass_10.json rename to Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_lab_frame_mr_emass_10.json diff --git a/Regression/Checksum/benchmarks_json/ElectrostaticSphereRelNodal.json b/Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_rel_nodal.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ElectrostaticSphereRelNodal.json rename to Regression/Checksum/benchmarks_json/test_3d_electrostatic_sphere_rel_nodal.json diff --git a/Regression/Checksum/benchmarks_json/embedded_boundary_cube.json b/Regression/Checksum/benchmarks_json/test_3d_embedded_boundary_cube.json similarity index 100% rename from Regression/Checksum/benchmarks_json/embedded_boundary_cube.json rename to Regression/Checksum/benchmarks_json/test_3d_embedded_boundary_cube.json diff --git a/Regression/Checksum/benchmarks_json/embedded_boundary_cube_macroscopic.json b/Regression/Checksum/benchmarks_json/test_3d_embedded_boundary_cube_macroscopic.json similarity index 100% rename from Regression/Checksum/benchmarks_json/embedded_boundary_cube_macroscopic.json rename to Regression/Checksum/benchmarks_json/test_3d_embedded_boundary_cube_macroscopic.json diff --git a/Regression/Checksum/benchmarks_json/embedded_boundary_rotated_cube.json b/Regression/Checksum/benchmarks_json/test_3d_embedded_boundary_rotated_cube.json similarity index 100% rename from Regression/Checksum/benchmarks_json/embedded_boundary_rotated_cube.json rename to Regression/Checksum/benchmarks_json/test_3d_embedded_boundary_rotated_cube.json diff --git a/Regression/Checksum/benchmarks_json/FluxInjection3D.json b/Regression/Checksum/benchmarks_json/test_3d_flux_injection.json similarity index 100% rename from Regression/Checksum/benchmarks_json/FluxInjection3D.json rename to Regression/Checksum/benchmarks_json/test_3d_flux_injection.json diff --git a/Regression/Checksum/benchmarks_json/focusing_gaussian_beam.json b/Regression/Checksum/benchmarks_json/test_3d_focusing_gaussian_beam.json similarity index 100% rename from Regression/Checksum/benchmarks_json/focusing_gaussian_beam.json rename to Regression/Checksum/benchmarks_json/test_3d_focusing_gaussian_beam.json diff --git a/Regression/Checksum/benchmarks_json/galilean_3d_psatd.json b/Regression/Checksum/benchmarks_json/test_3d_galilean_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/galilean_3d_psatd.json rename to Regression/Checksum/benchmarks_json/test_3d_galilean_psatd.json diff --git a/Regression/Checksum/benchmarks_json/galilean_3d_psatd_current_correction.json b/Regression/Checksum/benchmarks_json/test_3d_galilean_psatd_current_correction.json similarity index 100% rename from Regression/Checksum/benchmarks_json/galilean_3d_psatd_current_correction.json rename to Regression/Checksum/benchmarks_json/test_3d_galilean_psatd_current_correction.json diff --git a/Regression/Checksum/benchmarks_json/galilean_3d_psatd_current_correction_psb.json b/Regression/Checksum/benchmarks_json/test_3d_galilean_psatd_current_correction_psb.json similarity index 100% rename from Regression/Checksum/benchmarks_json/galilean_3d_psatd_current_correction_psb.json rename to Regression/Checksum/benchmarks_json/test_3d_galilean_psatd_current_correction_psb.json diff --git a/Regression/Checksum/benchmarks_json/Python_gaussian_beam.json b/Regression/Checksum/benchmarks_json/test_3d_gaussian_beam_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_gaussian_beam.json rename to Regression/Checksum/benchmarks_json/test_3d_gaussian_beam_picmi.json diff --git a/Regression/Checksum/benchmarks_json/hard_edged_quadrupoles.json b/Regression/Checksum/benchmarks_json/test_3d_hard_edged_quadrupoles.json similarity index 100% rename from Regression/Checksum/benchmarks_json/hard_edged_quadrupoles.json rename to Regression/Checksum/benchmarks_json/test_3d_hard_edged_quadrupoles.json diff --git a/Regression/Checksum/benchmarks_json/hard_edged_quadrupoles_boosted.json b/Regression/Checksum/benchmarks_json/test_3d_hard_edged_quadrupoles_boosted.json similarity index 100% rename from Regression/Checksum/benchmarks_json/hard_edged_quadrupoles_boosted.json rename to Regression/Checksum/benchmarks_json/test_3d_hard_edged_quadrupoles_boosted.json diff --git a/Regression/Checksum/benchmarks_json/hard_edged_quadrupoles_moving.json b/Regression/Checksum/benchmarks_json/test_3d_hard_edged_quadrupoles_moving.json similarity index 100% rename from Regression/Checksum/benchmarks_json/hard_edged_quadrupoles_moving.json rename to Regression/Checksum/benchmarks_json/test_3d_hard_edged_quadrupoles_moving.json diff --git a/Regression/Checksum/benchmarks_json/initial_distribution.json b/Regression/Checksum/benchmarks_json/test_3d_initial_distribution.json similarity index 100% rename from Regression/Checksum/benchmarks_json/initial_distribution.json rename to Regression/Checksum/benchmarks_json/test_3d_initial_distribution.json diff --git a/Regression/Checksum/benchmarks_json/ion_stopping.json b/Regression/Checksum/benchmarks_json/test_3d_ion_stopping.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ion_stopping.json rename to Regression/Checksum/benchmarks_json/test_3d_ion_stopping.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_fluid_multi.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_fluid.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_fluid_multi.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_fluid.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_nodal.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_nodal.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_nodal.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_nodal.json diff --git a/Regression/Checksum/benchmarks_json/Python_Langmuir.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_Langmuir.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_psatd.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_psatd.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_current_correction.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_current_correction.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_current_correction.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_current_correction.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_current_correction_nodal.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_current_correction_nodal.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_current_correction_nodal.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_current_correction_nodal.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_div_cleaning.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_div_cleaning.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_div_cleaning.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_div_cleaning.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_momentum_conserving.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_momentum_conserving.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_momentum_conserving.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_momentum_conserving.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_multiJ.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_multiJ.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_multiJ.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_multiJ.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_multiJ_nodal.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_multiJ_nodal.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_multiJ_nodal.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_multiJ_nodal.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_nodal.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_nodal.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_nodal.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_nodal.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_single_precision.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_single_precision.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_single_precision.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_single_precision.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_Vay_deposition.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_vay_deposition.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_Vay_deposition.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_vay_deposition.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_Vay_deposition_nodal.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_vay_deposition_nodal.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_psatd_Vay_deposition_nodal.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_psatd_vay_deposition_nodal.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_single_precision.json b/Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_single_precision.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_single_precision.json rename to Regression/Checksum/benchmarks_json/test_3d_langmuir_multi_single_precision.json diff --git a/Regression/Checksum/benchmarks_json/LaserAcceleration.json b/Regression/Checksum/benchmarks_json/test_3d_laser_acceleration.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserAcceleration.json rename to Regression/Checksum/benchmarks_json/test_3d_laser_acceleration.json diff --git a/Regression/Checksum/benchmarks_json/LaserAcceleration_BTD.json b/Regression/Checksum/benchmarks_json/test_3d_laser_acceleration_btd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserAcceleration_BTD.json rename to Regression/Checksum/benchmarks_json/test_3d_laser_acceleration_btd.json diff --git a/Regression/Checksum/benchmarks_json/Python_LaserAcceleration.json b/Regression/Checksum/benchmarks_json/test_3d_laser_acceleration_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_LaserAcceleration.json rename to Regression/Checksum/benchmarks_json/test_3d_laser_acceleration_picmi.json diff --git a/Regression/Checksum/benchmarks_json/LaserAcceleration_single_precision_comms.json b/Regression/Checksum/benchmarks_json/test_3d_laser_acceleration_single_precision_comms.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserAcceleration_single_precision_comms.json rename to Regression/Checksum/benchmarks_json/test_3d_laser_acceleration_single_precision_comms.json diff --git a/Regression/Checksum/benchmarks_json/LaserInjection.json b/Regression/Checksum/benchmarks_json/test_3d_laser_injection.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserInjection.json rename to Regression/Checksum/benchmarks_json/test_3d_laser_injection.json diff --git a/Regression/Checksum/benchmarks_json/LaserInjectionFromLASYFile.json b/Regression/Checksum/benchmarks_json/test_3d_laser_injection_from_lasy_file.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserInjectionFromLASYFile.json rename to Regression/Checksum/benchmarks_json/test_3d_laser_injection_from_lasy_file.json diff --git a/Regression/Checksum/benchmarks_json/Python_LoadExternalGridField3D.json b/Regression/Checksum/benchmarks_json/test_3d_load_external_field_grid_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_LoadExternalGridField3D.json rename to Regression/Checksum/benchmarks_json/test_3d_load_external_field_grid_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Python_LoadExternalParticleField3D.json b/Regression/Checksum/benchmarks_json/test_3d_load_external_field_particle_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_LoadExternalParticleField3D.json rename to Regression/Checksum/benchmarks_json/test_3d_load_external_field_particle_picmi.json diff --git a/Regression/Checksum/benchmarks_json/magnetostatic_eb_3d.json b/Regression/Checksum/benchmarks_json/test_3d_magnetostatic_eb.json similarity index 100% rename from Regression/Checksum/benchmarks_json/magnetostatic_eb_3d.json rename to Regression/Checksum/benchmarks_json/test_3d_magnetostatic_eb.json diff --git a/Regression/Checksum/benchmarks_json/Python_magnetostatic_eb_3d.json b/Regression/Checksum/benchmarks_json/test_3d_magnetostatic_eb_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_magnetostatic_eb_3d.json rename to Regression/Checksum/benchmarks_json/test_3d_magnetostatic_eb_picmi.json diff --git a/Regression/Checksum/benchmarks_json/NodalElectrostaticSolver.json b/Regression/Checksum/benchmarks_json/test_3d_nodal_electrostatic_solver.json similarity index 100% rename from Regression/Checksum/benchmarks_json/NodalElectrostaticSolver.json rename to Regression/Checksum/benchmarks_json/test_3d_nodal_electrostatic_solver.json diff --git a/Regression/Checksum/benchmarks_json/openbc_poisson_solver.json b/Regression/Checksum/benchmarks_json/test_3d_open_bc_poisson_solver.json similarity index 100% rename from Regression/Checksum/benchmarks_json/openbc_poisson_solver.json rename to Regression/Checksum/benchmarks_json/test_3d_open_bc_poisson_solver.json diff --git a/Regression/Checksum/benchmarks_json/particle_boundaries_3d.json b/Regression/Checksum/benchmarks_json/test_3d_particle_boundaries.json similarity index 100% rename from Regression/Checksum/benchmarks_json/particle_boundaries_3d.json rename to Regression/Checksum/benchmarks_json/test_3d_particle_boundaries.json diff --git a/Regression/Checksum/benchmarks_json/particle_fields_diags.json b/Regression/Checksum/benchmarks_json/test_3d_particle_fields_diags.json similarity index 100% rename from Regression/Checksum/benchmarks_json/particle_fields_diags.json rename to Regression/Checksum/benchmarks_json/test_3d_particle_fields_diags.json diff --git a/Regression/Checksum/benchmarks_json/particle_fields_diags_single_precision.json b/Regression/Checksum/benchmarks_json/test_3d_particle_fields_diags_single_precision.json similarity index 100% rename from Regression/Checksum/benchmarks_json/particle_fields_diags_single_precision.json rename to Regression/Checksum/benchmarks_json/test_3d_particle_fields_diags_single_precision.json diff --git a/Regression/Checksum/benchmarks_json/particle_pusher.json b/Regression/Checksum/benchmarks_json/test_3d_particle_pusher.json similarity index 100% rename from Regression/Checksum/benchmarks_json/particle_pusher.json rename to Regression/Checksum/benchmarks_json/test_3d_particle_pusher.json diff --git a/Regression/Checksum/benchmarks_json/particles_in_pml.json b/Regression/Checksum/benchmarks_json/test_3d_particles_in_pml.json similarity index 100% rename from Regression/Checksum/benchmarks_json/particles_in_pml.json rename to Regression/Checksum/benchmarks_json/test_3d_particles_in_pml.json diff --git a/Regression/Checksum/benchmarks_json/particles_in_pml_3d_MR.json b/Regression/Checksum/benchmarks_json/test_3d_particles_in_pml_mr.json similarity index 100% rename from Regression/Checksum/benchmarks_json/particles_in_pml_3d_MR.json rename to Regression/Checksum/benchmarks_json/test_3d_particles_in_pml_mr.json diff --git a/Regression/Checksum/benchmarks_json/PEC_field.json b/Regression/Checksum/benchmarks_json/test_3d_pec_field.json similarity index 100% rename from Regression/Checksum/benchmarks_json/PEC_field.json rename to Regression/Checksum/benchmarks_json/test_3d_pec_field.json diff --git a/Regression/Checksum/benchmarks_json/PEC_field_mr.json b/Regression/Checksum/benchmarks_json/test_3d_pec_field_mr.json similarity index 100% rename from Regression/Checksum/benchmarks_json/PEC_field_mr.json rename to Regression/Checksum/benchmarks_json/test_3d_pec_field_mr.json diff --git a/Regression/Checksum/benchmarks_json/PEC_particle.json b/Regression/Checksum/benchmarks_json/test_3d_pec_particle.json similarity index 100% rename from Regression/Checksum/benchmarks_json/PEC_particle.json rename to Regression/Checksum/benchmarks_json/test_3d_pec_particle.json diff --git a/Regression/Checksum/benchmarks_json/photon_pusher.json b/Regression/Checksum/benchmarks_json/test_3d_photon_pusher.json similarity index 100% rename from Regression/Checksum/benchmarks_json/photon_pusher.json rename to Regression/Checksum/benchmarks_json/test_3d_photon_pusher.json diff --git a/Regression/Checksum/benchmarks_json/PlasmaAccelerationBoost3d.json b/Regression/Checksum/benchmarks_json/test_3d_plasma_acceleration_boosted.json similarity index 100% rename from Regression/Checksum/benchmarks_json/PlasmaAccelerationBoost3d.json rename to Regression/Checksum/benchmarks_json/test_3d_plasma_acceleration_boosted.json diff --git a/Regression/Checksum/benchmarks_json/PlasmaAccelerationBoost3d_hybrid.json b/Regression/Checksum/benchmarks_json/test_3d_plasma_acceleration_boosted_hybrid.json similarity index 100% rename from Regression/Checksum/benchmarks_json/PlasmaAccelerationBoost3d_hybrid.json rename to Regression/Checksum/benchmarks_json/test_3d_plasma_acceleration_boosted_hybrid.json diff --git a/Regression/Checksum/benchmarks_json/Python_PlasmaAccelerationMR.json b/Regression/Checksum/benchmarks_json/test_3d_plasma_acceleration_mr_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_PlasmaAccelerationMR.json rename to Regression/Checksum/benchmarks_json/test_3d_plasma_acceleration_mr_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Python_PlasmaAcceleration.json b/Regression/Checksum/benchmarks_json/test_3d_plasma_acceleration_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_PlasmaAcceleration.json rename to Regression/Checksum/benchmarks_json/test_3d_plasma_acceleration_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Plasma_lens.json b/Regression/Checksum/benchmarks_json/test_3d_plasma_lens.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Plasma_lens.json rename to Regression/Checksum/benchmarks_json/test_3d_plasma_lens.json diff --git a/Regression/Checksum/benchmarks_json/Plasma_lens_boosted.json b/Regression/Checksum/benchmarks_json/test_3d_plasma_lens_boosted.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Plasma_lens_boosted.json rename to Regression/Checksum/benchmarks_json/test_3d_plasma_lens_boosted.json diff --git a/Regression/Checksum/benchmarks_json/hard_edged_plasma_lens.json b/Regression/Checksum/benchmarks_json/test_3d_plasma_lens_hard_edged.json similarity index 100% rename from Regression/Checksum/benchmarks_json/hard_edged_plasma_lens.json rename to Regression/Checksum/benchmarks_json/test_3d_plasma_lens_hard_edged.json diff --git a/Regression/Checksum/benchmarks_json/Plasma_lens_short.json b/Regression/Checksum/benchmarks_json/test_3d_plasma_lens_short.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Plasma_lens_short.json rename to Regression/Checksum/benchmarks_json/test_3d_plasma_lens_short.json diff --git a/Regression/Checksum/benchmarks_json/pml_psatd_dive_divb_cleaning.json b/Regression/Checksum/benchmarks_json/test_3d_pml_psatd_dive_divb_cleaning.json similarity index 100% rename from Regression/Checksum/benchmarks_json/pml_psatd_dive_divb_cleaning.json rename to Regression/Checksum/benchmarks_json/test_3d_pml_psatd_dive_divb_cleaning.json diff --git a/Regression/Checksum/benchmarks_json/Point_of_contact_EB_3d.json b/Regression/Checksum/benchmarks_json/test_3d_point_of_contact_eb.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Point_of_contact_EB_3d.json rename to Regression/Checksum/benchmarks_json/test_3d_point_of_contact_eb.json diff --git a/Regression/Checksum/benchmarks_json/Python_projection_divb_cleaner_callback_3d.json b/Regression/Checksum/benchmarks_json/test_3d_projection_divb_cleaner_callback_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_projection_divb_cleaner_callback_3d.json rename to Regression/Checksum/benchmarks_json/test_3d_projection_divb_cleaner_callback_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Python_projection_divb_cleaner_3d.json b/Regression/Checksum/benchmarks_json/test_3d_projection_divb_cleaner_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_projection_divb_cleaner_3d.json rename to Regression/Checksum/benchmarks_json/test_3d_projection_divb_cleaner_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Proton_Boron_Fusion_3D.json b/Regression/Checksum/benchmarks_json/test_3d_proton_boron_fusion.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Proton_Boron_Fusion_3D.json rename to Regression/Checksum/benchmarks_json/test_3d_proton_boron_fusion.json diff --git a/Regression/Checksum/benchmarks_json/qed_breit_wheeler_3d.json b/Regression/Checksum/benchmarks_json/test_3d_qed_breit_wheeler.json similarity index 100% rename from Regression/Checksum/benchmarks_json/qed_breit_wheeler_3d.json rename to Regression/Checksum/benchmarks_json/test_3d_qed_breit_wheeler.json diff --git a/Regression/Checksum/benchmarks_json/qed_quantum_sync_3d.json b/Regression/Checksum/benchmarks_json/test_3d_qed_quantum_sync.json similarity index 100% rename from Regression/Checksum/benchmarks_json/qed_quantum_sync_3d.json rename to Regression/Checksum/benchmarks_json/test_3d_qed_quantum_sync.json diff --git a/Regression/Checksum/benchmarks_json/qed_schwinger1.json b/Regression/Checksum/benchmarks_json/test_3d_qed_schwinger_1.json similarity index 100% rename from Regression/Checksum/benchmarks_json/qed_schwinger1.json rename to Regression/Checksum/benchmarks_json/test_3d_qed_schwinger_1.json diff --git a/Regression/Checksum/benchmarks_json/qed_schwinger2.json b/Regression/Checksum/benchmarks_json/test_3d_qed_schwinger_2.json similarity index 100% rename from Regression/Checksum/benchmarks_json/qed_schwinger2.json rename to Regression/Checksum/benchmarks_json/test_3d_qed_schwinger_2.json diff --git a/Regression/Checksum/benchmarks_json/qed_schwinger3.json b/Regression/Checksum/benchmarks_json/test_3d_qed_schwinger_3.json similarity index 100% rename from Regression/Checksum/benchmarks_json/qed_schwinger3.json rename to Regression/Checksum/benchmarks_json/test_3d_qed_schwinger_3.json diff --git a/Regression/Checksum/benchmarks_json/qed_schwinger4.json b/Regression/Checksum/benchmarks_json/test_3d_qed_schwinger_4.json similarity index 100% rename from Regression/Checksum/benchmarks_json/qed_schwinger4.json rename to Regression/Checksum/benchmarks_json/test_3d_qed_schwinger_4.json diff --git a/Regression/Checksum/benchmarks_json/radiation_reaction.json b/Regression/Checksum/benchmarks_json/test_3d_radiation_reaction.json similarity index 100% rename from Regression/Checksum/benchmarks_json/radiation_reaction.json rename to Regression/Checksum/benchmarks_json/test_3d_radiation_reaction.json diff --git a/Regression/Checksum/benchmarks_json/reduced_diags.json b/Regression/Checksum/benchmarks_json/test_3d_reduced_diags.json similarity index 100% rename from Regression/Checksum/benchmarks_json/reduced_diags.json rename to Regression/Checksum/benchmarks_json/test_3d_reduced_diags.json diff --git a/Regression/Checksum/benchmarks_json/reduced_diags_loadbalancecosts_heuristic.json b/Regression/Checksum/benchmarks_json/test_3d_reduced_diags_load_balance_costs_heuristic.json similarity index 100% rename from Regression/Checksum/benchmarks_json/reduced_diags_loadbalancecosts_heuristic.json rename to Regression/Checksum/benchmarks_json/test_3d_reduced_diags_load_balance_costs_heuristic.json diff --git a/Regression/Checksum/benchmarks_json/reduced_diags_loadbalancecosts_timers.json b/Regression/Checksum/benchmarks_json/test_3d_reduced_diags_load_balance_costs_timers.json similarity index 100% rename from Regression/Checksum/benchmarks_json/reduced_diags_loadbalancecosts_timers.json rename to Regression/Checksum/benchmarks_json/test_3d_reduced_diags_load_balance_costs_timers.json diff --git a/Regression/Checksum/benchmarks_json/reduced_diags_loadbalancecosts_timers_psatd.json b/Regression/Checksum/benchmarks_json/test_3d_reduced_diags_load_balance_costs_timers_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/reduced_diags_loadbalancecosts_timers_psatd.json rename to Regression/Checksum/benchmarks_json/test_3d_reduced_diags_load_balance_costs_timers_psatd.json diff --git a/Regression/Checksum/benchmarks_json/reduced_diags_single_precision.json b/Regression/Checksum/benchmarks_json/test_3d_reduced_diags_single_precision.json similarity index 100% rename from Regression/Checksum/benchmarks_json/reduced_diags_single_precision.json rename to Regression/Checksum/benchmarks_json/test_3d_reduced_diags_single_precision.json diff --git a/Regression/Checksum/benchmarks_json/relativistic_space_charge_initialization.json b/Regression/Checksum/benchmarks_json/test_3d_relativistic_space_charge_initialization.json similarity index 100% rename from Regression/Checksum/benchmarks_json/relativistic_space_charge_initialization.json rename to Regression/Checksum/benchmarks_json/test_3d_relativistic_space_charge_initialization.json diff --git a/Regression/Checksum/benchmarks_json/space_charge_initialization.json b/Regression/Checksum/benchmarks_json/test_3d_space_charge_initialization.json similarity index 100% rename from Regression/Checksum/benchmarks_json/space_charge_initialization.json rename to Regression/Checksum/benchmarks_json/test_3d_space_charge_initialization.json diff --git a/Regression/Checksum/benchmarks_json/uniform_plasma_restart.json b/Regression/Checksum/benchmarks_json/test_3d_uniform_plasma.json similarity index 100% rename from Regression/Checksum/benchmarks_json/uniform_plasma_restart.json rename to Regression/Checksum/benchmarks_json/test_3d_uniform_plasma.json diff --git a/Regression/Checksum/benchmarks_json/uniform_plasma_multiJ.json b/Regression/Checksum/benchmarks_json/test_3d_uniform_plasma_multiJ.json similarity index 100% rename from Regression/Checksum/benchmarks_json/uniform_plasma_multiJ.json rename to Regression/Checksum/benchmarks_json/test_3d_uniform_plasma_multiJ.json diff --git a/Regression/Checksum/benchmarks_json/VayDeposition3D.json b/Regression/Checksum/benchmarks_json/test_3d_vay_deposition.json similarity index 100% rename from Regression/Checksum/benchmarks_json/VayDeposition3D.json rename to Regression/Checksum/benchmarks_json/test_3d_vay_deposition.json diff --git a/Regression/Checksum/benchmarks_json/BTD_rz.json b/Regression/Checksum/benchmarks_json/test_rz_btd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/BTD_rz.json rename to Regression/Checksum/benchmarks_json/test_rz_btd.json diff --git a/Regression/Checksum/benchmarks_json/collisionRZ.json b/Regression/Checksum/benchmarks_json/test_rz_collision.json similarity index 100% rename from Regression/Checksum/benchmarks_json/collisionRZ.json rename to Regression/Checksum/benchmarks_json/test_rz_collision.json diff --git a/Regression/Checksum/benchmarks_json/Deuterium_Tritium_Fusion_RZ.json b/Regression/Checksum/benchmarks_json/test_rz_deuterium_tritium_fusion.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Deuterium_Tritium_Fusion_RZ.json rename to Regression/Checksum/benchmarks_json/test_rz_deuterium_tritium_fusion.json diff --git a/Regression/Checksum/benchmarks_json/ElectrostaticSphereRZ.json b/Regression/Checksum/benchmarks_json/test_rz_electrostatic_sphere.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ElectrostaticSphereRZ.json rename to Regression/Checksum/benchmarks_json/test_rz_electrostatic_sphere.json diff --git a/Regression/Checksum/benchmarks_json/ElectrostaticSphereEB_RZ.json b/Regression/Checksum/benchmarks_json/test_rz_electrostatic_sphere_eb.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ElectrostaticSphereEB_RZ.json rename to Regression/Checksum/benchmarks_json/test_rz_electrostatic_sphere_eb.json diff --git a/Regression/Checksum/benchmarks_json/ElectrostaticSphereEB_RZ_MR.json b/Regression/Checksum/benchmarks_json/test_rz_electrostatic_sphere_eb_mr.json similarity index 100% rename from Regression/Checksum/benchmarks_json/ElectrostaticSphereEB_RZ_MR.json rename to Regression/Checksum/benchmarks_json/test_rz_electrostatic_sphere_eb_mr.json diff --git a/Regression/Checksum/benchmarks_json/EmbeddedBoundaryDiffraction.json b/Regression/Checksum/benchmarks_json/test_rz_embedded_boundary_diffraction.json similarity index 100% rename from Regression/Checksum/benchmarks_json/EmbeddedBoundaryDiffraction.json rename to Regression/Checksum/benchmarks_json/test_rz_embedded_boundary_diffraction.json diff --git a/Regression/Checksum/benchmarks_json/FluxInjection.json b/Regression/Checksum/benchmarks_json/test_rz_flux_injection.json similarity index 100% rename from Regression/Checksum/benchmarks_json/FluxInjection.json rename to Regression/Checksum/benchmarks_json/test_rz_flux_injection.json diff --git a/Regression/Checksum/benchmarks_json/galilean_rz_psatd.json b/Regression/Checksum/benchmarks_json/test_rz_galilean_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/galilean_rz_psatd.json rename to Regression/Checksum/benchmarks_json/test_rz_galilean_psatd.json diff --git a/Regression/Checksum/benchmarks_json/galilean_rz_psatd_current_correction.json b/Regression/Checksum/benchmarks_json/test_rz_galilean_psatd_current_correction.json similarity index 100% rename from Regression/Checksum/benchmarks_json/galilean_rz_psatd_current_correction.json rename to Regression/Checksum/benchmarks_json/test_rz_galilean_psatd_current_correction.json diff --git a/Regression/Checksum/benchmarks_json/galilean_rz_psatd_current_correction_psb.json b/Regression/Checksum/benchmarks_json/test_rz_galilean_psatd_current_correction_psb.json similarity index 100% rename from Regression/Checksum/benchmarks_json/galilean_rz_psatd_current_correction_psb.json rename to Regression/Checksum/benchmarks_json/test_rz_galilean_psatd_current_correction_psb.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_fluid_RZ.json b/Regression/Checksum/benchmarks_json/test_rz_langmuir_fluid.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_fluid_RZ.json rename to Regression/Checksum/benchmarks_json/test_rz_langmuir_fluid.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_rz.json b/Regression/Checksum/benchmarks_json/test_rz_langmuir_multi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_rz.json rename to Regression/Checksum/benchmarks_json/test_rz_langmuir_multi.json diff --git a/Regression/Checksum/benchmarks_json/Python_Langmuir_rz_multimode.json b/Regression/Checksum/benchmarks_json/test_rz_langmuir_multi_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_Langmuir_rz_multimode.json rename to Regression/Checksum/benchmarks_json/test_rz_langmuir_multi_picmi.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_rz_psatd.json b/Regression/Checksum/benchmarks_json/test_rz_langmuir_multi_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_rz_psatd.json rename to Regression/Checksum/benchmarks_json/test_rz_langmuir_multi_psatd.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_rz_psatd_current_correction.json b/Regression/Checksum/benchmarks_json/test_rz_langmuir_multi_psatd_current_correction.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_rz_psatd_current_correction.json rename to Regression/Checksum/benchmarks_json/test_rz_langmuir_multi_psatd_current_correction.json diff --git a/Regression/Checksum/benchmarks_json/Langmuir_multi_rz_psatd_multiJ.json b/Regression/Checksum/benchmarks_json/test_rz_langmuir_multi_psatd_multiJ.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Langmuir_multi_rz_psatd_multiJ.json rename to Regression/Checksum/benchmarks_json/test_rz_langmuir_multi_psatd_multiJ.json diff --git a/Regression/Checksum/benchmarks_json/LaserAccelerationRZ.json b/Regression/Checksum/benchmarks_json/test_rz_laser_acceleration.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserAccelerationRZ.json rename to Regression/Checksum/benchmarks_json/test_rz_laser_acceleration.json diff --git a/Regression/Checksum/benchmarks_json/Python_LaserAccelerationRZ.json b/Regression/Checksum/benchmarks_json/test_rz_laser_acceleration_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_LaserAccelerationRZ.json rename to Regression/Checksum/benchmarks_json/test_rz_laser_acceleration_picmi.json diff --git a/Regression/Checksum/benchmarks_json/LaserInjectionFromRZLASYFile.json b/Regression/Checksum/benchmarks_json/test_rz_laser_injection_from_RZ_lasy_file.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserInjectionFromRZLASYFile.json rename to Regression/Checksum/benchmarks_json/test_rz_laser_injection_from_RZ_lasy_file.json diff --git a/Regression/Checksum/benchmarks_json/LaserInjectionFromLASYFile_RZ.json b/Regression/Checksum/benchmarks_json/test_rz_laser_injection_from_lasy_file.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LaserInjectionFromLASYFile_RZ.json rename to Regression/Checksum/benchmarks_json/test_rz_laser_injection_from_lasy_file.json diff --git a/Regression/Checksum/benchmarks_json/LoadExternalFieldRZGrid.json b/Regression/Checksum/benchmarks_json/test_rz_load_external_field_grid.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LoadExternalFieldRZGrid.json rename to Regression/Checksum/benchmarks_json/test_rz_load_external_field_grid.json diff --git a/Regression/Checksum/benchmarks_json/LoadExternalFieldRZParticles.json b/Regression/Checksum/benchmarks_json/test_rz_load_external_field_particles.json similarity index 100% rename from Regression/Checksum/benchmarks_json/LoadExternalFieldRZParticles.json rename to Regression/Checksum/benchmarks_json/test_rz_load_external_field_particles.json diff --git a/Regression/Checksum/benchmarks_json/Python_magnetostatic_eb_rz.json b/Regression/Checksum/benchmarks_json/test_rz_magnetostatic_eb_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_magnetostatic_eb_rz.json rename to Regression/Checksum/benchmarks_json/test_rz_magnetostatic_eb_picmi.json diff --git a/Regression/Checksum/benchmarks_json/multi_J_rz_psatd.json b/Regression/Checksum/benchmarks_json/test_rz_multiJ_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/multi_J_rz_psatd.json rename to Regression/Checksum/benchmarks_json/test_rz_multiJ_psatd.json diff --git a/Regression/Checksum/benchmarks_json/Python_ohms_law_solver_EM_modes_rz.json b/Regression/Checksum/benchmarks_json/test_rz_ohm_solver_em_modes_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Python_ohms_law_solver_EM_modes_rz.json rename to Regression/Checksum/benchmarks_json/test_rz_ohm_solver_em_modes_picmi.json diff --git a/Regression/Checksum/benchmarks_json/particle_boundary_interaction.json b/Regression/Checksum/benchmarks_json/test_rz_particle_boundary_interaction_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/particle_boundary_interaction.json rename to Regression/Checksum/benchmarks_json/test_rz_particle_boundary_interaction_picmi.json diff --git a/Regression/Checksum/benchmarks_json/pml_psatd_rz.json b/Regression/Checksum/benchmarks_json/test_rz_pml_psatd.json similarity index 100% rename from Regression/Checksum/benchmarks_json/pml_psatd_rz.json rename to Regression/Checksum/benchmarks_json/test_rz_pml_psatd.json diff --git a/Regression/Checksum/benchmarks_json/Point_of_contact_EB_rz.json b/Regression/Checksum/benchmarks_json/test_rz_point_of_contact_eb.json similarity index 100% rename from Regression/Checksum/benchmarks_json/Point_of_contact_EB_rz.json rename to Regression/Checksum/benchmarks_json/test_rz_point_of_contact_eb.json diff --git a/Regression/Checksum/benchmarks_json/projection_divb_cleaner_rz.json b/Regression/Checksum/benchmarks_json/test_rz_projection_divb_cleaner.json similarity index 100% rename from Regression/Checksum/benchmarks_json/projection_divb_cleaner_rz.json rename to Regression/Checksum/benchmarks_json/test_rz_projection_divb_cleaner.json diff --git a/Regression/Checksum/benchmarks_json/scraping.json b/Regression/Checksum/benchmarks_json/test_rz_scraping.json similarity index 100% rename from Regression/Checksum/benchmarks_json/scraping.json rename to Regression/Checksum/benchmarks_json/test_rz_scraping.json diff --git a/Regression/Checksum/benchmarks_json/silver_mueller_rz_z.json b/Regression/Checksum/benchmarks_json/test_rz_silver_mueller_z.json similarity index 100% rename from Regression/Checksum/benchmarks_json/silver_mueller_rz_z.json rename to Regression/Checksum/benchmarks_json/test_rz_silver_mueller_z.json diff --git a/Regression/Checksum/benchmarks_json/spacecraft_charging.json b/Regression/Checksum/benchmarks_json/test_rz_spacecraft_charging_picmi.json similarity index 100% rename from Regression/Checksum/benchmarks_json/spacecraft_charging.json rename to Regression/Checksum/benchmarks_json/test_rz_spacecraft_charging_picmi.json diff --git a/Regression/PostProcessingUtils/__init__.py b/Regression/PostProcessingUtils/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Regression/requirements.txt b/Regression/requirements.txt index 5bdd04ba106..509123899ba 100644 --- a/Regression/requirements.txt +++ b/Regression/requirements.txt @@ -1,10 +1,12 @@ +-r ../requirements.txt dill -lasy +lasy>=0.5.0 matplotlib mpi4py numpy openpmd-api openpmd-viewer pandas +periodictable scipy yt