aboutsummaryrefslogtreecommitdiff
path: root/Examples/Modules (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-12-02Clean up examples folders (#3545)Gravatar Edoardo Zoni 62-7361/+0
* Clean up examples folders * Use `snake_case` names * Rename `nci_corrector` as `nci_fdtd_stability`
2022-11-09BTD: remove old/legacy back-transformed diagnostics (#3485)Gravatar Remi Lehe 4-70/+9
* 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-10-31Implement D+D and D+He fusion (#3257)Gravatar Remi Lehe 2-24/+132
* Implement D+D -> n+He3 fusion * Fix logic for fusion reaction * Check products in a different place * Correct compilation error * Implement D+D -> T+p cross-section * Update example * Use clearer naming convention for fusion types * Revert changes to example input script * Add analysis script * Progress on tests * Use 2 species in test * Correct momentum of colliding species * Update test * Update test * Generalize species names in fusion tests * Update benchmarks * Correct typo * Updated scripts * Update script so that it works for D+T and D+D * Update CI * Add benchmark file * Correct typo * Fix compilation on GPU * Update RZ CI test * Implement Deuterium-Helium reaction * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2022-10-29Modify naming of species in CI fusion test (#3490)Gravatar Remi Lehe 3-129/+129
* Generalize species names in fusion tests * Update benchmarks * Correct typo
2022-10-25Diagnostics: print when writing openPMD/Ascent/Sensei and BTD ↵Gravatar Ryan Sandberg 2-3/+3
plotfile/openPMD (#3424) * print when writing openPMD, Ascent, Sensei * remove unnecesssary variables, include min_digits * print snapshot id when writing btd * fix ascent print * compile without warnings * still working on Ascent * still working Ascent * Print when BTD buffer is flushed * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * print when writing openPMD, Ascent, Sensei * remove unnecesssary variables, include min_digits * print snapshot id when writing btd * fix ascent print * compile without warnings * still working on Ascent * still working Ascent * Print when BTD buffer is flushed * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add warning message if BTD not full * adjust for CI, no in-situ vis BTD * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * revert to correct plotfile naming * change warning topic to BTD * nicer format for print statements * extend examples to fill BTD * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Reset Checksums of BTD_ReducedSliceDiag * Upgrade CI Test LaserAccelerationBoost * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * improve BTD warning notes * edit final step notes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix formatting Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edoardo Zoni <ezoni@lbl.gov> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2022-10-24Fix stair-case solver in 2D Cartesian (#2942)Gravatar Remi Lehe 2-1/+9
* Fix stair-case solver in 2D Cartesian * Generalization for the macroscropic solver * Update automated test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update benchmark Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-09-24BTD diagnostics specified by intervals (#3367)Gravatar Ryan Sandberg 2-2/+2
* BTD diagnostics specified by intervals * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * address CI errors * refactor and test * no duplicate or out-of-order snapshots * update documentation and tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * clean for CI * still fighting CI * Update Source/Diagnostics/BTDiagnostics.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Apply suggestions from code review Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * refactor includes * add an explicit constexpr * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * describe algorithm for BTD intervals list * revert to old description of num_snapshots_lab * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * preserve behavior of num_snapshots_lab Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2022-09-21CI: Test New v. Legacy BTD in `BTD_ReducedSliceDiag` (#3371)Gravatar Edoardo Zoni 2-37/+70
* CI: Test New BTD in `BTD_ReducedSliceDiag` * Compare Legacy BTD vs. New BTD * Fix Bug in Loading of openPMD Array Data * Fix CI Analysis
2022-09-20Correct and test fusion module in RZ geometry (#3255)Gravatar Remi Lehe 2-15/+165
* Add particle rotation in NuclearFusionFunc.H * Minor * indent * initial work * fixed bugs and added species * update documentation * delete unused file * Add properties for neutron, hydrogen isotopes, helium isotopes * Update code to be more consistent * Correct typo * Parse deuterium-tritium fusion * Start putting in place the files for deuterium-tritium * Update documentation * Prepare structures for deuterium tritium * Fix typo * Fix compilation * Add neutron * Add correct formula for the cross-section * Correct compilation error * Fix nuclear fusion * Reset benchmarks * Prepare creation functor for 2-product fusion * First implementation of momentum initialization * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use utility function for fusion * Minor modification of variable names * Fix GPU compilation * Fix single precision compilation * Update types * Use util function in P-B fusion * Correct compilation errors * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Correct errors * Update values of mass and charge * Correct compilation error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Correct compilation error * Correct compilation error * Correct compilation error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Reset benchmark * Use helium particle in proton-boron, to avoid resetting benchmark * Fixed proton-boron test * Revert "Fixed proton-boron test" This reverts commit 73c8d9d0be8417d5cd08a23daeebbc322c984808. * Incorporate Neil's recommendations * Reset benchmarks * Correct compilation errors * Add new deuterium tritium automated test * Correct formula of cross-section * Correct cross-section * Improve analysis script * Add test of energy conservation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add test of conservation of momentum * Progress in analysis script * Fix error in the initial energy of the deuterium particles * Add check of isotropy * Clean up the test script * Rewrite p_sq formula in a way to avoids machine-precision negative numbers * Add checksum * Clean up code * Add test for fusion in RZ geometry * Update code to take into account actual timestep * Update RZ test * Update RZ test * Increase number of particles * Impart radial memory on DT particles * Correct RZ momenta * Remove unused file * Update test * Fix definition of theta * Add new test * Add checksum * Update test * Update tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix Python analysis script * Remove CPU and ID from new benchmark Co-authored-by: Yinjian Zhao <yinjianzhao@lbl.gov> Co-authored-by: Luca Fedeli <luca.fedeli@cea.fr> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-09-07CI: Test New v. Legacy BTD in `RigidInjection_BTD` (#3327)Gravatar Edoardo Zoni 2-38/+85
* Improve Testing of New v. Legacy BTD * openPMD: Flush Series before Accessing Arrays Co-authored-by: Ryan Sandberg <RSandberg@lbl.gov> * Add Checksums for RigidInjection_BTD (BTD data) * Compare Also Particle Momenta (BTD data) * [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: Ryan Sandberg <RSandberg@lbl.gov> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: Ryan Sandberg <RSandberg@lbl.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-11`isort`: AMReX, WarpX, etc. as First Party (#3307)Gravatar Axel Huebl 1-0/+1
* `isort`: AMReX, WarpX, etc. as First Party Mark the `amrex` and `pywarpx`, `picmistandard`, ... imports as first party, so that they do not change if run locally or remotely pre/post install.
2022-08-10Initialize particle runtime attributes inside AddNParticles (#3272)Gravatar Neïl Zaim 2-0/+19
* 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-08-04Species variables in diagnostics: deal with runtime components (#3218)Gravatar Neïl Zaim 4-46/+46
* 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-08-01Remove duplicated parameter in QED inputs (#3275)Gravatar Neïl Zaim 4-16/+0
2022-07-24Bug fix for BTD - particle BA, and geom, same as field buffer (#3056)Gravatar Revathi Jambunathan 2-2/+4
* fix BTD particle container BA, geom, and add assert for probhi == 0 * fix bug with mesh-refinement * delete commented line * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * with offset added, we dont need the assert anymore * similar to plotfile, openpmd also initializes tmp from pinned pc, and no need to reset BA * commenting out the assert * changes consistent with #3201 * unused var warning fix * Compute snapshot box at init, expand and shrink buffer BA and particle BA before and after redistribute, close buffer when klab_current == k_lo for that buffer * unused var * turning off particle output in BTD CI tests for plotfiles * reset particle BA only if species output is finite * add particle output for plotfile format for BTD tests * add openpmd diags back in 2d test case * fix input to have the right format Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-22CI: Add Missing Regression Analysis (NCI corrector) (#3252)Gravatar Edoardo Zoni 1-0/+7
2022-07-19D-T fusion (#3153)Gravatar Remi Lehe 4-0/+521
* initial work * fixed bugs and added species * update documentation * delete unused file * Add properties for neutron, hydrogen isotopes, helium isotopes * Update code to be more consistent * Correct typo * Parse deuterium-tritium fusion * Start putting in place the files for deuterium-tritium * Update documentation * Prepare structures for deuterium tritium * Fix typo * Fix compilation * Add neutron * Add correct formula for the cross-section * Correct compilation error * Fix nuclear fusion * Reset benchmarks * Prepare creation functor for 2-product fusion * First implementation of momentum initialization * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use utility function for fusion * Minor modification of variable names * Fix GPU compilation * Fix single precision compilation * Update types * Use util function in P-B fusion * Correct compilation errors * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Correct errors * Update values of mass and charge * Correct compilation error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Correct compilation error * Correct compilation error * Correct compilation error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Reset benchmark * Use helium particle in proton-boron, to avoid resetting benchmark * Fixed proton-boron test * Revert "Fixed proton-boron test" This reverts commit 73c8d9d0be8417d5cd08a23daeebbc322c984808. * Incorporate Neil's recommendations * Reset benchmarks * Correct compilation errors * Add new deuterium tritium automated test * Correct formula of cross-section * Correct cross-section * Improve analysis script * Add test of energy conservation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add test of conservation of momentum * Progress in analysis script * Fix error in the initial energy of the deuterium particles * Add check of isotropy * Clean up the test script * Rewrite p_sq formula in a way to avoids machine-precision negative numbers * Add checksum * Clean up code * Apply suggestions from code review * Update PR according to comments * Update benchmark * Address additional comments * Numerical Literals Co-authored-by: Luca Fedeli <luca.fedeli@cea.fr> Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com>
2022-07-13Refactor code in fusion module to avoid machine-precision issues (#3229)Gravatar Remi Lehe 1-2/+2
* Refactor code in fusion module to avoid machine-precision issues * Update formula
2022-07-12Update 2D nuclear fusion test input file (#3230)Gravatar Neïl Zaim 1-6/+6
* Update 2D nuclear fusion test input file * Update Benchmarks
2022-07-12Add 2D tests for proton boron fusion (#2540)Gravatar Neïl Zaim 2-5/+230
* Add 2D tests for proton boron fusion * Apply suggestions from review * Fix WarpX-tests.ini * Update benchmarks
2022-07-05Add new entries in Physical Species properties (+ refactoring of the ↵Gravatar Luca Fedeli 2-9/+9
SpeciesPhysicalProperties file) (#3090) * initial work * fixed bugs and added species * update documentation * delete unused file * Add neutron * Fix nuclear fusion * Reset benchmarks * Update values of mass and charge * Correct compilation error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-06-24Added `none` as an option for fields_to_plot (#2419)Gravatar David Grote 1-1/+6
* Added `none` as an option for fields_to_plot * Added CI test case * Further updates, for picmi and CI tests * Skip the call to amrex::WriteMultiLevelPlotfile when writing no fields * Now clears m_varnames_fields * Don't allocate m_mf_output if no varnames * Updated WarpX-tests.ini
2022-05-31Add 3D tests for proton boron fusion (#2450)Gravatar Neïl Zaim 2-0/+929
* Add 3D tests for proton boron fusion * Add execute permission to analysis script * Fix Checksum path * Increase tolerance for energy check * Update benchmarks * Specify type of exception in try expect block * Apply suggestions from code review Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add review suggestions Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Safe Runtime: <species>.do_not_deposit = 1 Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Remove division by zero warning in python analysis script * Update cross-section in the E > 3.5 MeV range * Increase some tolerances * Update benchmark Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> 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>
2022-04-07Implemented the BCK fallback for the ECT solver (#3016)Gravatar Lorenzo Giacomel 2-15/+15
* Implemented the BCK fallback for the ECT solver * Ignored an unused variable * Bug fix * Fix issue with preprocessor directive * Added comments * Implemented suggestions from code review * Fixed tilebox * Improved warning * Using WarpX::RecordWarning instead of amrex::Print() * Ignoring RZ * Improving comment * Bug Fix * Lowered warning priority * Ignoring low priority warnings in ECT tests Co-authored-by: lgiacome <lorenzo.giacome@cern.ch>
2022-03-03Rename `serialize_ics` as `serialize_initial_conditions` (#2925)Gravatar Edoardo Zoni 13-13/+13
* Rename `serialize_ics` as `serialize_initial_conditions` * Add Backward Compatibility Check
2022-03-03Macroscopic Maxwell solver: do not update fields in EB (stair-case ↵Gravatar Remi Lehe 1-3/+13
approximation) (#2899) * Macroscopic Maxwell solver: do not update fields in EB * Correct unused variable * Add test with macroscopic solver * Add automated test
2022-03-03file_min_digits: 5->6 (#2385)Gravatar Axel Huebl 5-13/+14
* file_min_digits: 5->6 100k+ step runs are quite common in WarpX. To simplify post-processing scripts, increase the default to pad to 6 digits. This might break some hand-written scripts that use `?????` wild-cards over `*` wildcards in regex and thus need to be updated. But it at the same time simplifies regexes for analysis of data series and listing of such file series. * Update Scripts to Handle New File Names * Fix CI Test pml_x_psatd * Fix CI Test divb_cleaning_3d * Fix CI Tests with EB Support * Fix CI Tests with RZ Support * Fix CI Tests with PICMI Support * Use glob in Analysis of Collision Tests * Use rstrip in Analysis of Collision Tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix CI Tests for Langmuir_multi_1d/psatd * Fix CI Tests for LaserInjection_1d * Checkpoint-Restart Tests: 5 Digits `regtest.py` in `regression_testing` hard-codes 5 digits: ```diff --- a/regtest.py +++ b/regtest.py @@ -734,7 +734,7 @@ def test_suite(argv): shutil.move(test.diffDir, orig_diff_dir) # get the file number to restart from - restart_file = "%s_chk%5.5d" % (test.name, test.restartFileNum) + restart_file = "%s_chk%6.6d" % (test.name, test.restartFileNum) ``` * PICMI Restart Tests: `warpx_file_min_digits = 5` Same as other CI restart tests: hard-coded value in regression suite makes this necessary. X-ref: https://github.com/AMReX-Codes/regression_testing/issues/119 Co-authored-by: Edoardo Zoni <ezoni@lbl.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-03-01ionization_level -> ionizationLevel (#2905)Gravatar Axel Huebl 1-2/+2
Rename to follow the naming conventions we use for I/O for scalar and vector/tensor attributes. https://warpx.readthedocs.io/en/latest/developers/particles.html#particle-attributes
2022-02-02QED example inputs: simplify initialization of product species (#2816)Gravatar Neïl Zaim 5-160/+32
* QED example inputs: simplify initialization of product species * Update benchmark
2022-01-19RigidInjection_BTD: Specify H5 Backend (#2761)Gravatar Axel Huebl 1-1/+2
We default to `.bp` files when available. This results for this test in: ``` amrex::Abort::0:: Currently BackTransformed diagnostics type does not support species output for ADIOS backend. Please select h5 as openpmd backend !!! ```
2022-01-07Particle Buffer for Backtransformed Diagnostics (#1898)Gravatar Revathi Jambunathan 1-0/+1
* 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-29Regression Testing: Use Mainline & CMake (#2556)Gravatar Axel Huebl 1-1/+1
* Regression testing: Use mainline * Update WarpX-tests.ini - Add `cmakeSetupOpts =` - Add `-DWarpX_DIMS`: Not an AMReX convention, so we cannot rely on `dim = ...` - Skip building unneeded tools - Add `install_pip` target: Calling `python -m pip wheel .` and install re-using the build directory. This is mainly for our CI Python regression scrips, users and package managers should just use `python -m pip wheel .` and `... install *whl` directly. * LaserInjectionFromTXYEFile: General Exe Generalize executable globber in script * Docs: Update Regression Testing (CMake) * Azure: Ninja Builds (CMake)
2021-12-22Change _libwarpx.py functions to LibWarpX class methods (#2696)Gravatar Peter Scherpelz 3-24/+21
* Initial attempt at moving function into LibWarpX * Bugfix - undefined structs in get_particle_theta This is untested, identified by IDE/visual inspection only * Unify newlines * Delete libwarpx.clight (duplicated picmi.py) See picmi.constants.c * Change function descriptive comment to docstring Also remove extra newline in __init__ beginning. * Replace pywarpx/_libwarpx calls appropriately * Fix atexit register of finalize function * Reorder WarpX.py imports for pre-commit * Use picmi.Simulation.extension = libwarpx alias This will hopefully preempt user script changes if we restructure things to allow multiple WarpX runs to be done within a single Python script. * Fix libwarpx ref in WarpX.getProbLo/getProbHi * Update get_particle_boundary_buffer doc reference
2021-12-21pre-commit: Python imports (#2686)Gravatar Axel Huebl 24-49/+93
* pre-commit: Python imports Add two new Python rules to: - remove unused imports - sort imports according to PEP8 * pre-commit: Python imports Add two new Python rules to: - remove unused imports - sort imports according to PEP8 `.editorconfig`: isort options https://github.com/PyCQA/isort/wiki/isort-Settings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * move import os (mpl) * move import yt (mpl) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Cleanup around matplotlib.use * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Cleaning: double np and lib Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-21Inputs: `geometry.dims` option (#2685)Gravatar Axel Huebl 25-24/+25
* Docs: `geometry.dims` option Add a new, required option to specify the geometry of an inputs file at runtime. * Check & Report Runtime Dims Mismatch * Examples: add `geometry.dims` * Deprecation Warning: `geometry.coord_sys` * PICMI: `geometry.dims` * Improve error message sounds a bit better * Improve Doc Description Co-authored-by: Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com> Co-authored-by: Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com>
2021-12-16Generalize Analysis Scripts: Number of Digits (plt) (#2683)Gravatar Axel Huebl 11-13/+21
* Update Scripts to Handle New File Names * Use glob in Analysis of Collision Tests * Use rstrip in Analysis of Collision Tests * Regex: Match ends-in-digits Thanks Phil! :) Co-authored-by: Edoardo Zoni <ezoni@lbl.gov> Co-authored-by: Phil Miller <unmobile+gh@gmail.com>
2021-12-16Wrap shared object in a class to control its loading (#2637)Gravatar David Grote 3-26/+25
* Wrap shared object in a class to control its loading * Fix libwarpx attribute references * Updated callbacks.py for updated libwarpx * Removed the wx module plus other clean up * Further revision of how to use the pywarpx module. Now, _libwarpx should not be imported by external scripts except in special circumstances. * Updated documentation * Clean up end of line whitespace * Added more wrapping routines plus some clean up * Fixed use of pywarpx in two examples * Fix for getistep * Fixed for the EB Python interface * Silence a warning for our wrapper Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-12-15Examples: Python ShellBang & Executable (#2673)Gravatar Axel Huebl 29-25/+35
* Examples: Python ShellBang & Executable Make sure that all PICMI scripts and all analysis Python scripts in `Examples/` are: - executable (`chmod a+x`) - start with a shell-bang to `python3` Now, all scripts can be run directly without a `python3 ...` prefix and also default to the only right executable of Python on older systems. (New systems always have a `python3` alias, too.) * Revert a moved numpy
2021-12-14Fix: Missing EB `analysis.py` Permissions (#2672)Gravatar Axel Huebl 1-0/+0
This failed in other PRs: ``` PermissionError: [Errno 13] Permission denied: './analysis.py' ```
2021-12-14Fix: `pre-commit run -a` (#2671)Gravatar Axel Huebl 1-1/+0
Prepare to enable autofix bot from https://pre-commit.ci
2021-12-13Adding EB multifabs to the Python interface (#2647)Gravatar Lorenzo Giacomel 2-0/+262
* Adding edge_lengths and face_areas to the Python interface * Added wrappers for the two new arrays of data * Adding a CI test * Fixed test name * Added customRunCmd * Added mpi in test
2021-11-21openPMD: 1D3V Support (#2586)Gravatar Axel Huebl 1-1/+5
Add 1D output support with openPMD.
2021-11-191D3V Cartesian Support (#2307)Gravatar Prabhat Kumar 2-0/+237
* 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-11-18Bug fixes and cleanup in load balancing (#2563)Gravatar Roelof Groenewald 1-5/+13
* added helper function to rebuild MultiFabs and iMultiFabs during load balancing and included rebuilding of EB multifabs * added redistribute call for the particle boundary buffer during load balancing * consistently use DistribtionMap rather than dmap in ElectrostaticSolver.cpp * applied suggested changes from code review by Phil Miller * removed default argument for redistribute in RemakeMultiFab * removed RemakeMultiFab() as a member of WarpX * Only remake EB multifabs if they are used Co-authored-by: Lorenzo Giacomel <47607756+lgiacome@users.noreply.github.com> * adapted existing particle scraping test (PICMI version) to also cover the redistribution of particle buffers from load balancing * added redeclaring of m_borrowing * Move redeclaring of m_borrow inside if statement for ECT solver algorihtm Co-authored-by: Lorenzo Giacomel <47607756+lgiacome@users.noreply.github.com> * added calls to MarkCells and ComputeFaceExtensions * fixed issue causing CI test to fail and copied conditionals from WarpXInitData.cpp to recompute EB quantities * Guard cells communication for EB data when re-gridding (#105) * Add 2D circle EB test (#2538) * Added embedded_circle test * Add embedded_circle test files * Removed diag files * removed PICMI input file * Update to use default regression analysis * Added line breaks for spacing * Added description * Fixed benchmark file * Added load balancing to test * Commented out load_balancing portion of test. This will be added back in once load balancing is fixed. Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Added guard cells communication for EB data in regridding Co-authored-by: Kevin Z. Zhu <86268612+KZhu-ME@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * moved all EB grid data calculations to a new function InitializeEBGridData() which is now called by both WarpX::InitLevelData and WarpX::RemakeLevel * Fix typo in doc string. Co-authored-by: Phil Miller <unmobile+gh@gmail.com> Co-authored-by: Lorenzo Giacomel <47607756+lgiacome@users.noreply.github.com> Co-authored-by: Kevin Z. Zhu <86268612+KZhu-ME@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Phil Miller <unmobile+gh@gmail.com>
2021-11-122D EM solver with EB (#2401)Gravatar Lorenzo Giacomel 4-0/+204
* adding the FieldProbe * adding missing file * updating makefile * fixing host-device problem * Revert "fixing host-device problem" This reverts commit 801e6fc47f19cfc42ec46e5ef1a18dcf86be3e5a. * fixing host-device problem * making some variables const * adding a few comments * Adding the FieldProbe to the documentation * making the probe mpi-safe * added field probe to reduced diag test * added field probe to reduced diag analysis * using cell-centered fields in probe diag * removed a few typos * Interpolating to the point instead oof cell center * bug fix * improved a comment * updated documentation * Undone an outdated change * improving some variable names * improving the box extraction * making the interpolation order an input parameter * fix a typo * setting the field values to zero if the point is not in the domain * skipping the communication if probe proc is IO prcessor * Fixed typo in documentation Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Updating an header * Added a comment on the probe position * tidying up the analysis script * fixed a comment * removing an unused include * improving the parsing of parameters * fixing some comments * making some variables const * changed some ParticleReal into Real * using better tags in MPI communication * Making field probe work in 2D * making a variable const * initializing y_probe only in 3D * tidying up a line which is common to 2D and 3D * making a variable constexpr * adding a _rt * checking that the probe location is in one of the processors * removing a useless if condition * Fixing the initialization in 2D * Avoiding scrape particles in 2D (it segfaults) * Adding a test for 2D EB * Fixed the areas initialization * Initializing to zero some multifabs * Modified the ECT solver to make it work in 2D * Modified the cell extensions to make them work in 2D * Improved 2D cube test * Added 2D rotated cube test * Adding the 2d analysis script and CI * Removed an unused import from the analysis script * Ignoring some unused variables * Fixing the number of dimensions in the 2d test * Added missing analysis for ECT * Enabled again 2d particles scraping * Fixing the test_name with the general logic * Fixing the test_name with the general logic * Removed some commented code * Modified several preprocessor directives to check consistency EB-dimension * Added missing semicolons * Fixed a preprocessor directivew * Fix typo: WARPX_DIM_XZ * Improving some comments Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Adding some more consistency checks * Adding some more consistency checks * Fixed a typo Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-11-09Fix #2522: Gaussian beam positions do not change with warpx.random_seed (#2523)Gravatar Remi Lehe 3-3/+3
* Draw Gaussian beam position with amrex random engine * Update benchmarks * Update tolerance in space-charge tests * Update benchmark for space charge initialization test * Update benchmarks * Update benchmark * Clean-up code * Update benchmarks
2021-11-08Install pre-commit (#2532)Gravatar Axel Huebl 2-2/+0
* Add pre-commit Add basis for automated pre-commit checks. Install locally via: ```bash python3 -m pip install -U pre-commit pre-commit install ``` See: https://pre-commit.com * Cleanup: Whitespaces * Cleanup: requirements.txt order
2021-11-02Introduce AMReX change of stencil for Poisson solver (#2496)Gravatar Remi Lehe 2-2/+2
* AMReX/PICSAR: Weekly Update (#2478) Weekly update to latest AMReX. Weekly update to latest PICSAR (no changes). ``` ./Tools/Release/updatePICSAR.py ./Tools/Release/updateAMReX.py ``` * Update benchmarks * Update benchmarks for 3D tests * Update benchmarks * Update benchmark * Update benchmark Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-10-25Modernize field access in yt scripts (#2455)Gravatar Luca Fedeli 2-4/+4
* increase tolerance for single precision test * reset checksum * change ad['field'] into ad[('mesh','field')] or ad['boxlib','field'] in yt script * update field access in several files * Update Examples/Tests/Langmuir/analysis_langmuir_multi_rz.py * Update Examples/Tests/Langmuir/analysis_langmuir_multi.py * Update Examples/Tests/Langmuir/analysis_langmuir_multi_2d.py * Update Examples/Tests/Langmuir/analysis_langmuir_multi_rz.py * Update Examples/Tests/Langmuir/analysis_langmuir_multi_2d.py * Update Examples/Tests/Langmuir/analysis_langmuir_multi.py * Update Examples/Tests/Langmuir/analysis_langmuir_multi_rz.py * Update Examples/Tests/Langmuir/analysis_langmuir_multi_2d.py * Update Examples/Tests/Langmuir/analysis_langmuir_multi.py * Update Examples/Tests/Langmuir/analysis_langmuir_multi.py * Update Examples/Modules/boosted_diags/analysis_3Dbacktransformed_diag.py * Update Examples/Modules/boosted_diags/analysis_3Dbacktransformed_diag.py Co-authored-by: Tools <warpx@lbl.gov>
2021-10-19Simplify momentum initialization in example input files (#2309)Gravatar Neïl Zaim 13-97/+88
* Simplify momentum initialization in example input files * Update benchmarks * Trigger Build * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Add more amrex prefix * Remove using namespace amrex in PlasmaInjector.cpp * Fix compilation with OpenPMD Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>