aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/MultiParticleContainer.cpp (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-08-22MultiParticleContainer: Prevent Bugs in Some `setVal` Calls (#3266)Gravatar Edoardo Zoni 1-4/+4
- Call `setVal` with default arguments (number of components and ghost cells) - Affects only functions used with multi-J time stepping: - `MultiParticleContainer::DepositCurrent` - `MultiParticleContainer::DepositCharge`
2022-08-15Move handling of do_not_deposit to physics callers (#3225)Gravatar Phil Miller 1-19/+23
* 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-04Species variables in diagnostics: deal with runtime components (#3218)Gravatar Neïl Zaim 1-2/+2
* Species variables in diagnostics: deal with runtime components * Remove ParticleStringNames namespace * Use const reference in iteration variable * Fix ion acc 2D test * Output extra (e.g. initialized later with python) comps by default * Always output theta in RZ * Fix QED tests * Fix Laser Acceleration RZ test
2022-07-06Initialize multi-physics module (ionization, QED) when restarting ↵Gravatar Remi Lehe 1-12/+24
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-08ABLASTR: Move Communication Utilities (#3167)Gravatar Axel Huebl 1-2/+2
* Move: WarpXCommUtils to ABLASTR * Update Usage Locations * Refactor: `WarpX::do_single_precision_comms` Do not use a global from WarpX in ABLASTR routines.
2022-06-02Move warning logger in ablastr (#3154)Gravatar Luca Fedeli 1-14/+16
* 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-09Fix miscellaneous issues found with clang tidy (#3083)Gravatar Luca Fedeli 1-15/+15
* fix miscellaneous issues found with clang tidy * fix miscellaneous issues found with clang tidy * moved default constructors and destructors to header * fix issue * Use default again
2022-04-20Current Deposition Interfaces: Always Pass `dt` & `relative_time` (#2937)Gravatar Edoardo Zoni 1-5/+5
* 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-03-28Clean up handling of `v_galilean` (#2989)Gravatar David Grote 1-4/+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>
2022-03-14QED: Add Space in Multiline Warnings (#2956)Gravatar Axel Huebl 1-2/+2
Just a missing space we saw in the warning message between the sentences.
2022-03-10Clean up the use of ndt for collisions (#2944)Gravatar David Grote 1-2/+2
* Clean up the use of ndt for collisions * Update BackgroundStopping to match changes
2022-03-08Make error and info messages visually uniform (#2939)Gravatar Luca Fedeli 1-35/+40
* initial work to add msg formatter * wip * replace AMREX_ALWAYS_ASSERT_WITH_MESSAGE with WarpX equivalent
2022-02-16Provide `t_min` and `t_max` for flux injection (#2842)Gravatar Remi Lehe 1-2/+2
* Implement injection orthogal to plane * Generalize momentum distribution for flux injection * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" This reverts commit b0cd1891771a4c49c14abb7cb9df7374cee4458c. * Revert "Generalize momentum distribution for flux injection" This reverts commit 0a22b1d8fa68a3a5705d8f4824f757b6dee497f0. * Rotate momentum initialization * Correct flux number when the direction is normal to plane * Update distribution of particles within a cell * Clean-up injection code * Add more documentation * Add more comments * Handle 1D case * Only do the rotation for Gaussian flux profile * Fix compilation error * Correct compilation for GPU * Start adding automated test * Correct sign of velocity * Update to add continuous injection * Finalize test * Correct processing of flux_normal_axis * Add checksum * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix bug * Update script * Implement maximum injection time * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add parameter tmin * Make parameter optional ; update 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>
2022-01-07Particle Buffer for Backtransformed Diagnostics (#1898)Gravatar Revathi Jambunathan 1-0/+25
* move BTD call before Redistribute * define particle buffer, BTD particle functor, particle filter * select particles on the slice * add particle functors * add Lorentz Transform * fix conflict * add call to loretnz operator * storing Particles in buffer * This is WIP. Added particle buffers, filled them, sent them for flush with number already flushed. Does not work for multiple flushes. Crashes for OpenPMD. * trailing endif after rebase * adding print statements and not flushing particles in OPENPMD if numpart is 0 * last timestep flush is ensured at the end of evolve loop * fix bug in declaring uy uy new and computing uzp * set particle Geom, BA, and DMAP for particle flush with plotfile * set Particle BA Geom DMAP for particle buffer and no BTD transform for force flush * separate compute and pack from flush * Fix Typo: resizeable -> resizable Fixes HDF5 BTD particle output. * new class for plotfile particles for BTD * copy particle_H and DATA and Header. some WIP print statements * Merge plotfile * clean print statements * fix warning message * struct declaration in header, fix warning * doxygen comments and copyright * clean print statements * fix eol and override function warning * tile data * fix output species array size bug * fix access for particle buffer size * clean and move time-update * add cur_time update back * remove cur time update which was called twice * dont access particles flushed already for full diagnostics * cur time must be updated for RigidInjection BTD CI test to pass * temporarily move call to BTD * updating time and calling BTD before movewindow * cleanup * reset benchmarks and analysis script * clean and add comments * fix particle box array, geom, dmap * reset benchmarks for multi_J rz and ElectrostaticSphereEB_mixedBC * wip commit * wip commit * add SI conversion * abort for openpmd bp backend if species is selected. Also write particle output for BTD only if write_species is 1 * add documentation for aborting if adios is used with openpmd and add other BTD input parameters * Apply suggestions from code review commit Axel's suggestions from review Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * use bool instead of int * fix doxygen format * using h5 as backend in example test to ensure consistency with abort for particle output. * fix doxygen comment * reset benchmark again for comoving_2d_psatd galilean_2d_psatd multi_J_rz_psatd * reset benchmark for background_mcc * self-review suggestions * reset benchmarks. Update with last snapshot full info * Axel's PR suggestions Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Axel's doxygen fix Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * add comments * fix eol * improved exception handling for stringsteam * PR suggestions * Axels' suggestions from code review Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Axel's suggestions :) Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * simplify logic * suggestions from review (Axel/Reva) Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * variable name change for clarity * if num particles in tmp array is 0, return * Use new BTD inputs to set up BTD for particles in the corresponding particle container * unused var * fix logic error * speciesID undefined * separate particle and field buffer calls and initialization for BTD. Data common to both are initialized separately * rename variable so it does not ghost existing varname * add more comments * Assert that fields are on * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * redundant function definition * unused variable * unused variable zp * 1D 2D 3D definition * fix else * Apply suggestions from code review Add Prabhat's suggestion Co-authored-by: Prabhat Kumar <89051199+prkkumar@users.noreply.github.com> * missing semicolon and ignore xp yp for 1D * resetting benchmarks for boosted sims and mcc sim * temporarily changing tolerance since the relative difference for momentum_z is 3.68e-3 and the current tolerance is 2.5e-3 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> Co-authored-by: Prabhat Kumar <89051199+prkkumar@users.noreply.github.com>
2021-12-07Transform the external fields into the boosted frame (#2610)Gravatar David Grote 1-31/+15
They should be specified in the lab frame
2021-12-06AMREX_SPACEDIM : Initialization and Particles (#2628)Gravatar Prabhat Kumar 1-6/+6
* AMREX_SPACEDIM : Boundary Conditions * AMREX_SPACEDIM : Parallelization * Fix compilation * AMREX_SPACEDIM : Initialization * Fix Typo * space * AMREX_SPACEDIM : Particles
2021-11-22Python: Start 1D Support (#2582)Gravatar Axel Huebl 1-1/+3
* Python: Start 1D Support Start supporting 1D builds in Python. * Fix 1D: PML FillZero unused ... since PMLs are not yet supported in 1D. * BeamRelevant: Fix unused p_pos0 * FromTXYEFileLaserProfile: Not Impl in 1D * QED Schwinger: 1D not Implemented Fix unused warnings, add aborts. * 1D RealVect/IntVect: Initialization Use explicit scalar constructors, no braces. Fix warning in clang 10. * 1D NCI Filter: Fix unused members & Init Unimplemented, but throws warnings. * PSATD: 1D not Implemented - remove compile warnings - start porting some parts * NCIGodfreyFilter: Clean up 2D & Else
2021-11-191D3V Cartesian Support (#2307)Gravatar Prabhat Kumar 1-0/+7
* Build System: Add 1D Geometry * test PR * test PR * 1D cartesian yee algorithm * fixed typo * Fixes for PML * 1D support related multiple changes * Fix compilation * change 1D to 1D_Z * 1D Field Gather and typo fix * 1D Charge Deposition * Particle Pusher * multiple changes related to 1D * 1D diagnostics and initialization * PlasmaInjector and PEC fixes for 1D * clean-up delete diags file * mobility 1D laser particle and bilinear filter * deleted diags files * update laser particle weight formula * delete diags files * Azure: Add 1D Cartesian Runner * 1D fixes for FieldProbe * Update Docs/source/developers/dimensionality.rst Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * 1d laser injection and langmuir test input files * 1d tests * clean up : delete print statements * analyse simulation result for laser injection and Langmuir tests * EOL * delete input files for which there are no automated tests * delete input files for which there are no automated tests * add ignore_unused to remove warnings * remove space * Fix compilation issues * fix error : macro name must be an identifier * Small bug fix * cleanup Python script for analysis * bug fix * bug fix * Update ParticleProbe: Check 1D in-domain * Update Source/Make.WarpX * Update .azure-pipelines.yml * Add USE_OPENPMD=FALSE to .azure-pipeline.yml * resolve conflict * resolve conflict * fix typo * Correct out-of-bound access * Fix Particle BC in WarpXParticleContainer and correct path to checksumAPI in python analysis scripts * EOL * Fix bug : accessing out of bound index of cell in 1D * remove 1d test for cartesian3d * Fix CI check * Slight style change * Address review comments * Fix GPU compilation Filter.cpp * Fix CI * Fix Indentation * Address review comments * More consistent ifdef for dimension bigger than 1 * Update Examples/Tests/Langmuir/analysis_langmuir_multi_1d.py Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update GNUmakefile Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Regression/prepare_file_ci.py Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianCKCAlgorithm.H Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianNodalAlgorithm.H Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Filter/Filter.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Filter/Filter.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Filter/Filter.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Filter/Filter.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Initialization/PlasmaInjector.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Initialization/PlasmaInjector.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * add comment inline to explain twice push_back * Add amrex::Abort for NCIGodfreyFilter Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Prabhat Kumar <prabhatkumar@kraken.dhcp.lbl.gov> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> Co-authored-by: Remi Lehe <rlehe@lbl.gov>
2021-10-20⚠️ Add warning logger (#2113)Gravatar Luca Fedeli 1-8/+23
* improve error msg * eliminate final dot * initial layout of the main classes * progress * progress with warnings * print local errors * progress with warning logger * improved MsgLogger * added file to test warnings * added method to read debug warnings from inputfile * progress towards collective gather of warnings * add missing blank line in warning message * move misplaced file * refactoring * fixed bugs * progress * fixed bugs * fixed some bugs * it finally works! * add comments in WarpX.H * add missing comment * added comments to WarpX.cpp * add profiler to WarpX.cpp * expose option to enable 'warn immediately' feature in cmake * Add comment to main.cpp * add missing comment in WarpX.cpp * add copyright and include guards to WarnManager_fwd.H * cleaning and added comments to WarnManager.H * updated test * added fwd file for MsgLogger * cleaning * Added copyright in WarnManager.cpp * Cleaning * cleaning * Add missing copyright * cleaning * clean and add comments to MsgLoggerSerialization.H * cleaning MsgLogger_fwd.H * cleaning * continue cleaning MsgLogger * added comments & bugfixing * removed test file * fixed bugs * Update Source/Utils/MsgLogger/MsgLogger.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/WarpX.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLogger.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLogger.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLogger.cpp Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLoggerSerialization.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLoggerSerialization.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLoggerSerialization.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLoggerSerialization.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLoggerSerialization.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/WarnManager.cpp Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/WarnManager.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/WarnManager.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/WarnManager.cpp Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * fixed bugs * Update Source/Utils/MsgLogger/MsgLogger.cpp Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Added comment to explain rotation * use last value computed by partial_sum * fix bug * now use error stream * using anonymous namespace for helper functions * print on both stderr and stdout * now using runtime parameter to always print warnings * added documentation * using long int for counter * sort affected warnings list * add doc entry * removed doc * added documentation * fixed bug * fixed bug * removing unnecessary text * reformatting * reformatting * fixed bug * fixed bug * correction * add warning_logger.rst to toctree in developers.rst Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com>
2021-10-18Option to do single precision mesh communication. (#2294)Gravatar Andrew Myers 1-1/+2
* option to use single precision guard cell exhanges * add missing files * fix namespace issue * change precision of comms to float * ParmParse the single_precision_comms flag * set back to real * test * make sure dst is filled * nGrow -> nGrowVect * restore float * don't override valid cells * single precision mesh * whitespace * wrap SumBoundary * Wrap additional uses of FillBoundary. * catch missing copies of ParallelCopy * missing OverrideSyncs * add wrapper for iMultifab * fix typo * moar typos * typo * strip single_precision_mesh option * fix original copy * update fusible syntax Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov> * Fix: Single Precision Builds Should not copy around data for `do_single_precision_comms` * Docs: warpx.do_single_precision_comms * initialize this tmp multifab to 0.0 * fix tiny profile label * remove orig copies, they are only correct for FillBoundary * loosen tolerance for space charge tests for single precision * missing some setVal * another missing setVal * missing setVal * add wrapper for new version of sumboundary * add explicit cast to silence compiler warning * add a test for single precision comms * revert change to test precision * add benchmark for single precision comms test * restore tolerance I removed by mistake * tolerance * copyright headers * drop tolerance for single precision tests in default analysis script * missing python module * bump tol again * fix bad merge * Apply suggestions from code review Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov>
2021-10-11Use parser for more input parameters (#2386)Gravatar Neïl Zaim 1-7/+8
* Use parser for more input parameters * Fix PSATD compilation and apply suggestions from code review * Avoid out of bound array access for num_particles_per_cell_each_dim * Fix few input files with respect to num_particles_per_cell_each_dim * Fix get that incorrectly became query
2021-10-04Add structure for proton-boron fusion module (#2217)Gravatar Neïl Zaim 1-1/+1
* Add structure for proton-boron fusion module * Fix clang compile error * Generalize structure for other nuclear fusion types * Workaround: try to use std::vectors to fix clang compile error * Simplify workaround for clang * Rebase on 2245 and add empty particle creation functor * Apply suggestions from code review Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Add couple of consts and runtime assert * Add another const Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-10-04Implement Checkpoint / Restart for Laser Particles (#2360)Gravatar Andrew Myers 1-2/+3
* Initialize lasers when restarting + recalculate z position at each iteration * Fix restart for rigid-injected particles * Fix laser injection box at restart * Use correct positions for the moving window of the BTD * implement restart for laser particles * add CI test for laser acceleration restarting * writespace * Revert "Fix restart for rigid-injected particles" This reverts commit 33bf3a60126539b9566ead3115ff2bcdf4b80516. * don't add lasers to all full diags, only checkpoints * fix unused parameter warning * move the call to reset the m_laser_injection_box into PostRestart * bugfix for non-boosted frame simulations * Read the mean velocity of the injected species * Remove unused line * Revert "Initialize lasers when restarting + recalculate z position at each iteration" This reverts commit 322634c35aa996649d0e8fff9fb683d04f2ee121. * Add new ReadHeader / WriteHeader functions * Add WriteHeader/ReadHeader for laser particles * Revert "add CI test for laser acceleration restarting" This reverts commit 6ba0fb3c121027eecf8b5845f55080e5b187375d. * Fix merge commit * Correct reading of updated position * Add laser in restart test * Remove unused parameters * Update regression tests * Add benchmark files * Update boundary conditions for restart_psatd Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2021-09-24Stochastic particle reflection from absorbing domain boundaries (#2281)Gravatar Roelof Groenewald 1-17/+1
* added tunable particle reflection from absorbing domain boundaries * extended picmi.py to allow setting boundary reflection coefficients and added a CI test for the reflection implementation * allow R(E) to be specified, except for embedded boundaries * changed approach for particle reflection, now the ParticleBoundaries object will hold the reflection coefficient; reflection from EBs not implemented * added functionality to reflect from EB; still needs to be tested for accuracy * added support for energy dependent reflection models for domain boundaries * fixed at least one issue causing CI fails - building reflection model parsers for not physical particle containers * switched reflection coefficients to be functions of the velocity component perpendicular to the boundary rather than energy * reverted initial work on reflecting from EBs * changed naming convention for new CI test for particle reflection * switched useMPI back to 1 in test * breaking changes while trying to sort out GPU issue * fixed issue with CUDA compilation - hopefully :) * various code improvements from PR review suggestions * fix of major issues * no need to parse the reflection models at every step * skip particles that are already flagged for removal in ApplyBoundaryConditions
2021-08-25Multi-J: Optimize Allocations of rho MultiFabs (#2224)Gravatar Edoardo Zoni 1-4/+3
* OneStep_multiJ: Always Deposit rho in Component 0 * For Multi-J Algo Allocate only 1 Component Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2021-08-20Added transform of fields from lab to boosted frame (#2201)Gravatar David Grote 1-1/+24
2021-08-18Bug fixed: looping over all species now within `OneStep_multiJ` (#2207)Gravatar Olga Shapoval 1-6/+4
* Bug fixed: looping over all species now within 'OneStep_multij' * Bug fixed: looping over all laser particles within DepositCharge in multi-J
2021-08-05Added B field to plasma lens (#2163)Gravatar David Grote 1-7/+18
* Added B field to plasma lens * Fix B field and updated CI test to include the B field * Updated benchmark
2021-07-27Rename: Optical Depths QED (#2140)Gravatar Axel Huebl 1-1/+1
This is renaming the runtime added optical depth scalars for QED physics just to create the same names in plotfile and openPMD output.
2021-07-21Implements a periodically repeating plasma lenses (#2080)Gravatar David Grote 1-0/+25
* Implements a periodically repeating plasma lens * Added documentation for plasma lenses * Added m_n_lenses to avoid use of size in device code * Change arrays to device arrays * Put DeviceVectors in the MultiParticleContainer * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Particles/Gather/GetExternalFields.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Added CI test * Updated CI test * LGTM clean up * Moved literal namespace inside the routine Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-07-19moved ScrapeParticles() out of a #ifdef WARPX_QED block (#2103)Gravatar Roelof Groenewald 1-11/+11
2021-07-16fix #if macro (#2102)Gravatar Andrew Myers 1-1/+1
2021-07-16Infrastructure for interacting particles with embedded boundary walls (#2069)Gravatar Andrew Myers 1-0/+16
* Infrastructure for interacting particles with embedded boundary walls * remove debug prints * protect with AMREX_USE_EB * fix for 2D XZ * also update level set when regridding * rename level set to 'DistanceToEB' * add docstring for scrape particles. * add assertion on maxLevel() since EB does not work with mesh refinement right now. * m_eb_if_parser no longer exists * add test for particle aborption at embedded boundaries * fix bug I introduced refactoring * add new test to suite * fix test names * fix 2D * rookie python error * fix filename in test * fix script * fix unused * make sure we turn EB on in test
2021-07-13amrex::Parser (#2063)Gravatar Weiqun Zhang 1-6/+6
* amrex::Parser Replace WarpXParser with amrex::Parser. Roundoff errors are expected because of additional optimization in amrex::Parser. * Reset the Langmuir_multi_psatd_single_precision benchmark due to change in single precision parser * enable Intel oneAPI CI again * Update Source/EmbeddedBoundary/WarpXInitEB.cpp * Replace hard-coded number in ParticleDiag with a constexpr
2021-07-06Fix readability-container-size-empty warning raised by clang-tidy (#2055)Gravatar Luca Fedeli 1-2/+2
* fix readability-container-size-empty warning raised by clang-tidy * fix bug
2021-07-06Reflective particle boundary condition (#1728)Gravatar David Grote 1-8/+14
* Added ParticleBoundaries and reflecting boundary conditions * Added ParticleBoundaries::AllNone * Allowed different particle boundary conditions on each side of the domain * Updated the documentation for particle boundaries * Fix end of line space in Docs/source/running_cpp/parameters.rst * Updated the reflecting BC to use boundary input group * Fixes to reflective boundary conditions * Bug fix in AsStored * Added particle boundaries regression test particle_boundaries_3d * Fixed particle_boundaries_3d.json * Minor updates * Added algo.particle_shape to test case * Remove do_pml from test case Co-authored-by: Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com> * Need to explicitly turn off pml in CI test * Re-add include * Fixed includes Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> Co-authored-by: Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-06-28Multi-J scheme (#1828)Gravatar Remi Lehe 1-0/+66
* Introduce new option skip_deposition * Properly implement the option to skip deposition * Skip deposition for electrostatic solver * Correct typo * Add Index Enumerator and Equations for F/G Without Averaging * Define new functions for current deposition and charge deposition * Disable interpolation between levels * Correct compilation error in RZ mode * Add argument for relative time * Add Index Enumerator and Equations for F/G With Averaging * [skip ci] Add new OneStep function * Fix compilation errors * Correct more compilation errors * [skip ci] Fix compilation * Split the PSATD push into separate functions * Add guards for rho field * [skip ci] Use new functions in OneStep * [skip ci] Separate the inverse transform of E_avg, B_avg * Add deposition of rho * [skip ci] Prevent deposition of rho if unallocated * Fix error in deposition function * Add subcycling of current deposition * [skip ci] Add inverse transform of averaged fields * [skip ci] Move component of rho * Add function to copy J * Temporarily deactivate contribution from F * [skip ci] Implement call to linear in J * Add psatd time averaging for multiJ * [skip ci] Fix implementation of averaging * [skip ci] Implement divE cleaning * Fix Bug for RZ Builds * Fix Bug for RZ Builds * Fix Bug in Init of PML Spectral Solvers * Cleaning * Cleaning * Add div(B) Cleaning (G Equation) * Multi-J Not Implemented with Galilean PSATD or PMLs * Add 2D CI Test Using Multi-J Scheme * Add More Inline Comments * Add More Inline Comments & Doxygen * Add Doxygen for Constructor of SpectralSolver * More Doxygen in Class SpectralSolver * Add Doxygen for New Functions in WarpXPushFieldsEM.cpp * Add Doxygen for New Functions in WarpX/MultiParticleContainer * do_dive/b_cleaning Must Be True With linear_in_J Option * Cast multij_n_depose to Real in Divisions * New Input Syntax * Add const where Possible, Fix Warnings * Docs for New Input Syntax, Fix Abort Messages * Consistent Use of Idx, IdxAvg, IdxLin * Improve Documentation of psatd.J_linear_in_time * Use const Type Qualifier whenever Possible * Simplify Initialization of Pointer ion_lev * Improve Doxygen * Update documentation * Add Note on NCI to Docs * Make warpx.do_multi_J_n_depositions Not Optional * Simplify Logic in getRequiredNumberOfFields * Use More const Type Qualifiers Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>
2021-06-24Use "Include What You Use" on WarpX (#1947)Gravatar Luca Fedeli 1-6/+48
* initial tests with IWYU * added a couple of forward declarations * used iwyu on more files * progress * used iwyu on more files * progress with iwyu * progress with iwyu * fixed bug * progress with iwyu * progress with IWYU * progress with IWYU * fixed bug * fixed bug * progress with IWYU * progress with IWYU + use forward declarations in WarpX.H * first try with .def files * fix bugs * progress with IWYU * progress with IWYU * progress with iwyu * correct copyright * fixed bug * fixed bugs * fix missing include * fixed bug * fix bug * fix bug introduced during last bugfix * use iwyu on newly added files * add space * fix bug * fix missing include * fix missing include * fix missing include * fixed bugs * fixed bug * attempt at fixing issue with math functions * added missing include * fixed missing include * using _fwd.H * fixed bug * progress with iwyu * update AMReX branch * enforce alphabetic order * progress with iwyu * use right version of amrex * use right version of amrex for tests * fixed bug * fix another bug * fix missing include * fix missing include * fix missing include * updated amrex * initial work to document new include strategy * updated documentation * Fix rst & private includes * Remove accidentially added files * Fix rst code blocks * one more rst block Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-06-07Added injection of a thermal flux from a plane (#1892)Gravatar David Grote 1-0/+12
* Added injection of a thermal flux from the domain surface * Major fixes to NFluxPerCell injection * Small fixes and clean up * Fixed 'if WARPX_DIMS_RZ' to use ifdef * Small fix to flux_normal_axis error message * Fix typo Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-05-13Implemented query and getArrWithParser (#1936)Gravatar David Grote 1-2/+2
* Implemented query and getArrWithParser * Updated parameters.rst regarding expressions for multiple floats
2021-04-29Pass skip_deposition to pc->Evolve (#1925)Gravatar David Grote 1-1/+1
2021-04-13Add an option to skip deposition in the `Evolve` function ; use it for ↵Gravatar Remi Lehe 1-9/+11
electrostatic (#1807) * Introduce new option skip_deposition * Properly implement the option to skip deposition * Skip deposition for electrostatic solver * Correct typo
2021-04-12Fix QED Build (CUDA 10.0) (#1888)Gravatar Axel Huebl 1-11/+14
Replace capture of a host-side array with unnamed members for E & B field transport with a nicely named struct that transports the Array4's as members. This is harder to mix up and thus more self-documenting and solves an issue with NVCC 10.0 of the form: ``` nvcc_internal_extended_lambda_implementation: In instantiation of '__nv_dl_wrapper_t<Tag, F1, F2, F3, F4, F5>::__nv_dl_wrapper_t(F1, F2, F3, F4, F5) [with Tag = __nv_dl_tag<int (*)(amrex::ParticleTile<0, 0, 4, 0, amrex::ArenaAllocator>&, amrex::ParticleTile<0, 0, 4, 0, amrex::ArenaAllocator>&, amrex::Box, const amrex::Array4<const double> (&)[6], int, int, const SchwingerFilterFunc&, const SmartCreate&, const SmartCreate&, const SchwingerTransformFunc&), filterCreateTransformFromFAB<1, amrex::ParticleTile<0, 0, 4, 0, amrex::ArenaAllocator>, amrex::Array4<const double> [6], int, const SchwingerFilterFunc&, const SmartCreate&, const SmartCreate&, const SchwingerTransformFunc&>, 1>; F1 = amrex::Array4<double>; F2 = const SchwingerFilterFunc; F3 = const amrex::Array4<const double> [6]; F4 = const amrex::Box; F5 = int*]': /home/ubuntu/repos/WarpX/Source/Particles/ParticleCreation/FilterCreateTransformFromFAB.H:174:28: required from 'Index filterCreateTransformFromFAB(DstTile&, DstTile&, amrex::Box, const FABs&, Index, Index, FilterFunc&&, CreateFunc1&&, CreateFunc2&&, TransFunc&&) [with int N = 1; DstTile = amrex::ParticleTile<0, 0, 4, 0, amrex::ArenaAllocator>; FABs = amrex::Array4<const double> [6]; Index = int; FilterFunc = const SchwingerFilterFunc&; CreateFunc1 = const SmartCreate&; CreateFunc2 = const SmartCreate&; TransFunc = const SchwingerTransformFunc&]' /home/ubuntu/repos/WarpX/Source/Particles/MultiParticleContainer.cpp:1169:167: required from here nvcc_internal_extended_lambda_implementation:70:103: error: invalid initializer for array member 'const amrex::Array4<const double> __nv_dl_wrapper_t<__nv_dl_tag<int (*)(amrex::ParticleTile<0, 0, 4, 0, amrex::ArenaAllocator>&, amrex::ParticleTile<0, 0, 4, 0, amrex::ArenaAllocator>&, amrex::Box, const amrex::Array4<const double> (&)[6], int, int, const SchwingerFilterFunc&, const SmartCreate&, const SmartCreate&, const SchwingerTransformFunc&), filterCreateTransformFromFAB<1, amrex::ParticleTile<0, 0, 4, 0, amrex::ArenaAllocator>, amrex::Array4<const double> [6], int, const SchwingerFilterFunc&, const SmartCreate&, const SmartCreate&, const SchwingerTransformFunc&>, 1>, amrex::Array4<double>, const SchwingerFilterFunc, const amrex::Array4<const double> [6], const amrex::Box, int*>::f3 [6]' ```
2021-03-30Remove the avg_aux fields (#1849)Gravatar Remi Lehe 1-3/+1
* Remove the avg_aux fields * Update 3D benchmark * Update benchmark in 2D * Initialize Bfield_avg_cp * Fix two whitespaces left out * Fix two more whitespaces left out Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2021-03-18Use Clear Naming Standard for ParmParse Variables (#1809)Gravatar Edoardo Zoni 1-63/+63
2021-03-18Remove Wrong Parser Query in MultiParticleContainer.cpp (#1808)Gravatar Edoardo Zoni 1-1/+0
2021-03-17Replaced almost all nGrow with nGrowVect (#1801)Gravatar David Grote 1-4/+4
2021-03-16Add timers in routines that depend on cell-related work (#1692)Gravatar Michael E Rowan 1-0/+45
* Add timers * eol * AtomicAdd * lev argument for getCosts * style * style * wip * eol * .ipynb * passing down lev * eol * passing lev * eol * Update Source/Particles/Collision/PairWiseCoulombCollision.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Add for QED and ionization routines * eol * remove unneeded * mfi-->pti * move cost * eol Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-03-10fix typo (#1773)Gravatar Luca Fedeli 1-2/+2
2021-02-05Fix photon species error message (#1681)Gravatar David Grote 1-1/+1