aboutsummaryrefslogtreecommitdiff
path: root/Examples (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-09-11add collider-relevant reduced diags (#4024)Gravatar Arianna Formenti 2-0/+280
* added collider reduced diags * added test * fixed xy_ave and xy_std * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed usage of IntVect and removed print * Set up automated CI test To-do: - Fix bug (erroneous arithmetic operation) - Remove unused parameters from input file * Fix warning: set mass only if WARPX_QED * Use amrex::ParticleReal for mass * Update Make.package to fix GNU Make build * reduced_data.value() only once * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Merge `development` into `coll_rel_red_diags` * updated 3d beam test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * updated 3d test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * `m_write_header` instead of `m_IsNotRestart` * added angles * updated 3d beam test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added 3 particle test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added warning * updated diags names * updated analysis multiple particles * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added positrons to test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update CI test * Reuse input file parser from Tools * Apply suggestions from code review * Apply suggestions from code review * changed order of diags and added docs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Apply WarpX style conventions * Fix CodeQL alerts * assert in RZ and removed fine ref levs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix compilation in 2D * Fix compilation in RZ * Update Docs/source/usage/parameters.rst Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Diagnostics/ReducedDiags/ColliderRelevant.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Diagnostics/ReducedDiags/ColliderRelevant.cpp Co-authored-by: Luca Fedeli <luca.fedeli.88@gmail.com> * Update Source/Diagnostics/ReducedDiags/ColliderRelevant.cpp Co-authored-by: Luca Fedeli <luca.fedeli.88@gmail.com> * Update Source/Diagnostics/ReducedDiags/ColliderRelevant.H Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Diagnostics/ReducedDiags/ColliderRelevant.H Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * minimized number of kernel launches and parallel ops * updated constructor of ReduceDiags * fixed based on comments * updated docs: if QED not enable * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed ReducedDiags constructor * two passes instead of one for robusteness * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed bugs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix 1D build (typo `wtot` instead of `w_tot`) * refixed compile in RZ * check io process in chi_ave computation * updated test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Temporary fix: remove IOProcessor * Update Source/Diagnostics/ReducedDiags/ColliderRelevant.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Apply suggestions from code review * Remove `Debug` compilation mode from CI test * CI test analysis: check all particles have same charge * Use `m_beam_name` instead of `species_names` --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edoardo Zoni <ezoni@lbl.gov> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Luca Fedeli <luca.fedeli.88@gmail.com>
2023-08-22BTD RZ test: add missing checksum analysis (#4202)Gravatar Edoardo Zoni 1-0/+12
* BTD RZ test: add missing checksum analysis * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-20Include `J` in diagnostic output when an electromagnetic solver is not used ↵Gravatar Roelof Groenewald 4-4/+8
(#4116) * include current density in diagnostic output even if an electromagnetic solver is not used * do not redeposit current for the magnetostatic solver * update CI benchmarks for tests that previously did not register current density * fix remaining failing CI test * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * do not output current density in collision tests * update `JFunctor` constructor doc-string * code cleanup - reduce code duplication * specify `Ex Ey Ez Bx By Bz` fields to plot for collision CI tests * specify `Er Et Ez Br Bt Bz` as output for rz collision test * rename `InterpolateToDst` to `InterpolateMFForDiag` * only deposit current density once per diagnostic output (if not already deposited) * write deposited current for all directions into `current_fp` during diagnostic step deposition * use `amrex::make_alias` to directly deposit current density into `warpx.current_fp` during diagnostic step deposition * add class variable `solver_deposits_current` to `FullDiagnostics` so that there is only one place where the determination is made whether current should be deposited during diagnostic output * correct logic to determine `m_solver_deposits_current` --------- Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2023-08-17Add nodal electrostatic solver (#3982)Gravatar Arianna Formenti 2-0/+116
* added nodal electrostatic solver * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * sphere test for electrostatic nodal solver * add 3d single bunch test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * adds single bunch ci test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * updated tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * updated checksums nodal electrostatic * Improve readability * Change `assert` condition * Clean up --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edoardo Zoni <ezoni@lbl.gov> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2023-08-17Electrostatic sphere tests: add missing checksum analysis (#4198)Gravatar Edoardo Zoni 1-0/+8
2023-08-17Automated test for externally loaded fields in the boosted frame (#4188)Gravatar Ilian Kara-Mostefa 3-1/+207
* Implement boosted frame automated test (1D) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Implement boosted frame automated test (1D) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * time_chunk_size=50 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2023-08-12Transition to pyAMReX (#3474)Gravatar Axel Huebl 13-189/+144
* pyAMReX: Build System * CI Updates (Changed Options) * Callback modernization (#4) * refactor callbacks.py * added binding code in `pyWarpX.cpp` to add or remove keys from the callback dictionary * minor PR cleanups Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Added Python level reference to fetch the multifabs (#3) * pyAMReX: Build System * Added Python level reference to Ex_aux * Now uses the multifab map * Fix typo Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Add initialization and finalize routines (#5) A basic PICMI input file will now run to completion. * Regression Tests: WarpX_PYTHON=ON * Update Imports to nD pyAMReX * IPO/LTO Control Although pybind11 relies heavily on IPO/LTO to create low-latency, small-binary bindings, some compilers will have troubles with that. Thus, we add a compile-time option to optionally disable it when needed. * Fix: Link Legacy WarpXWrappers.cpp * Wrap WarpX instance and start multi particle container * Fix test Python_pass_mpi_comm * Start wrapper for multiparticle container * Add return policy Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update fields to use MultiFabs directly Remove EOL white space Removed old routines accessing MultiFabs Update to use "node_centered" * Fix compilation with Python * Update fields.py to use modified MultiFab tag names * Remove incorrect, unused code * Add function to extract the WarpX MultiParticleContainer * Complete class WarpXParticleContainer * Wrap functions getNprocs / getMyProc * restore `install___` callback API - could remove later if we want but should maintain backward compatibility for now * add `gett_new` and `getistep` functions wrappers; fix typos in `callbacks.py`; avoid error in getting `rho` from `fields.py` * Update callback call and `getNproc`/`getMyProc` function * Replace function add_n_particles * Fix setitem in fields.py for 1d and 2d * also update `gett_new()` in `_libwarpx.py` in case we want to keep that API * added binding for `WarpXParIter` - needed to port `libwarpx.depositChargeDensity()` which is an ongoing effort * Wrap function num_real_comp * added binding for `TotalNumberOfParticles` and continue progress on enabling 1d MCC test to run * add `SyncRho()` binding and create helper function in `libwarpx.depositChargeDensity` to manage scope of the particle iter * Clean up issues in fields.py * update bindings for `get_particle_structs` * Fix setitem in fields.py * switch order of initialization for particle container and particle iterator * switch deposit_charge loop to C++ code; bind `ApplyInverseVolumeScalingToChargeDensity` * move `WarpXParticleContainer.cpp` and `MultiParticleContainer.cpp` to new Particles folder * added binding for `ParticleBoundaryBuffer` * More fixes for fields.py * Fix: Backtraces from Python Add the Python executable name with an absolute path, so backtraces in AMReX work. See linked AMReX issue for details. * Cleaning * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix: Backtraces from Python Part II Do not add Python script name - it confuses the AMReX ParmParser to build its table. * Fix: CMake Dependencies for Wheel This fixes a racecondition during `pip_install`: it was possible that not all dimensions where yet build from pybind before we start packing them in the wheel for pip install. * MCC Test: Install Callbacks before Run Otherwise hangs in aquiring the gil during shutdown. * addition of `Python/pywarpx/particle_containers.py` and various associated bindings * Fix: CMake Superbuild w/ Shared AMReX We MUST build AMReX as a shared (so/dll/dylib) library, otherwise all the global state in it will cause split-brain situations, where our Python modules operate on different stacks. * add `clear_all()` to callbacks in order to remove all callbacks at finalize * add `-DWarpX_PYTHON=ON` to CI tests that failed to build * add `get_comp_index` and continue to port particle data bindings * Add AMReX Module as `libwarpx_so.amr` Attribute to pass through the already loaded AMReX module with the matching dimensionality to the simulation. * Fix for fields accounting for guard cells * Fix handling of ghost cells in fields * Update & Test: Particle Boundary Scraping * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * CI: Python Updates - modernize Python setups - drop CUDA 11.0 for good and go 11.3+ as documented already ``` Error #3246: Internal Compiler Error (codegen): "there was an error in verifying the lgenfe output!" ``` * CI: Python Updates (chmod) * Add support for cupy in fields.py * Add MultiFab reduction routines * CI: CUDA 11.3 is <= Ubuntu 20.04 * changed `AddNParticles` to take `amrex::Vector` arguments * setup.py: WarpX_PYTHON=ON * update various 2d and rz tests with new APIs * add `-DWarpX_PYTHON_IPO=OFF` to compile string for 2d and 3d Python CI tests to speed up linking * CI: -DpyAMReX_IPO=OFF * CI: -DpyAMReX_IPO=OFF actually adding `=OFF` * CI: Intel Python * CI: macOS Python Executable Ensure we always use the same `python3` executable, as specified by the `PATH` priority. * CMake: Python Multi-Config Build Add support for multi-config generators, especially on Windows. * __init__.py: Windows DLL Support Python 3.8+ on Windows: DLL search paths for dependent shared libraries Refs.: - https://github.com/python/cpython/issues/80266 - https://docs.python.org/3.8/library/os.html#os.add_dll_directory * CI: pywarpx Update our setup.py cannot install pyamrex yet as a dependency. * ABLASTR: `ablastr/export.H` Add a new header to export public globals that are not covered by `WINDOWS_EXPORT_ALL_SYMBOLS`. https://stackoverflow.com/questions/54560832/cmake-windows-export-all-symbols-does-not-cover-global-variables/54568678#54568678 * WarpX: EXPORT Globals in `.dll` files WarpX still uses a lot of globals: - `static` member variables - `extern` global variables These globals cannot be auto-exported with CMake's `WINDOWS_EXPORT_ALL_SYMBOLS` helper and thus we need to mark them manually for DLL export (and import) via the new ABLASTR `ablastr/export.H` helper macros. This starts to export symbols in the: - WarpX and particle container classes - callback hook database map - ES solver * CI: pywarpx Clang CXXFLAGS Down Move CXXFLAGS (`-Werror ...`) down until deps are installed. * GNUmake: Generate `ablastr/export.H` * CMake: More Symbol Exports for Windows * `WarpX-tests.ini`: Simplify Python no-IPO Also avoids subtle differences in compilation that increase compile time. * Update PICMI_inputs_EB_API.py for embedded_boundary_python_API CI test * Fix Python_magnetostatic_eb_3d * Update: Python_restart_runtime_components New Python APIs * Windows: no dllimport for now * CI: Skip `PYINSTALLOPTIONS` For Now * CMake: Dependency Bump Min-Versions for external packages picked up by `find_package`. * Fix F and G_fp names in fields.py * Tests: Disable `Python_pass_mpi_comm` * Wrappers: Cleanup * pyWarpX: Include Cleaning * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fields.py: Fix F and G Wrappers Correct MultiFab names (w/o components). * Remove unused in fields.py * Windows: New Export Headers - ABLASTR: `ablastr/export.H` - WarpX: `Utils/export.H` * removed `WarpInterface.py` since that functionality is now in `particle_containers.py`; removed parts of `WarpXWrappers.cpp` that have been ported to pyamrex * CMake: Link OBJECT Target PRIVATE * CMake: Remove OBJECT Target Simplify and make `app` link `lib` (default: static). Remove OBJECT target. * Fix in fields.py for the components index * Update get_particle_id/cpu As implemented in pyAMReX with https://github.com/AMReX-Codes/pyamrex/pull/165 * WarpX: Update for Private Constructor * Import AMReX Before pyd DLL Call Importing AMReX will add the `add_dll_directory` to a potentially shared amrex DLL on Windows. * Windows CI: Set PATH to amrex_Nd.dll * CMake: AMReX_INSTALL After Python In superbuild, Python can modify `AMReX_BUILD_SHARED_LIBS`. * Clang Win CI: Manually Install requirements Sporadic error is: ``` ... Installing collected packages: pyparsing, numpy, scipy, periodictable, picmistandard ERROR: Could not install packages due to an OSError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\hostedtoolcache\\windows\\Python\\3.11.4\\x64\\Lib\\site-packages\\numpy\\polynomial\\__init__.py' Consider using the `--user` option or check the permissions. ``` * Hopefully final fixes to fields.py * Update getProbLo/getProbHi * Set plasma length strength Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Fix fields method to remove CodeQL notice * Update Comments & Some Finalize * Move: set_plasma_lens_strength to MPC --------- Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> Co-authored-by: David Grote <dpgrote@lbl.gov> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> Co-authored-by: Dave Grote <grote1@llnl.gov> Co-authored-by: Roelof Groenewald <regroenewald@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-10Fix Python test due to recent openPMD-viewer update (#4177)Gravatar Remi Lehe 1-1/+1
2023-07-21Update inputs files in WarpX (#4103)Gravatar Weiqun Zhang 5-20/+20
Due to the recent changes in amrex::ParmParse, we must use the line continuation character '\' for values spanning multiple lines. For Parser expression, we could either double quotes to enclose the whole string or use `\` as line continuation. The old style multi-line values were removed in AMReX to avoid mistakes like algo.current_deposition = direct # galilean psatd.use_default_v_galilean # Forgot = 1 Here, `psatd.use_default_v_galilean` is silently ignored because with the old style multi-line support it becomes part of the values for the previous definition (i.e., `algo.current_deposition = direct psatd.use_default_v_galilean`). This case will now abort.
2023-06-30Allocate fewer `rho` components for ES, MS, hybrid-PIC solvers (#4036)Gravatar Remi Lehe 2-3/+3
* Allocate fewer components for `rho` * Fix compilation * Use two components with dive_cleaning * Fix Python script * Fix PICMI script for 1D CI test --------- Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>
2023-06-27Define new `InjectorFlux` object, and use it in `AddPlasmaFlux` (#4040)Gravatar Remi Lehe 2-6/+6
* Create flux injector object * Call new flux injector in AddPlasmaFlux * Update syntax in tests * Also test the flux parser * Remove the use of `density_min` and `density_max` for flux injection * Update PICMI interface * Update documentation * Remove .cpp file
2023-06-27Adding current density to Field Reduction reduced diagnostic (#3980)Gravatar Lizzette Corrales 2-4/+14
* Adding j in FieldReduction * Modiyfying input file with FieldReduced diag * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Source/Diagnostics/ReducedDiags/FieldReduction.H * updating Field Reduction Docs to include current density * Update Source/Diagnostics/ReducedDiags/FieldReduction.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * adding cuurent density BackwardCompatibility to Field Reduction diagnostic * including E dot j density using the modifyed Field Reduction * fixing picmi interface * adding Edotj to automated python test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Lizzette Corrales <lzcorrales@kong.dhcp.lbl.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com>
2023-06-16correct seperate --> separate (#3998)Gravatar Luca Fedeli 1-1/+1
2023-06-15Added external field loading from file to picmi.py (#3945)Gravatar Camille Woicekowska 2-60/+130
* Added external field loading from file to picmi.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Python/pywarpx/picmi.py Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> * Added documentation * Removed init, documentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Updated picmi version in requirements.txt * Updated picmi version in setup.py * Updated picmi version in requirements.txt * Updated name of call to picmi class * Adapted CI test for PICMI field loading from file * Added PICMI input script * Added .json file with new file name * fixed small errors * Fixed error in input script * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Removed old comments from code * fixed import, spacing in input script * fixed spacing * cleaned up input script * fixed typo * removed blocking factor * fixed name of test * correct ion species name * Added initial field to sim object --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com>
2023-06-12Ohm's law solver (hybrid kinetic-fluid extension) (#3665)Gravatar Roelof Groenewald 8-0/+2185
* Add "None" as an option for the Maxwell solver * fixed some of the reasons for failing CI tests * no longer pass `do_electrostatic` to `GuardCellManager` * renamed `MaxwellSolverAlgo` to `ElectromagneticSolverAlgo` * rename `do_electrostatic` to `electrostatic_solver_id` * rename `maxwell_solver_id` to `electromagnetic_solver_id` * start of hybrid solver logic * changes requested during PR review * remove `do_no_deposit` from tests without field evolution * added `HybridSolveE.cpp` * bulk of the hybrid solver implementation * mostly reproduce 1d cold ion mirror results * ion Bernstein modes reproduced with this version * fix bug with reduced diagnostic FieldProbe in 1d * added hybrid solver installation to PICMI and added example script generating ion-Bernstein modes * enable the use of `FieldProbe` default parameter values * use default field-probe values * steady progress * add `do_not_push` flag to picmi * possibly use nodal fields * added extra multifab for current calculated from curl B * added `CalculateTotalCurrent` functions * rewrote implementation to calculate J x curl B on a nodal grid first * fill boundary for auxiliary MFs used during hybrid E solve * properly handle nonzero resistivity * updated hybrid model example * clean up example scripts * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed invalid memory access for GPU and other code cleanups * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * refinements on the example scripts * added ion beam instability example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added EM modes and ion beam examples to CI test suite * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * started docs section on the hybrid model * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * more progress on documentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added ion Landau damping verification test / example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add checksum benchmark for Landau damping example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added fields.py wrapper to access total current density in hybrid case * refactored the charge deposition fix to be performed with the field data rather than individual particles * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * also correct current density at PEC boundary * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * made resistivity a parsed function of `rho` * work on PEC boundary condition * corrections pointed out during code review * fix build fails due to unused variables * fix issue with GPU builds * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * actually apply rho boundary correction in EM case * take one sided derivative at PEC boundary when calculating div Pe * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * actually apply rho boundary correction in EM case * removed specific treatment of E-field on PEC boundary for Ohm's law solver * first round of CI fixes * second round of CI fixes * added description of deposition logic with PEC boundaries to documentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * third round of CI fixing * move J and rho boundary handling to after `SyncRho` and `SyncCurrent` calls * properly order the application of boundary conditions on rho, for electrostatic simulations * fourth round of CI fixing * moved calculation of total current (Ampere's law) to seperate function * add random seed specification to `picmi` * code clean-up -> renamed hybrid model to hybrid-PIC model * added magnetic reconnection example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * code cleanup & benchmark updates * update PICMI class name for hybrid solver to `HybridPICSolver` * don't apply J field boundary in * don't apply J field boundary in `MultiParticleContainer::DepositCurrent` * apply changes requested during code review * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Loosen tolerance on failing CI test * Removed unused variable * code cleanup: make use of `MultiParticleContainer::DepositCurrent` in `AddSpaceChargeFieldLabFrame` * switch to using a rho_fp_temp multifab for old and averaged charge density field, also no longer require particles to move only one cell per step * use `ablastr::coarsen::sample` namespace in `HybridPICSolveECartesian` * switched to using `MultiFab::LinComb` instead of self written GPU kernels to calculated averaged or extrapolated current density * add verbosity flag for the Ohm solver tests * deal with fine versus coarse patches * add theoretical instability growth / damping rates to hybrid-PIC examples * update ion-Bernstein mode plot in documentation * move the `ApplyRhofieldBoundary` call to after `SumBoundary` * use a uniform calculation for the number of cells a given index is from the boundary * remove unused variable * limit number of ghost cells updated during PEC BC application * the number of ghost cells to consider depends on whether the field is nodal or not * attempt 1 to fix failing CI tests * attempt 2 to fix failing CI tests and code cleanup * attempt 3 to fix failing CI tests * attempt 4 to fix failing CI tests and docs cleanup * switched to using bibtex citations * move hybrid solver input parameters documentation to its own section * clean up ion beam instability analysis script * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * add inline comments describing the meaning of each argument for the `amrex::MultiFab::LinComb` calls used * make `HybridPICSolver` a child class of `picmistandard.base._ClassWithInit` * apply changes requested during code review * add warning about using hybrid-PIC solver with Esirkepov current deposition * add Stanier 2020 reference to recommend linear particles with hybrid-PIC * add call to FillBoundary for `current_fp` - needed for accurate interpolation to nodal grid * changes requested from code review * Apply suggestions from code review Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * include physics accuracy check for ion beam instability; switch CI tests to use direct current deposition * reset benchmark values after switching to direct current deposition * update ion beam instability benchmark * minor changes requested during code review * remove guard cells for `enE_nodal_mf` as well as corresponding `FillBoundary` call * refactor: moved hybrid-PIC specific multifabs and `CalculateElectronPressure()` to `HybridPICModel` * add assert that load balancing is not used with the hybrid-PIC solver since the new multifabs are not yet properly redistributed * move `CalculateCurrentAmpere` to `HybridPICModel` * refactor: moved `HybridPICSolveE` to `HybridPICModel` class --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2023-06-12Replace amrex::Abort with WARPX_ABORT_WITH_MESSAGE (#3965)Gravatar Luca Fedeli 1-1/+1
* replace amrex::Abort with WarpX macros * use amrex::Abort in a GPU kernel * use amrex::Abort in a GPU kernel * use amrex::Abort in a GPU kernel * use amrex::Abort in a GPU kernel * use amrex::Abort in a GPU kernel * use amrex::Abort in a GPU kernel * adding back missing include * use amrex::Abort in a GPU kernel * use amrex::Abort in a GPU kernel * use amrex::Abort in a GPU kernel * bump precision
2023-06-12precommit: make sure isort output is compatible with black (#3981)Gravatar Ryan Sandberg 1-2/+4
* make sure isort output good for black
2023-06-08Read RZ laser files produced by lasy (#3910)Gravatar Ilian Kara-Mostefa 6-8/+245
* Starting to develop on the integration of lasy RZ coordinates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * SImplify attribute of geometry for comparison * Start developing RZ block * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Implement legacy mode * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix file_name initialization for RZ test * Clear commented-out code * Change permission * import sys in analysis_2d_binary.py & add checksum test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add explanations in class file and update the docs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * ignore y_min and y_max allocation in 2D * fix syntax * Implement warnings, improving docs, fix indentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Starting to develop on the integration of lasy RZ coordinates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * SImplify attribute of geometry for comparison * Start developing RZ block * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * rebase legacy_mode * delete obsolete file * Starting to develop on the integration of lasy RZ coordinates * Start developing RZ block * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * delete obsolete file * fixing rebase * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * continuing RZ implementaion development * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Implement RZ lasy file reading & automated test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix merge * Starting to develop on the azimuthal decomposition * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Implement azimuthal modes reading for RZ lasy files * fix second component of 'lo' and 'hi' * Fix azimuthal modes reading & compute E_max from formula * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Allocating time_chunk_size outside GPU ParallelFor * Update the docs * Allocate n_rz_azimuthal_components outside GPU ParallelFor * Fix checksum test * Replace Abort message with new macro * Make narrowing conversion explicit using static_cast for 3D and RZ lasy files * new attempt to fix the checksum test * reduce stop_time in the inputs_file to fix the checksum test * Update checksum * Update documentation * Fix indentations, spaces and move 'intenal_fill_amplitude_uniform' * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Split 'internal_fill_amplitude_uniform' for lasy files reading * Fix comments in analysis_from_RZ_file.py * Read current_time_chunk_size instead of time_chunk_size set by the user * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove unsused time_chunk_size variable * Dynamically resize buffers for every `read_chunk` * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix compilation --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2023-06-05Add waterbag generation in injector (#3698)Gravatar Davide Terzani 2-2/+125
* Add waterbag generation in injector * Fix typo in average * Renamed distribution from waterbag to uniform * Updated doc * Fixed typo in Docs * Add test for uniform distribution * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed test * Test now reads bin centers * Fixed assertion truth * Fixed histogram normalization in test * Update Checksum Created via: ```bash ./run_test.sh initial_distribution ``` --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2023-06-02Histogram 2D (#3883)Gravatar Juliette Pech 2-3/+78
* Histogram 2D A new functionality has been added. The files ParticleHistogram2D.cpp and ParticleHistogram2D.H allow the user to plot a 2D histogram that computes the number of particles for a given abscissa and ordinate. * Modification to solve NVCC 11.8.0 GNUmake issue ParticleHistogram2D.cpp added into Make.package * Test for using openPMD Test to activate the plug in for openPMD : #ifdef WARPX_USE_OPENPMD Error message otherwise. * Test for using openPMD continued * New version of the ParticleHistogram2D option The user can now choose the value of the weight via a value_function. Another parameter was therefore added : w The documentation has also been updated and an example (input file + python script for postprocessing) has been added to Examples/Physics_application/laser_ion * Python script updated The python script written for postprocessing the ParticleHistogram2D option has been renamed to pass a check test. The argparse module has also been added to the code instead of the originally implemented command line interaction. Now the user must pass arguments when executing the script. * Input files of the laser-ion example merged The input file originally created for the 2D histogram has been merged with the initial input file "inputs" of the example. * Correction of a display bug * Help function for openPMD files A help function has been created to find the correct file type when writing openPMDfiles. Another update : the file type will be returned in the warpx_used_inputs file after running a simulation. * Typo fixed in the python script used for 2D histograms visualisation Typo for the shape of the data * Typo in the help function file created * Some typo fixed for checks Modifications in the input file of the laser-ion example and in the ParticleHistogram2D.cpp file. * Typo fixed : declaration on the WarpXOpenPMDFileType function outside #ifdef WARPX_USE_OPENPMD * Typo for failing check NVCC 11.8.0 GNUmake * Typo for failing check NVCC 11.8.0 GNUmake (continued) * Typo for failing check NVCC 11.8.0 GNUmake (continued, abort message) * .cpp file added to Make.package * Time added to the data Simulation time is now visible on Hist2D plots * Update Docs/source/dataanalysis/reduced_diags.rst Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Docs/source/usage/parameters.rst Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Examples/Physics_applications/laser_ion/analysis_histogram_2D.py Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Examples/Physics_applications/laser_ion/analysis_histogram_2D.py Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Docs/source/usage/parameters.rst Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Docs/source/usage/parameters.rst Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Diagnostics/ReducedDiags/ParticleHistogram2D.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Diagnostics/ReducedDiags/ParticleHistogram2D.H Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Diagnostics/ReducedDiags/ParticleHistogram2D.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Diagnostics/OpenPMDHelpFunction.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Diagnostics/OpenPMDHelpFunction.H Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Multiple hist2D active in the same simulation now possible The laser-ion example as well as the documentation have been modified accordingly. * Display enhancement for the laser-ion example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-05-19Implement legacy mode for external laser file reading (#3923)Gravatar Ilian Kara-Mostefa 10-60/+325
* Implement legacy mode * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix file_name initialization for RZ test * Clear commented-out code * Change permission * import sys in analysis_2d_binary.py & add checksum test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add explanations in class file and update the docs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * ignore y_min and y_max allocation in 2D * fix syntax * Implement warnings, improving docs, fix indentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2023-05-16Bug fix - PEC - Remove duplicate boundary cell updates for rho and J (#3890)Gravatar Roelof Groenewald 1-0/+5
* break application of PEC to rho into separate loops over boxes * round #1: fix failing CI tests * also apply the fix to the `ApplyPECtoJfield` * round 2: fix failing CI tests * round 3: fix failing CI tests * refactor PEC handling for charge and current density * removed unused variable * round 4: fix failing CI tests * Fix `mirrorfac` calculation for `rho` * only apply rho and J PEC boundaries for Cartesian grid (for now) in `SyncCurrentAndRho()` * use the same kernel to apply PEC boundary to rho and J * perform J and rho PEC application for RZ but warn about incorrect results if r_max is PEC * do not apply PEC boundary for rho and J to r-max in RZ * set warning level to medium and increase abort_on_warning_threshold to high for failing CI tests
2023-05-08Enable field ionization from PICMI (#3298)Gravatar Neïl Zaim 2-7/+129
* Enable field ionization from PICMI * Implement Dave's suggestions and add automated test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update test benchmark * Add docstring for FieldIonization class --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-05-07Implement reading of laser files produced by lasy (#3871)Gravatar Ilian Kara-Mostefa 9-236/+798
* Imported openPMD * Unable to add E * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Source/Laser/LaserProfilesImpl/LaserProfileFromTXYEFile.cpp * Updated read data t chunk * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Began modifying parse_tyxe_file * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * set coordinates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * corrected errors * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Clean up .H file * Extract grid coordinates * Corrected field name * Implement laser oscillations * More correct position * More correct position * Updated test script, corrected laser normalization * Cleaned up code * Began editing analysis.py (needs debugging) * Support reading complex data * Update AMReX depsndency to use Bcast with complexs * Update test * Update Source/Laser/LaserProfilesImpl/LaserProfileFromTXYEFile.cpp * Correct the implementation of the test with Gaussian profile, fix and clean up previous code * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add `lasy` in dependencies * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update documentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add checksum regression test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add enabling condition if WarpX is compiled with OpenPMD support * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update lasy download link * Updating analysis.py * Update LaserProfileFromTXYEFile.cpp * Fix compilation in 1D * Update LaserProfileFromTXYEFile.cpp for enabling condition if WarpX is compiled with OpenPMD support * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update LaserProfileFromTXYEFile.cpp * Change unused vectors to scalars and cleanup code * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update automated test * Implement reading chunks of openPMD file as an input parameter * Update checksum * Update warning message if WarpX is not compiled with openPMD support * Do not output By (too sensitive to noise) * Remove By from checksum * Update Source/Laser/LaserProfilesImpl/LaserProfileFromTXYEFile.cpp * Update Source/Laser/LaserProfilesImpl/LaserProfileFromTXYEFile.cpp * Update Source/Laser/LaserProfilesImpl/LaserProfileFromTXYEFile.cpp * Update inputs file for chunks reading * Correct dimensions assignment * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Code consistent with axilabels * Start support for 2D and 1D * Update LaserProfileFromTXYEFile.cpp for 2D reading * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Implementation of a 2D test * Implementation of 1D reading & 1D test * Fix call to trilinear_interp * Fix indentation * Implement RZ reading & test & fix 2D Checksum test * Update docs * Update WarpX-test.ini --------- Co-authored-by: Camille Woicekowski <camille.meala@berkeley.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2023-05-04Fix: Laser-Ion Example Gather (#3894)Gravatar Axel Huebl 1-0/+4
Guarantee improved plasma stability for 2D with very low initial target temperature when using Esirkepov current deposition with energy-conserving field gather (default).
2023-05-02Release 23.05 (#3887)Gravatar Axel Huebl 1-2/+4
* AMReX: 23.05 * PICSAR: 23.05 * WarpX: 23.05 * Update ES EB RZ Tests - slightly relaxed Phi - better selection of r outside cutcells
2023-04-26Shared memory charge and current deposition (#3368)Gravatar Andrew Myers 2-1/+4
* Use GPU shared memory to accelerate charge deposition (#66) * WIP Apply charge deposition unconditionally in scratch memory * Ensure enough threads to touch every value in the array, even if there are no particles * Zero out the shared memory before accumulating into it * Replace box-aware accumulation of final results with simple pointers * Remove unused code * WIP * Account for shared memory being allocated per-block, not per grid/kernel * Wording * Fall back to non-shared memory for cases where the grid size is too big to fit, for now * Filter out additions of 0.0 from atomic accumulation * Restore non-GPU code path * Pick apart #if stuff to allow better formatting and comprehension * Fix egregious whitespace failure * Abort on insufficient shared memory, rather than falling back to global memory * Fix silly whitespace * Fix stray tab character * Sort and bin particles, pass bins to charge deposition * Contribute on a binned tile basis; memory errors now * Initialize array to the extent we actually allocated * Make sure we initialize the vector the tboxes with invalid Box objects * in 2D, we make sure we use the same particle position to tile box mapping as amrex * go ahead and skip empty bins in deposit charge * Quiet warning from HIP * Avoid signed/unsigned comparison * Code compiles for CPU ... * Rename intermediate buffer back to reduce extraneous diff bits * Remove another extraneous diff bit * Leave DPC++ out in the cold, since it expects different syntax for GPU-specific code * Reset failing value of rho that only slightly changes * Try tiling over ng_rho to capture particles moved into guard cells * Match box expansion in both call sites - maybe the third is also necessary * Grow last box by ng_rho as well. * Match macro syntax * Use WarpX dimensionality macros instead of AMREX_SPACEDIM * Add support for 1D case * Update benchmark checksums for ME tests * Fix macro used for 1D * Fix CUDA compilation * Rename variable to simplify diff * Clear up assertions now that stuff is working * Fix comment referring to current in ChargeDeposition.H * Fix warning about unused variable after assertion change * add runtime option * Convert flag variable from int to bool * Switch AMREX_SPACEDIM conditions to use WARPX_DIM_* macros * Once again, leave DPC++ out in the cold, as it doesn't support the same syntax as CUDA and HIP * Grow charge deposition boxes by the necessary amount * Mark a variable only used for assertions to suppress warnings * Fix compilation error for 1D * Re-add missing 1D support * Fix other bits of codfe specific to CUDA and HIP, and not DPC++ * restore missing accumulation of thread local charge into main fab. * reset benchmark for background_mcc because randomization makes it very sensitive * reset benchmark for Langmuir_multi_psatd_div_cleaning because diffing field is a numerical artifact * Calm nvcc about function missing a return * reset benchmark for background_mcc because it's randomized and numerically chaotic * reset benchmark for LaserAccelerationBoost because of numerical shift in momentum from charge deposition order * Remove extra nesting level * Skip sorting the particles and just access them according to the binned permutation * Load permutation pointer outside GPU kernel * Revert background_mcc benchmark values * Loosen overly-strict checksum tolerances in single-precision tests, rather than changing target values * Revert embedded_circle * Convert AMREX_ALWAYS_ASSERT to AMREX_ASSERT for particle bounds checking * Match assertion macro change from #2939 * Fix indentation * Disable shared memory charge deposition by default * Ignore variable only used in assertion * Add documentation of added input parameter warpx.do_shared_mem_charge_deposition * Add comments as suggested by Remi * Docs: Fix syntax issues in parameters.rst * Convert error check to unconditional assertion as requested * Make some arguments const to ease refactoring * Finished DepositCurrent function Ready to call the function from CurrentDeposition.H, but currently there is only a dummy function there * AMReX: Weekly Update * Reset: `reduced_diags_single_precision` * Reset: `background_mcc_dp_psp` * Merged with develop. runs on mpi no gpu * All funcs implemented. Compiles with bugs * Fixed typo in CurrentDeposition * Working on 2D version. there is bug jz doesn't line up correctly * Fixed 2d bug * Removed some debugging lines * Cleaning up comments * Added an input param for threads per block * Added a variable NS and START/STOP * Added a region for kernel * Not working on tilesize > 1 1 1 * Implemented Andrews new algo for max tilesize * Reduce the amount of shared memory needed by re-using the same buffer for all three components * Made default tilesize sort_bin_size LAST V1 COMMIT * bugfix - don't add 0.0 cells back to global memory. * Need to take abs before checking > 0.0 * Ran Whitespace Fixer As instructed * Updated Comments * change default tpb for current deposition to 128 * clean up comments * quiet compiler warning * remove unused variables * refactor shared current depo code * forgot to check in file * fix cpu compilation * fix uninitialized * fix typo * fix bad merge * Fixed default tilesize bug Previously had defualted shared_tilesize to sort_bin_size. This was overwritting the shared_tilesize. Some scanning shows that sort_bin_size isn't a very good default for tilesize anyways, so the new default is 1 1 1. * changed shared tilesize default to 6 6 8 Decision based on scan over tilesizes and ppc by @atmyers and @kaplannp * Put in switches for default tilesize 288 3d 144 2d Tested correctness in 2 and 3 d * Simplified parcticle contribution section In accordance to @AlexanderSinn feedback, and tested RZ, 2D, 3D * Cleanup tbox construction and depos->(depos+1)/2 in accordance to changes proposed by @AlexanderSinn. Tested on 3D 2D and RZ * Restored shared to previous version from 6acab48 Changes from before broke single precision * Found new spot to benefit from (depos_order+1)/2 * Cleaned up sloppy comments * Throw error on shared if no hip or cuda This commit makes the assumption that if you use shared, you must be using HIP or CUDA. This allows us to remove a bunch of macros that tried to quietly revert to non shared if you didn't use HIP/CUDA, and we now throw error if you try to run without HIP/CUDA * More cleanup to compile and test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add cost to GPU clock conditional Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Particles/Deposition/CurrentDeposition.H Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * add cost to GPU clock conditional Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * whitespace fix Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Updated tilesize docs, and change 1d/rz default * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added docs for tpb * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Changed grow (depos_order+1)/2->depos_order Turns out, above fails for shape 2 * Change default to non share, and add error check throws errors if you try vay or esirkepov with shared, and defaults to not using shared for all algos. * update to use ablaster kernel timer Compiles and runs, but at step 80 diverges from dev --------- Co-authored-by: Phil Miller <unmobile+gh@gmail.com> Co-authored-by: Phil Miller <phil@intensecomputing.com> Co-authored-by: Tools <warpx@lbl.gov> Co-authored-by: kaplannp <kaplannp@gmail.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: kaplannp <56896283+kaplannp@users.noreply.github.com> Co-authored-by: kaplannp <kaplannp@whitman.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-23Import external E/B fields from openPMD files (#3584)Gravatar Phil Miller 4-0/+221
* Squashed commit of the following: commit 5452b0a818e952fc8ac989a306b0ea83738243f1 Merge: a21dda0f 90b72e80 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Fri Sep 23 13:22:03 2022 -0700 Merge branch 'development' of https://github.com/ECP-WarpX/WarpX into add_external_fields commit a21dda0f1bad8ee8601104c3322631d5f385ffdd Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Fri Sep 23 13:13:23 2022 -0700 Update commit 3394416cc0f7dc1e4742249b469957bedbfd5e84 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Wed Aug 24 13:37:30 2022 -0700 Update Examples/Tests/LoadExternalField/* commit f0650b02e2f2d8d9719163ed5d4fd932a9d62a5b Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Wed Aug 24 12:41:11 2022 -0700 parameters.rst added commit a96a3eb3a181d6e1a649a43bc9eb2e00e4e0ef57 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Thu Aug 18 15:15:43 2022 -0700 Add 3D test commit caf213cdff02213cf0ff7389b399898bc76951b5 Merge: e85a7105 2b60afe8 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Thu Aug 18 12:02:35 2022 -0700 Merge branch 'add_external_fields' of https://github.com/Yin-YinjianZhao/WarpX into add_external_fields commit e85a7105dceb80bc8769062a306248f57ac0939d Merge: d00ce279 642f6c0f Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Thu Aug 18 12:01:59 2022 -0700 Merge branch 'development' of https://github.com/ECP-WarpX/WarpX into add_external_fields commit 2b60afe876b6e4400e9f2676824ec94a4728c468 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu Aug 18 19:01:58 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit d00ce2790ae56148bd717baa7c8e074a2d12a6bf Merge: fbaf5226 c21244d1 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Thu Aug 18 12:01:42 2022 -0700 minor commit fbaf5226ee92444b618029ad56722f8e54918448 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Thu Aug 18 11:57:46 2022 -0700 The automated test of RZ passed, cleaning up needed. commit c21244d103e3eb245ebb1d3b9d2c4b016afd8671 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed Aug 17 20:51:59 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 0a52f2976b58cdbb48673387decce61aabf61561 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Wed Aug 17 13:51:40 2022 -0700 Add RZ test, but has a bug. commit 2c6e1537e9fa1f630134e64800b2d509088481b8 Merge: d3b6b0cd b4686616 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Wed Aug 10 13:37:01 2022 -0700 Merge branch 'development' of https://github.com/ECP-WarpX/WarpX into add_external_fields commit d3b6b0cd8eb34a5832bc8b439e96744f7a01a2ce Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Wed Aug 10 13:36:36 2022 -0700 Do not use WARPX_EXTERNAL_FIELD commit a32207ab2c4476feab0cb4b1e9a65a6181c7bf81 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Wed Aug 10 10:50:18 2022 -0700 In the middle of clean up. commit dcfcb02b9e053391c59cef50c692e84cf379fb8a Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Tue Aug 9 11:08:42 2022 -0700 RZ OpenPMD bug fixed, but code is messy, and chunk load is not done. commit dec17c35d025ac4d40dcaca4b68853959e176782 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Tue Aug 9 10:43:58 2022 -0700 Has bug using RZ OpenMPD commit b32e6efdd766f5986d66b213479d7c84587fca7e Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Fri Aug 5 13:17:04 2022 -0700 Add OpenPMD 3D. commit 7b7f48e2ae751d0393703c912116f5cb4d4dffbc Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Thu Aug 4 15:50:00 2022 -0700 Revert "minor" This reverts commit 01e022958bad3057737e57fda4ecfaed22778b51. commit 01e022958bad3057737e57fda4ecfaed22778b51 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Tue Aug 2 15:03:24 2022 -0700 minor commit 774e591959fce76f94dcb96ae17f43c71ee7b931 Author: Yin-YinjianZhao <yinjianzhao@lbl.gov> Date: Fri Jul 29 11:13:14 2022 -0700 Make 1d work commit 5db4e862104459e5511dad9869764866dc88e62d Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Fri Jul 29 10:27:03 2022 -0700 Make xz working commit 03c3d0062e301c1dd525a50f7ea84c2ccad6d679 Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Fri Jul 29 09:38:43 2022 -0700 Make rz workiong commit 8864a1780606bfa68e842d6902d28a34da659dc8 Merge: 0c1c7b7b a514e793 Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Wed Jun 22 14:02:05 2022 -0700 Merge branch 'add_external_fields' of https://github.com/Yin-YinjianZhao/WarpX into add_external_fields commit 0c1c7b7bda98549559d44125bb48e78ac6af24aa Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Wed Jun 22 14:01:42 2022 -0700 Fix a bug. commit a514e793cb5e30591debc475082cc48f9172ee25 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed Jun 15 19:47:43 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit dd3c3749e2793c8c489652a8152c166def995514 Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Wed Jun 15 12:47:23 2022 -0700 Use txt file. commit 61fb96d9219598d10dab6a729eb4db7278583d2e Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Thu May 26 13:51:58 2022 -0700 Now the loaded external field does not match the provided external field data. commit 7354a1abcd3b36e97d2145eff0c4b1da0a3aca27 Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Wed May 18 15:21:15 2022 -0700 Try to add new arguments in the doGatherShapeN function, such that external fields can be added. commit 3a0db5fcbaf4298c7cf59ba4443f3cdf7a21094b Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Tue May 10 14:35:53 2022 -0700 Changed to mfi.growntilebox() to include the guard cells. commit 33e3393eb6bf769a2d92043c1012796b8212e653 Merge: 53201644 32fe8aac Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local.dhcp.lbl.gov> Date: Thu May 5 13:37:24 2022 -0700 A bug needs to be fixed related to the growth of cells. commit 53201644322ae2a65c121a6f0559cda874edd98d Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local.dhcp.lbl.gov> Date: Thu May 5 13:35:39 2022 -0700 A bug needs to be fixed related to the growth of cells. commit 32fe8aacc16a749910956e28120e31f1807f3bc1 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue May 3 22:54:42 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit f434bff0e12643ba03fc76b1693c4875ef799fc6 Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Tue May 3 15:54:25 2022 -0700 In the middle. commit 698e8f3e69dac5945b332c67570272bf2f4ae168 Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local.dhcp.lbl.gov> Date: Tue May 3 09:32:54 2022 -0700 In the middle. commit 9d9f88d59820e00eed0e962c8c8905d3f1964083 Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Wed Apr 27 14:07:31 2022 -0700 In the middle of reading data. commit 3640e134fa0970b6b4ec0bf7f1c7f779c730b9a1 Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Thu Apr 21 09:43:06 2022 -0700 Draft. commit 85e16cafbf65cf502b82943d5bae98c4e1d750df Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Mon Apr 18 15:15:22 2022 -0700 Minor: change tag. commit 0b7d2723c225cc4eed09eb58ad7f049d6baa650a Author: Yinjian Zhao <yin@Yinjians-MacBook-Air.local> Date: Mon Apr 18 15:04:19 2022 -0700 Allocate MultiFabs for the external E and B fields. * Conditionalize compilation on openPMD support * Switch bit-flag integer configuration to separate booleans * Clean up and modernize allocation and reading logic * Roll back addition of external fields in all calls down to doGatherShapeN * Do away with separate MultiFABs for file-read field values, and just read into the main ones * Check that solved and externally-prescribed fields are mutually exclusive * Clean up compilation issues * Support GPUs * Correct data sets URLs * Fix compilation for 1D * Fix some GPU issues * Extract elements of various random little types that aren't GPU-friendly * Run RZ test along with the others, not with the 2D tests * Fix complaint about unused variable * Fix complaints about unused variable from 1D * Clean up 1D warning issues harder * Clone the example dataset repository directly, like warpx-data * Allow composition of external and internal fields * Go back to reading external field into a separate MultiFAB * Vaguely working for lab frame electrostatic case * Fix copy-paste errors * Replace magic constants by enumerators * Get indexing order right for RZ * Put external field contribution in the right place * Fix GPU and unused variable issues * Match renamed input variable * Update input parameters * reset benchmark for LoadExternalField3D because data actually get loaded now * reset benchmark for LoadExternalFieldRZ because data actually get loaded now * Drop unused includes * Read data once for all boxes * Guard against unimplemented mesh refinement support * Rename function to slightly better reflect substance * Use existing linear interpolation routines * Specify type argument for interpolation to avoid mixture * Account for Array4 indexing in Fortran order * Address Edoardo's review comments * Support load balancing * Add assertions of assumptions about input file format * Move assertion about max levels to earlier in initialization * Error in XZ case since it's untested * Don't pretend implementation covers XZ * Name variables to correspond to dimensionality * Reword comment per request * Correct typos * Add issue numbers for different unimplemented bits, and guard 1D case * Fix comment about RZ ParallelFor * Fix reStructuredText syntax * Shift 2D case to the unimplemented path to avoid unused parameter/variable warnings * Use 2020+ Curl Command * Support older curl --------- Co-authored-by: Tools <warpx@lbl.gov> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2023-04-20Add check in `addPlasma` and `addPlasmaFlux` to respect `random_theta` (#3585)Gravatar S. Eric Clark 1-1/+1
* Adding additional check in addPlasma and addPlasmaFlux to respect the random_theta flag, otherwise acts deterministically. * Reset RZ benchmarks --------- Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>
2023-04-19Correct sign of the `ChargeOnEB` diagnostic (#3851)Gravatar Remi Lehe 1-1/+1
* Correct sign of the ChargeOnEB diagnostic * Properly indent documentation
2023-04-12Reflect density from non-periodic boundaries during deposition (#3711)Gravatar Roelof Groenewald 1-1/+1
* refactored the charge deposition fix to be performed with the field data rather than individual particles * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * also correct current density at PEC boundary * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * corrections pointed out during code review * fix build fails due to unused variables * fix issue with GPU builds * actually apply rho boundary correction in EM case * first round of CI fixes * second round of CI fixes * added description of deposition logic with PEC boundaries to documentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * third round of CI fixing * move J and rho boundary handling to after `SyncRho` and `SyncCurrent` calls * properly order the application of boundary conditions on rho, for electrostatic simulations * fourth round of CI fixing * don't apply J field boundary in `MultiParticleContainer::DepositCurrent` * apply changes requested during code review * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Loosen tolerance on failing CI test * Removed unused variable * deal with fine versus coarse patches * move the `ApplyRhofieldBoundary` call to after `SumBoundary` * use a uniform calculation for the number of cells a given index is from the boundary * remove unused variable * limit number of ghost cells updated during PEC BC application * the number of ghost cells to consider depends on whether the field is nodal or not --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2023-04-10Lattice: Line Docs & Rename (#3815)Gravatar Axel Huebl 2-6/+6
* Lattice: Line Docs & Rename Rename the `lattice` element type to `line` and add documentation for it. * Add `{}` for Dave :)
2023-03-23Gaussian beam: allow 8-fold symmetry option (#3768)Gravatar Ryan Sandberg 1-0/+2
* add 8-fold beam symmetrization * Improve docs and fix examples * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix signature bug, can compile * fix example * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2023-03-22CI: clean up Langmuir tests (#1613)Gravatar David Grote 12-14/+19
* Rewrote README for Langmuir regression tests * Removes the Python_Langmuir regression test * Update to include 1-D * Clean up file names --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>
2023-03-09New user input for grid type (collocated, staggered, hybrid) (#3683)Gravatar Edoardo Zoni 11-19/+13
* Introduce `warpx.grid_type` parameter * Replace `or` with `||` * Update examples with new user input syntax * Fix `if` condition * Improve error message * Fix `if` condition * Fix bugs * Fix warning * Fix RZ * Debugging * Fix RZ * Fix bug * Clean up * More changes: - set default algo parameters with hybrid grid - all hybrid input parameters under warpx name * Set default field gathering algo for hybrid grids * Update documentation
2023-03-07Add test for DD fusion with intra-species collisions (#3660)Gravatar Edoardo Zoni 2-0/+149
* Add test for DD fusion with intra-species collisions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix test, add analysis --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-27Change plotfile RZ allowed diags to r,t from x,y (#3663)Gravatar Ryan Sandberg 17-26/+45
* change plotfile RZ allowed diag to r,t from x,y * Change labeling in checksums * add rz silver mueller analysis script * make analysis_silver_mueller_rz.py executable * change x,y fields to r,t in more tests * x->r in MR RZ checksums * correct analysis for plotfiles saved as 'boxlib' * add self to creator list * change rz diags in PICMI * correct PICMI changes * another y->t in an rz test * update picmi plotfile rz btd names * review suggestion to condense analysis * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> --------- Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2023-02-22Reduced diagnostics: charge on the embedded boundary (#3648)Gravatar Remi Lehe 3-14/+45
* Prepare structure to compute charge inside boundary * Add calculation without embedded boundaries * Use EB area fraction * Skip cells that are not cut-cells * Choose point outside of the EB * Skip covered or regular boxes * Only compile with EB and 3D support * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add test for charge on EB * Add automated test * Add automated Python test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Avoid compilation error * Enable PICMI test * Rename ChargeInsideBoundary to ChargeOnEB * Update comments * Add parser for weighting * Call weighting function * Call weighting function * Add documentation * Update Python test * Add Python test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix compilation errors * Fix access of attribute on GPU * Use difference in surface area * Pick smaller radius in test This is in order to avoid the influence of the boundaries * Update benchmark * Update benchmark * Properly add diagnostic * Update radius in analysis * Update analysis script * Relax tolerance * Fix tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Python tests * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Test one-eighth from Python * Add one-eighth charge in tests * Handle ChargeOnEB * Remove bug when handling charge on eb * Fix Python errors * Fix Python issues * Use more natural setting of tilebox --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2023-02-22Add option to increase `max_step` or `stop_time` to fill BTD (#3693)Gravatar Ryan Sandberg 1-1/+1
* add option to increase max_step to fill BTD * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * make sure code compiles locally * allow for unspecified max step if setting by BTD * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * clarify docs, match default max_step value * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Apply suggestions from code review shortening flag name * add example input script, fix bugf * check stop_time and max_step * account for stop time * Fix logic, improve documentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-21Fix Silver-Mueller boundary condition in 1D (#3703)Gravatar Remi Lehe 1-0/+51
* Fix Silver-Mueller boundary condition in 1D * Use WARPX_ZINDEX * Add automated test * Add benchmark
2023-02-21Renamed "particle_vel" to "particle_mom" (#3672)Gravatar Davide Terzani 27-84/+84
* Renamed particle_vel to particle_mom * Changed vel to u * Updated gitignore with vscode-specific folder * Updated docs for single particle * Revert "Updated gitignore with vscode-specific folder" This reverts commit cb44ef8d66c123daa93d6a13d5a1d88416e866bb. * Fixed typo * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed other typo * Add species indication in warning --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-21Add FieldReduction and ParticleHistogram to PICMI (#3697)Gravatar David Grote 1-3/+25
* Added FieldReduction and ParticleHistogram to ReducedDiagnostics * Add tests to reduced_diags/PICMI_inputs_loadbalancecosts.py * Clean up ReducedDiagnostics setting of argv
2023-02-01Fix NUniformPerCell for 1D (#3659)Gravatar David Grote 1-33/+33
* Fix NUniformPerCell for 1D * Fix CI benchmarks
2023-01-17Modify refined injection CI test for anisotropic ref ratio (#3605)Gravatar Prabhat Kumar 1-5/+6
* Modify refined ijection CI to account for anisotropic ref ratio * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * change n_move based on new dt * change variable name to be more specific * Update Regression/WarpX-tests.ini Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * reset benchmark for RefineInjection because now it uses anisotropic refinement ratio * add comment to show the formula for n_move * Reset benchmark of `RefinedInjection` * Remove wrong benchmark file Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>
2023-01-13EB potential python interface (#3624)Gravatar David Grote 2-2/+13
* Add Python routine set_potential_EB to modify eb_potential * Add CI test
2023-01-04Fix bug for intra-species Coulomb collisions (#3526)Gravatar Yinjian Zhao 3-5/+125
* Correct density * update * Add test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Regression/WarpX-tests.ini * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Apply suggestions from code review * update * Fix shadowing of variables * Simplify code * Correct density * Update checksum * Update exponential fit * Remove unused global variable * Add comment on exponential fit * Cleaning * Cleaning * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> Co-authored-by: Edoardo Zoni <ezoni@lbl.gov> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2022-12-22Feature magnetostatic solver (#3551)Gravatar S. Eric Clark 4-0/+589
* Initial working Magnetostatic solver integration into warpx. Includes hooks in Python library, and a test problem. Build files updates. New solver algorithm and inputs. * Fixed indexing to allow Magnetostatic solver to work in RZ and 3D. * Removing trailing whitespace. * Adding basic regression testing with benchmarks. * Updated Regression test ini * Augmented test scripts to compare to analytical results for uniform beam. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Updating CI tests for magnetostatic solver. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Updated magnetostatic CI tests to pass locally in regression testing framework. * Adjusting tolerance on magnetostatic_rz regression test to allow for noise in near zero fields. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Converted particle layout to Gridded instead of PsedupRandom to improve reproducibility of particle deposition for regression testing. * Dropped benchmark field comparisons with fields near zero. Dropped particle benchmark for magnetostatic_eb_rz regression test due to randomized particle theta adding noise to fields after a timestep. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Found and fixed a bug in syncronization of MultiFabs when interpolating between grids in the magnetostatic solver. Added Python output for nodal current and vector potential. Updated the CI tests to disable dynamic scheduling and enbale serialization of initial conditions. Updated benchmarks fro tests. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Source/FieldSolver/MagnetostaticSolver/MagnetostaticSolver.cpp Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Update Source/FieldSolver/MagnetostaticSolver/MagnetostaticSolver.cpp Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Adding random_theta flag to PICMI interface and updating RZ CI test and benchmark with change to disable randomized theta. * Added documentation to parameters.rst for relativistic-magnetostatic flag. Documentation corrections. Removal of commented source. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Removing need to use do_current_centering. Updated current density inverse scaling support for nodal Jr in radius. Added flag to check for m_rz_random_theta when laying down particles in RZ. * Remove dA/dt term to decouple electrostatic and magnetostatic solvers. * Remove update of auxiliary fields * Adding non-Python test case for magnetostatic solver. Updating benchmarks. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Source/FieldSolver/MagnetostaticSolver/MagnetostaticSolver.cpp Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Update Python/pywarpx/_libwarpx.py Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Update Python/pywarpx/_libwarpx.py Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Update Python/pywarpx/_libwarpx.py Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Update Python/pywarpx/_libwarpx.py Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Update Source/Diagnostics/Diagnostics.cpp Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Update Source/Evolve/WarpXEvolve.cpp Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Update Source/FieldSolver/MagnetostaticSolver/MagnetostaticSolver.H Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Refactor names of functions for magnetostatic solver implementation. Remove current_fp_nodal python interface. Drop extraneous ghost cell exchanges. * Adding radial weighting at r=0 for Jr if nodal. * Splitting off Amrex bucket and adjustments to RZ radial weighting into different branches to be merged. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Source/FieldSolver/MagnetostaticSolver/MagnetostaticSolver.cpp Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Switch name to labfame-electromagnetostatic * Update example scripts Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2022-12-21Allow const_dt with EM and check it for ES (#3561)Gravatar David Grote 1-1/+0
* Allow const_dt with EM and check it for ES * Update PR according to comments * Fix typo * Fix invalid reference to m_const_dt * Fixed another invalid reference to m_const_dt * Remove erroneous setting of `const_dt` test * Add doc for const_dt Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2022-12-21Add accelerator lattice, starting with quadrupoles (#3063)Gravatar David Grote 6-5/+358
* Initial version of accelerator lattice * Clean up EOL white space * Small clean up for GPU * Fixed up consts * Added hard edge fraction plus other clean ups * More clean up * Restructure to work on GPUs * Now this grabs its own copies of particle info * Updates, including adding dBdx * Small cleanup in Quad * Small fixes for GPU * More cleanup for GPU * More GPU cleanup * Rewrite of the accelerator lattice implementation to better handle GPU * Fix struct forward definition * Another forward definition fix * Bug fix * Added LatticeElementBase * Removed zcenters array * Added CI test case * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Clean up in CI analysis.py * Cleanup of coding * Added CI test hard_edged_quadrupoles_moving * Added Lorentz transform between boosted frame and lab frame * Fixes for working in the boosted frame * Added boosted CI test * Change input name, adding the prefix "lattice." * Added plasma lens lattice element This will replace the external field plasma lens * Fixed CI analysis script to look for "lattice.quad" * Added checks of lattice element input * Added documentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Removed duplicate call to lattice finder UpdateIndices * Added extensive comments * Reworked the input to use the MAD like description This is the same as the method used in ImpactX * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove old lines from inputs_lattice_3d * Added "lattice" element type * Fixed some Real and ParticleReals * [pre-commit.ci] pre-commit autoupdate (#3246) updates: - [github.com/hadialqattan/pycln: v2.0.1 → v2.0.3](https://github.com/hadialqattan/pycln/compare/v2.0.1...v2.0.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * ABLASTR: Update Poisson Solver API (#3243) Update the Poisson Solver API to be more usable. Needed for ImpactX. * Docs: New OLCF Machine (#3228) * D-T fusion (#3153) * initial work * fixed bugs and added species * update documentation * delete unused file * Add properties for neutron, hydrogen isotopes, helium isotopes * Update code to be more consistent * Correct typo * Parse deuterium-tritium fusion * Start putting in place the files for deuterium-tritium * Update documentation * Prepare structures for deuterium tritium * Fix typo * Fix compilation * Add neutron * Add correct formula for the cross-section * Correct compilation error * Fix nuclear fusion * Reset benchmarks * Prepare creation functor for 2-product fusion * First implementation of momentum initialization * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use utility function for fusion * Minor modification of variable names * Fix GPU compilation * Fix single precision compilation * Update types * Use util function in P-B fusion * Correct compilation errors * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Correct errors * Update values of mass and charge * Correct compilation error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Correct compilation error * Correct compilation error * Correct compilation error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Reset benchmark * Use helium particle in proton-boron, to avoid resetting benchmark * Fixed proton-boron test * Revert "Fixed proton-boron test" This reverts commit 73c8d9d0be8417d5cd08a23daeebbc322c984808. * Incorporate Neil's recommendations * Reset benchmarks * Correct compilation errors * Add new deuterium tritium automated test * Correct formula of cross-section * Correct cross-section * Improve analysis script * Add test of energy conservation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add test of conservation of momentum * Progress in analysis script * Fix error in the initial energy of the deuterium particles * Add check of isotropy * Clean up the test script * Rewrite p_sq formula in a way to avoids machine-precision negative numbers * Add checksum * Clean up code * Apply suggestions from code review * Update PR according to comments * Update benchmark * Address additional comments * Numerical Literals Co-authored-by: Luca Fedeli <luca.fedeli@cea.fr> Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Docs: gaussian beam `q_tot` is not optional (#3249) * Fix a bug in GPU version of Hankel Transform (#3253) amrex::Array4 is a 4D array that can be accessed with three spatial indices plus an optional component index. We must always provide all three spatial indices even in 2D. * Add Python Callback Call when Checkpointing Signal is Received (#3251) * CI: Add Missing Regression Analysis (NCI corrector) (#3252) * Fixes to allow mixed precision, ParticleReal float, Real double (#3239) * Fixes to allow mixed precision, ParticleReal float, Real double * Fix for the optical depth * A different way of fixing QuantumSynchrotronEvolveOpticalDepth * In the QED code, consistently use ParticleReal * Use ParticleReal type consistently * Fix typo Docs/source/usage/parameters.rst Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Fix typo Docs/source/usage/parameters.rst Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Fix small error in plasma lens lattice documentation * Small addition to the documentation * Fix the residence correction to allow short elements * Updated CI benchmarks * Added check of lattice to isNoOp * Updated the hard_edged_quadrupoles CI benchmarks It is not clear why there was a change, but the difference is essentially round off in the E field. The important thing is that the particles are still correct. * Update Source/AcceleratorLattice/AcceleratorLattice.H Add include statements Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/AcceleratorLattice/LatticeElements/LatticeElementBase.H Add includes Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Renamed to README.rst and updated headers * Made d_lattice_element_finder optional type * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Include `<optional>` * Docs: Developer AccLattice Inclusion Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> Co-authored-by: Luca Fedeli <luca.fedeli@cea.fr> Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov> Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2022-12-15Allow surface flux injection from the domain boundary (#3554)Gravatar David Grote 2-6/+10
* Fix to AddPlasmaFlux to allow flux surface to be on the domain boundary * Update FluxInjection3D.json since the particle positions changed * Update comments in AddPlasmaFlux