aboutsummaryrefslogtreecommitdiff
path: root/Source/Initialization (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-09-13Clang tidy CI test: add misc-definitions-in-headers check (#4253)Gravatar Luca Fedeli 1-0/+1
* Clang-tidy: add misc-definitions-in-headers check * address issues found with clang-tidy * remove std::cout added for debug purposes * add back newline
2023-09-08Clang tidy CI test: add selected google-* checks (#4267)Gravatar Luca Fedeli 1-2/+2
* clang-tidy CI test: add selected google- checks * address issues found with clang-tidy * fixed bugs * fix bugs
2023-08-27remove unnecessary static variables from WarpX.H (#4239)Gravatar Luca Fedeli 1-0/+12
2023-08-24add error message if cuda 11.6 is used with the yee solver (#4222)Gravatar aveksler1 1-0/+10
2023-08-22add flush (#4214)Gravatar Ilian Kara-Mostefa 1-4/+8
2023-08-16Cleanup plasma injection (#4191)Gravatar David Grote 2-366/+419
* Extensive clean up of PlasmaInjection * Small cleanup of parseMomentum * Fix string argument reference * Remove unneeded surface_flux
2023-08-12Transition to pyAMReX (#3474)Gravatar Axel Huebl 3-6/+5
* 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-09Add write_diagonstics_on_restart input option (#4091)Gravatar David Grote 1-3/+5
* Add write_diagonstics_on_restart input option * Add doc to new variable Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Use correct time step --------- Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2023-08-08Clang tidy CI test: add some misc-* checks (#4150)Gravatar Luca Fedeli 2-2/+2
* Clang-tidy CI test: add few misc checks * fix issue
2023-08-07Clang-tidy CI test: add 4 new readability checks (#4163)Gravatar Luca Fedeli 2-6/+6
2023-08-01Clang tidy CI test: add several readability checks to clang tidy CI test ↵Gravatar Luca Fedeli 1-1/+1
(#4124) * add few readability checks to clang-tidy CI test * address all the issues found with clang-tidy * fix bug * fixed bug * fix residual issue * fix issue found with clang-tidy
2023-08-01Refactoring: instantiate WarpX class via MakeWarpX function (#4104)Gravatar Luca Fedeli 3-4/+10
* move functions from main to WarpX class and make WarpX constructible only using factory method * instantiate WarpX via MakeWarpX static member function * test adding MakeWarpX to warpx_init in python wrapper * revert to the use of a simple pointer for the WarpX instance * fix issue * use finalize in python wrapper * change finalize order * move finalize * fix bug
2023-08-01move CheckGuardCells(amrex::MultiFab const& mf) function into anonymous ↵Gravatar Luca Fedeli 1-33/+40
namespace into warpx_init_data (#4141)
2023-07-31Clang tidy CI test: add some modernize checks to clang-tidy CI test (#4133)Gravatar Luca Fedeli 2-3/+3
* Clang Tidy: add several modernize checks * eliminate file included in commit by mistake * fix bug
2023-07-26Initialize variables at declaration if it improves readability (#4117)Gravatar Luca Fedeli 1-12/+7
* init some variables at declaration * make code more readable * avoid lossy function result cast * Update Source/Initialization/WarpXInitData.cpp Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov> * replace with equality * Revert "replace with equality" This reverts commit e3164f9e053d345b153d770ae107a7f68c4bb260. * Update Source/Diagnostics/ComputeDiagFunctors/ParticleReductionFunctor.cpp Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov> --------- Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov>
2023-07-10main.cpp: change warpx_amrex_init into warpx::initialization::amrex_init (#4055)Gravatar Luca Fedeli 2-28/+38
* change warpx_amrex_init into warpx::initialization::amrex_init * fix bug
2023-06-30Continuous injection of moving plasma (#3958)Gravatar Edoardo Zoni 2-2/+10
* Continuous injection of moving plasma * Fix const correctness * Fix bugs in calculation of v_bulk * Fix restart * Use range-based for loops where possible * Apply suggestions from code review * Fix bug related to managed memory * Apply suggestions from code review * Exclude case with `moving_window_v = 0` * Add to WarpXParticleContainer virtual function that returns pointer to plasma injector * Add to WarpXParticleContainer member variable for current injection position * Fix bugs * Fix bug: use continue instead of return
2023-06-27Define new `InjectorFlux` object, and use it in `AddPlasmaFlux` (#4040)Gravatar Remi Lehe 3-1/+199
* 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-26Remove Custom momentum and density injector (#4037)Gravatar Remi Lehe 7-157/+6
2023-06-23abort simulation if a user attempts to use an external field applied ↵Gravatar Roelof Groenewald 1-0/+9
directly to the particles with the hybrid-PIC solver (#4020)
2023-06-22Move MPIInitHelpers into ablastr (#4026)Gravatar Luca Fedeli 1-2/+2
* move MPIInitHelper into ablastr * fix bug * fix bug
2023-06-13Enforce const correctness using clang-tidy CI test (#3921)Gravatar Luca Fedeli 12-113/+114
* add clang-tidy workflow * fix missing newline * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * make clang.14.sh executable * remove non explicitly selected checks * complete list of dependencies * fix bug * specify path of clang-tidy file * fix bug * add new check * remove one check * add magic numbers check * removed one check * keep only one check * Docs: Conda Dev w/ Boost (#3911) Add the `boost` package to the conda developer environment. Used for QED table generation. * Fix typo in Adastra cluster documentation (#3918) * add back three checks * prepare clang-tidy wrapper * actually use clang-tidy in the script * test * fix bug * actually use clang-tidy * fixed bug * fixed bug * fixed bug * fixed bug * remove all checks except the selected 3 * fixed bug * fixed bug * fixed bug * enforce const correctness using clang-tidy * remove one check * Fix Concurrency Issue * BLAS++/LAPACK++ for RZ+PSATD * Build all 4 WarpX DIMS * add few echo for test purposes * try to debug mysterious error * don't test RZ with clang-tidy * add back RZ test * add some const * fix bug * check also header files * remove header filter since it does not work as expected * fixed bug * check also WarpX headers * fix bugs * continue enforcing const correctness * continue enforcing const correctness * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed bug * fix bugs and add new const * clean .clang-tidy * make regex more precise according to Weiqun's suggestion * add more const * fix bugs * fix bug * silence warning on float comparison * fixed bug * fixed bugs * fix bug and add const * fixed bugs * fix bug * fix bug * fix bug * fixed bug * fix bug
2023-06-12Ohm's law solver (hybrid kinetic-fluid extension) (#3665)Gravatar Roelof Groenewald 1-3/+30
* 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-05Add waterbag generation in injector (#3698)Gravatar Davide Terzani 3-1/+83
* 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-05-22Multi-Dim Buildsystem Support (#3933)Gravatar Axel Huebl 1-12/+15
* Multi-Dim Buildsystem Support * Docs
2023-05-01Use WARPX_ABORT_WITH_MESSAGE("msg") instead of ↵Gravatar Luca Fedeli 4-20/+19
amrex::Abort(Utils::TextMsg::Err("msg")) (#3879) * use WARPX_ABORT_WITH_MSG instead of amrex::Abort(Utils::TextMsg::Err(msg)) [WIP] * use WARPX_ABORT_WITH_MESSAGE * fix typo * fix missing parenthesis * remove spaces to prevent automatic text wrapping * remove wrong parenthesis
2023-04-23Import external E/B fields from openPMD files (#3584)Gravatar Phil Miller 1-0/+252
* 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-13amrex.the_arena_is_managed=0 (#3825)Gravatar Axel Huebl 1-0/+3
Disable managed memory by default for performance and non-bugness. Please disable explicitly if needed for some of the current scripting tasks, e.g., in the current Python bindings.
2023-04-13Add callback function before/after the initial Esolve (#3452)Gravatar Remi Lehe 1-0/+4
* Add callback function after the initial Esolve * Apply suggestions from code review * Change name of callback function * Update PR
2023-03-28Fix restart btd (#3734)Gravatar Revathi Jambunathan 1-2/+2
* Correct calculation of m_t_lab * write BTD related restart, read, and init data before and after accordingly * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * write snapshot domain lo and hi in moving window dir * write lo and hi of snapshot domain for all dimensions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * clean up * more meta data and redefine snapshot geom, buffer mf and write to new dir for plotfile instead of merging * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * use virtual functions * empty else condition * remove commented line * fix error in returning k-index. Thanks CI * doxygen comments * doxygen comments * more doxygen --------- Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2023-03-24include std::set, int template parameter (#3786)Gravatar Ryan Sandberg 1-1/+2
2023-03-23Gaussian beam: allow 8-fold symmetry option (#3768)Gravatar Ryan Sandberg 2-0/+5
* 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-23fix modernize use equals default check by clang tidy (#3775)Gravatar Luca Fedeli 1-2/+4
2023-03-17Add G in `CheckGuardCells` (needed w/ div(B) cleaning) (#3761)Gravatar Olga Shapoval 1-0/+10
2023-03-16Fix typo in error message (#3760)Gravatar Olga Shapoval 1-1/+1
2023-03-09New user input for grid type (collocated, staggered, hybrid) (#3683)Gravatar Edoardo Zoni 1-7/+8
* 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-07Fix `max_step` from `zmax_plasma...` upon restart (#3732)Gravatar Ryan Sandberg 1-5/+11
* fix zmax_plasma_... calculation upon restart * simple fix didn't work in all cases * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix indentation --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-22Fix getBulkMomentum for Maxwellian distributions (#3705)Gravatar David Grote 1-20/+21
* Fix getBulkMomentum for Maxwellian distributions * Add more "_rt" to real literals * More cleanup
2023-02-21Renamed "particle_vel" to "particle_mom" (#3672)Gravatar Davide Terzani 2-15/+15
* 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-08CI & Bug Fixes: 1D & 2D Compile (#3680)Gravatar Axel Huebl 1-2/+2
* CI: 1D & 2D Compile Add a modern CI entry that compiles 1D and 2D with `-Werror` and many warnings enabled. * Fix: 1D Field Init in z * Fix 1D: filterCreateTransformFromFAB * CI Job: Rename * CI: 1D/2D EB Off Not yet working.
2023-02-03 Bug fix : Coarse patch dx for external field init (#3674)Gravatar Revathi Jambunathan 1-8/+14
* fix coarse patch dx for external field init * rename var * Update Source/Initialization/WarpXInitData.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * reset benchmark for PEC_mr test case --------- Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2023-02-03fix some issues in WarpX 1D (#3671)Gravatar Luca Fedeli 1-4/+4
2023-01-25Fix few includes in WarpXAMReXInit.cpp/H and TextMsg.cpp using IWYU tool (#3627)Gravatar Luca Fedeli 2-1/+5
* Fix a couple of include directives * fix bug * Update Source/Initialization/WarpXAMReXInit.H Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * remove unnecessary AMReX.H include Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2023-01-23added space to warning message when too many boxes per GPU (#3633)Gravatar Hannah Klion 1-1/+1
2023-01-09Correct typo in PML+PSATD warning message (#3608)Gravatar Luca Fedeli 1-1/+1
2023-01-04Refined injection with anisotropic mesh refinement ratio (#3464)Gravatar Remi Lehe 1-9/+19
* Correct particle positions outside refined injection * Improve test * Update benchmark * Modifications for vector refinement ratio * Update getPosition function * Update code for anisotropic injection * Correct compilation * Correct code for RZ and 1D * Correct indentation * Correct integer overflow, as suggested by Weiqun
2022-12-22Feature magnetostatic solver (#3551)Gravatar S. Eric Clark 1-1/+7
* 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-15Allow surface flux injection from the domain boundary (#3554)Gravatar David Grote 1-1/+19
* 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
2022-12-13Typo: Fewer Ranks (Perf. Hint) (#3569)Gravatar Axel Huebl 1-2/+2
* Typo: Fewer Ranks (Perf. Hint) * fix warning message (space) Co-authored-by: lucafedeli88 <luca.fedeli@cea.fr>