aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhysicalParticleContainer.cpp (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-09-04Print resampling message only if `verbose` is on (#4264)Gravatar Roelof Groenewald 1-3/+6
* only print resampling message if `verbose` is on * clang-tidy fix Only use `const` qualification in function definitions, not in function declarations.
2023-08-16Cleanup plasma injection (#4191)Gravatar David Grote 1-7/+7
* Extensive clean up of PlasmaInjection * Small cleanup of parseMomentum * Fix string argument reference * Remove unneeded surface_flux
2023-08-14t_lab optionally imposed for externally loaded species in the boosted frame ↵Gravatar Ilian Kara-Mostefa 1-3/+9
(#4153) * added guidelines * added impose t_lab from file as an option * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * removed unused comment * fixed unconsistent variable type * removed space * rearranged code changes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-12Transition to pyAMReX (#3474)Gravatar Axel Huebl 1-32/+64
* 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-11Use more consistent particle type in pusher (#4175)Gravatar Remi Lehe 1-6/+6
2023-08-08Clang tidy CI test: add 4 more readability-* checks to clang-tidy CI test ↵Gravatar Luca Fedeli 1-2/+0
(#4164) * clang-tidy CI test: add new readability checks * address issues found with clang-tidy
2023-08-01Clang tidy CI test: add several readability checks to clang tidy CI test ↵Gravatar Luca Fedeli 1-2/+4
(#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 1-1/+1
* 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-07-31Clang tidy CI test: add some modernize checks to clang-tidy CI test (#4133)Gravatar Luca Fedeli 1-2/+2
* 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-40/+23
* 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-06Impose t_lab in Lorentz Transformation for externally loaded particles (#3996)Gravatar Ilian Kara-Mostefa 1-11/+12
* Impose t_lab from the openPMD file, set t_lab=0 by default for handwritten species * Clear commented out print statement * Move x and y coordinates accordingly
2023-06-30Continuous injection of moving plasma (#3958)Gravatar Edoardo Zoni 1-2/+7
* 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 1-12/+8
* 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-13Enforce const correctness using clang-tidy CI test (#3921)Gravatar Luca Fedeli 1-80/+85
* 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-12Replace amrex::Abort with WARPX_ABORT_WITH_MESSAGE (#3965)Gravatar Luca Fedeli 1-2/+2
* 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-05-05Prevent implicit capture on GPU for RZ sims (#3895)Gravatar Remi Lehe 1-1/+2
2023-05-02Fix: rocFFT 5.5 (#3888)Gravatar Axel Huebl 1-1/+3
``` /opt/rocm-5.5.0/include/rocfft.h:16:2: error: "This file is deprecated. Use the header file from /opt/rocm-5.5.0/include/rocfft/rocfft.h by using #include <rocfft/rocfft.h>" [-Werror,-W#warnings] warning "This file is deprecated. Use the header file from /opt/rocm-5.5.0/include/rocfft/rocfft.h by using #include <rocfft/rocfft.h>" ^ ```
2023-04-20Add check in `addPlasma` and `addPlasmaFlux` to respect `random_theta` (#3585)Gravatar S. Eric Clark 1-2/+2
* 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-17AMReX/PICSAR: Update to New Particle APIs (#3848)Gravatar Axel Huebl 1-2/+3
* AMReX: Weekly Update * Particles: Update WarpX APIs
2023-04-07Fix loading particles from openPMD (#3810)Gravatar Remi Lehe 1-12/+17
* Read particle offset when loading particles from openPMD * Fix compilation errors * Use loadChunk * Use correct mass
2023-03-28Fix: openPMD Weighting Loading (#3783)Gravatar Ilian Kara-Mostefa 1-19/+13
* Fix: openPMD Weighting Loading This fixes the loading of openPMD beams with per-particle weighting. The previous implementation forgot to `flush()` the data of the weighting attribute and assumed the weighting of the first particle applies to all particles of the loaded beam. This change loads the weighting for each particle. * Updating the documentation: removed re-scaling feature while using the "external file" injection style. * Issue a warning if a nonzero q_tot is found in the inputs file * Formatting and comments Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2023-03-24Workaround for nvcc (#3782)Gravatar Weiqun Zhang 1-12/+12
Fixes an issue in #3696. CUDA device lambda appears to have a limitation that explicit by-copy captures in addition to by-copy capture default would result in invalid device function at runtime.
2023-03-23Gaussian beam: allow 8-fold symmetry option (#3768)Gravatar Ryan Sandberg 1-6/+43
* 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-02-21Renamed "particle_vel" to "particle_mom" (#3672)Gravatar Davide Terzani 1-12/+12
* 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-21GetExternalEBField: Use AMReX's CompileTimeOption ParallelFor (#3696)Gravatar Weiqun Zhang 1-6/+16
This greatly improves the performance on AMD and Intel GPUs when GetExternalEBField is not used.
2023-02-03Clean warning on unused function (#3656)Gravatar Remi Lehe 1-2/+0
2023-02-01Fix NUniformPerCell for 1D (#3659)Gravatar David Grote 1-1/+1
* Fix NUniformPerCell for 1D * Fix CI benchmarks
2023-01-04Refined injection with anisotropic mesh refinement ratio (#3464)Gravatar Remi Lehe 1-12/+12
* 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-19managed memory for user defined attribs in addplasma (#3576)Gravatar Revathi Jambunathan 1-25/+66
2022-12-15Allow surface flux injection from the domain boundary (#3554)Gravatar David Grote 1-7/+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
2022-12-09Improve memory footprint for ParticleInitialize (#3392)Gravatar Revathi Jambunathan 1-0/+21
2022-11-18PushPX: GPU kernel optimization (#3402)Gravatar Weiqun Zhang 1-16/+57
* PushPX: GPU kernel optimization The GatherAndPush kernel in the PushPX function has a very low occupancy due to register pressure. There are a number of reasons. By default, we compile with QED module on, even if we do not use it at run time. Another culprit is the GetExternalEB functor that contains 7 Parsers. Again, we have to pay a high runtime cost, even if we do not use it. In this PR, we move some runtime logic out of the GPU kernel to eleminate the unnecessary cost if QED and GetExternalEB are not used at run time. Here are some performance results before this PR. | QED | GetExternalEB | Time | |-----+---------------+------| | On | On | 2.17 | | Off | On | 1.79 | | Off | Commented out | 1.34 | Note that in the tests neither QED nor GetExternalEB is actually used at run time. But the extra cost is very high. With this PR, the kernel time is the same as that when both QED and GetExternalEB are disabled at compile time, even though both options are disabled at run time. More information on the kernels compiled for MI250X. The most expensive variant with both QED and GetExternalEB on has NumSgprs: 108 NumVgprs: 256 NumAgprs: 40 TotalNumVgprs: 296 ScratchSize: 264 Occupancy: 1 The cheapest variant with both QED and GetExternalEB disabled has NumSgprs: 104 NumVgprs: 249 NumAgprs: 0 TotalNumVgprs: 249 ScratchSize: 144 Occupancy: 2 * Fix Comments Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2022-11-14Flux injection: move particle only after performing checks (#3519)Gravatar Remi Lehe 1-29/+25
* Flux injection: move particle only after performing checks * Correct cylindrical to cartesian conversion * Update benchmarks
2022-11-09BTD: remove old/legacy back-transformed diagnostics (#3485)Gravatar Remi Lehe 1-194/+2
* Start removing old BTD * Remove GetCellCenteredData * Remove do_backtransform_fields and do_backtransform_particles * Remove more functions * Remove more variables * Update documentation * Fix CI test `RigidInjection_BTD` * Remove slicing from `BTD_ReducedSliceDiag` * Rename `BTD_ReducedSliceDiag` as `LaserAcceleration_BTD` * Query deprecated input and abort Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>
2022-11-07Allow `None` for Maxwell solver (#3504)Gravatar Roelof Groenewald 1-2/+2
* 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` * changes requested during PR review * remove `do_no_deposit` from tests without field evolution * Fix doc-string in `GuardCellManager.H` Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2022-10-12Correct particle positions outside refined injection (#3463)Gravatar Remi Lehe 1-5/+10
* Correct particle positions outside refined injection * Improve test * Update benchmark * Update Examples/Physics_applications/laser_acceleration/analysis_refined_injection.py
2022-10-10Partial refactoring of the utils directory (#3404)Gravatar Luca Fedeli 1-18/+27
* initial work to clean WarpX Utils * remove AMRCore from Ionization tables * progress * refactoring of a part of the utils directory * fix bug * fixed bug * fixed bug * remove debug line accidentally slipped into the code * remove debug line accidentally slipped into the code * remove debug line accidentally slipped into the code * cleaning * fixed bug
2022-09-02Initialize user defined runtime attributes in AddPlasmaFlux (#3359)Gravatar Neïl Zaim 1-2/+32
2022-09-01Fix a bug in AddPlasma (#3351)Gravatar Weiqun Zhang 1-20/+18
When warpx.refine_plasma=1, there was an error in the logic like below. if (lrefine_injection) { Box fine_overlap_box = ...; if (fine_overlap_box.ok()) { pcounts[index] = ...; } // the else part was missing } else { pcounts[index] = ...; }
2022-08-15Move handling of do_not_deposit to physics callers (#3225)Gravatar Phil Miller 1-2/+2
* Rearrange in preparation for lifting do_not_deposit higher in the call stack * Make do_not_deposit public, so callers can test on it * Make all DepositCharge call sites respect WarpXParticleContainer::do_not_deposit * Drop check for do_not_deposit in DepositCharge * Fix comment to accurately describe np_to_depose * Fix logic to account for other logic in AddSpaceChargeField * Match zero charge density array to filled array in RZ PSATD case * Structure control flow per @dpgrote's preference * Reword comment for clarity
2022-08-10Initialize particle runtime attributes inside AddNParticles (#3272)Gravatar Neïl Zaim 1-4/+117
* Initialize particle runtime attributes before calling AddNParticles * Avoid Multiplication result converted to larger type warning * Directly initialize runtime attributes inside AddNParticles * Update doxygen comment
2022-07-27Starting with the pusher, consistently use ParticleReal (#3259)Gravatar David Grote 1-2/+2
* Starting with the pusher, consistently use ParticleReal * Update benchmarks for background_mcc_dp_psp
2022-07-22Fixes to allow mixed precision, ParticleReal float, Real double (#3239)Gravatar David Grote 1-2/+2
* 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
2022-07-06Initialize multi-physics module (ionization, QED) when restarting ↵Gravatar Remi Lehe 1-3/+0
simulations from checkpoints (#3194) * Move the initialization of multi-physics module earlier * Fix syntax error * Initialize multi-physics modules also when restarting the simulation
2022-06-02Move warning logger in ablastr (#3154)Gravatar Luca Fedeli 1-4/+6
* initial work to move the Warning Logger into ablastr * progress with warn manager class * moved Warning Logger in ablastr * fixed bugs * Fix: `SpectralFieldDataRZ.cpp` Missing include for `WarpX::getCosts(lev);` Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2022-05-24Specify particle precision (#3065)Gravatar Kevin Z. Zhu 1-60/+76
* Add precision to printed PIC parameters * Added WarpX_PARTICLE_PRECISION as a build option * Update types to ParticleReal * Updated libwarpx to inject particles with correct ParticleReal type * Fix syntax error * Add logic to avoid duplicate definitions * Use correct ParticleReal type in add_particles * Cleaned up code, addressed comments * Update Python/pywarpx/_libwarpx.py Co-authored-by: Peter Scherpelz <31747262+peterscherpelz@users.noreply.github.com> * Removed redundant functions, fixed some typing * Modified template functions * Cast d_w to Real * Fixed failing tests * Cast types to be consistent * removed in-tree-build from pip command * Added GPU device macros to PDim3 methods * rerun tests * Removed unecessary casting, update calls to use PDim3 instead of XDim3 * Refactored comments * Added mcc fields double precision, particles single precision test * Updated casting and formatting * Removed cast, updated declaration Co-authored-by: Peter Scherpelz <peter.scherpelz@modernelectron.com> Co-authored-by: Peter Scherpelz <31747262+peterscherpelz@users.noreply.github.com>
2022-04-20Current Deposition Interfaces: Always Pass `dt` & `relative_time` (#2937)Gravatar Edoardo Zoni 1-6/+10
* Current Deposition Interfaces: Always Pass `dt` & `relative_time` * Fix CI Failures * Fix 1D/RZ Warnings * Fix RZ Bug * Fix Bugs * Minimize Changes, Fix Roundoff Errors * Cleaning * Remove dt From doDepositionShapeN * Cleaning Esirkepov Deposition * Cleaning Vay Deposition * Fix Roundoff Errors * Fix Roundoff Errors (continued) * Fix Bug (RZ)
2022-04-19Fix a bug about particle weight. (#3052)Gravatar Yinjian Zhao 1-1/+1
Co-authored-by: Yinjian Zhao <yin@Yinjians-MacBook-Air.local>
2022-04-16Avoid unnecessary construction of CopyParticleAttribs (#3042)Gravatar Weiqun Zhang 1-1/+4
If it's not used there is no reason to construct a CopyParticleAttribs object. In fact, it could result in a runtime `std::out_of_range` error in `std::map::at()` because `tmp_particle_data` is used in the CopyParticleAttribs constructor, but in `PhysicalParticleContainer::Evolve`, `tmp_particle_data` is properly prepared only when doing back transformed diagnostics.
2022-03-28Clean up handling of `v_galilean` (#2989)Gravatar David Grote 1-22/+2
* Cleaned up handling of v_galilean * Missed one * Update Source/WarpX.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/WarpX.H Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/WarpX.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Particles/PhotonParticleContainer.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/FieldSolver/WarpXPushFieldsEM.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Diagnostics/ReducedDiags/FieldProbe.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Particles/WarpXParticleContainer.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Particles/WarpXParticleContainer.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Diagnostics/ReducedDiags/ParticleExtrema.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Particles/PhysicalParticleContainer.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Particles/PhysicalParticleContainer.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Utils/WarpXUtil.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Particles/RigidInjectedParticleContainer.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Particles/ElementaryProcess/QEDPairGeneration.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/Particles/ElementaryProcess/Ionization.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/FieldSolver/WarpXPushFieldsEM.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * More cleanup * Reset Galilean Benchmarks * For mirrors, now include the Galilean shift * Removed the flag since it is true for all calls * Fix Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp * Update Source/WarpX.H Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>