aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-07-21PICMI - Embedded boundary (#2104)Gravatar Roelof Groenewald 1-0/+21
* added functionality to picmi.py to allow an embedded boundary to be set from a python run script * added test: embedded sphere run from python (the test is the same as ElectrostaticSphereEB) * added a line to prepare_file_travis.py so that tests with USE_EB=True are not included in Python CI test list * fixed import path in analysis.py file for new test * added WarpX_EB flag to setup.py so that embedded boundary functionality can be included in pip installs of pywarpx
2021-07-21Update picmi.py for new injection_style default (#2109)Gravatar Peter Scherpelz 1-1/+1
2021-07-21Use only species name in libwarpx (#2119)Gravatar Roelof Groenewald 1-73/+51
* changed all particle interacting functions in libwarpx to use the species name rather than id, also changed the functions to get particle array data to use the component name rather than index * removed unneeded function declaration
2021-07-20Python - add new particle attributes at runtime (#2112)Gravatar Roelof Groenewald 1-0/+91
* exposes AddRealComp to Python to allow extra particle attributes to be added at runtime; also includes a new function to grab a particle data array from the name of the component rather than the index * added function to get index of a particle component given the PID name * changed new get component index and get_particle_arrays_from_comp_name functions to take species name as argument rather than species id * changed warpx_addRealComp to accept a species name as input and only add the new component for that species
2021-07-15Typo fix in fields.py (#2095)Gravatar nruof 1-1/+1
2021-07-15Replace `injection_style = python` with `injection_style = none` (#2081)Gravatar Edoardo Zoni 1-3/+3
* Replace injection_style = python with injection_style = none * Update Docs * Add Default injection_style = none
2021-07-15Changed species to self.species as species is not defined (#2087)Gravatar KZhu-ME 1-1/+1
2021-07-12Fixes to RZ PSATD (#1945)Gravatar David Grote 1-2/+3
* For RZ, changed the sign of the density corrections near the axis * Further fixes for deposition correction near axis * Yet one more sign fix for charge density * For RZ spectral solver, filled in the guard cells below the radial axis * Fix white space at end of line * In RZ spectral backtransform, ensure box is valid * For RZ inverse volume scaling, fixed use of nGrow to use nGrowVect * Temporary fix adding damped cells in the domain interior * Bug fix for RZ PSATD scalar backward transform * Fixes for damping of the fields in the z-guards * Bug fix in DampFieldsInGuards * Bug fix in DampFieldsInGuards (for tiling) * Added warpx_amr_check_input input parameter * Removed unneeded damp and zero_in_domain input * Removed damping related code from picmi * Improved some comments in code copying field to the radial guard cells * Update Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp Simplify the expression for the sign Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Updated benchmarks * Updated tolerance for Langmuir analysis script * Updated CI test galilean_rz_psatd_current_correction Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2021-07-12Update Python module comments (#2073)Gravatar David Grote 3-2/+26
* Added explanatory comments in timestepper.py * Add comments to WarpInterface.py * Added comments to WarpXPIC.py
2021-07-09Feature pass MPI comm from Python script to AMReX during initialization (#2034)Gravatar KZhu-ME 3-12/+26
* Added functionality to pass mpi comm from python script to amrex during initialization * Fixed missing _ in MPI._sizeof() * Added functions to get the current processor's rank and total number of processors * Renamed MPI_Comm to _MPI_Comm_type and defined _MPI_Comm_type in except statement * Updated comment to explain why mpi4py needs to be imported before loading libwarpx * Removed ifdef flags that prevent amrex_init_with_inited_mpi from being declared when MPI is off * Changed amrex_init_with_inited_mpi to be declared even when not using mpi, but will be defined to be functionally the same as amrex_init * Defined MPI = None to signify whether MPI is used, to add another check when initializing amrex * Changed ifdef blocks in WarpXWrappers.cpp/h to fix compile errors. Added ifdef block to conditionally declare amrex_init_with_inited_mpi in WarpXWrappers.h to prevent compile error when not using MPI. Removed ifdef block to declare/define same function in WarpXWrappers.cpp since function needs to be declared even when MPI is not used, but will never be called in that case. * Changed BL_USE_MPI to AMREX_USE_MPI and removed incorrect MPI=None statement * Changed BL_USE_MPI to AMREX_USE_MPI * Added test to verify correct passing of MPI communicator to amrex * Added ability to pass mpi_comm to sim.step * Change test to check for differeing outputs when passed different inputs * Removed obsolete comments refactored program to use more shared code * Refactored comments * Updated description to match test * Removed unecessary imports and updated comments
2021-07-06Add possibility to start and stop moving window (#2027)Gravatar thomas clark 2-2/+2
* Add possibility to start and stop moving window * Update Benchmark laserInjection_2d * Update Source/Diagnostics/BTDiagnostics.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * modification of the MoveWindow function in the python interface * False to True for move j in python function Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-07-06Input parameter for AMReX MLMG verbosity (#2041)Gravatar Michael Kieburtz 1-2/+5
* Added warpx_solver_verbosity input parameter - This input paramter is for the electrostatic solver to pass into MLMG::setVerbose(int) - Originally this value was hardcoded to 2 * readded accidently deleted line * Handle the default solver_verbosity value on the C++ side * Verbosity parameter now works the same as warpx.self_fields_max_iters - The input parameter for mlmg verbosity is now warpx.self_fields_verbosity - It still has a default value of 2. * fixed missing comma * added missing parameter to function call * Added documentation entry for warpx.self_fields_verbosity * corrected documentation * fixed formatting mistsake
2021-06-24Refactored basestring to str (#2030)Gravatar kzhu-ME 1-6/+6
2021-06-21Add damped to BC_map (#2021)Gravatar David Grote 1-1/+1
2021-06-14callbacks.py: Fix bound method py2 -> py3 syntax (#2012)Gravatar peterscherpelz 1-1/+1
2021-06-07Call function ReadBCParams() during python execution (#1972)Gravatar roelof-groenewald 2-3/+28
* added ReadBCParams() function call to python execution and added a test of the electrostatic solver executing from python * added separate specification of particle boundary conditions in picmi setup and adjusted the inputs for existing tests to follow the new practice * updated input for rz PICMI test and renamed the electrostatic test to follow standard practice * added arguments for particle boundary conditions to Langmuir RZ test * added dictionary to picmi.py to map from picmistandard field boundary condition specifications to that of WarpX * fixes for failing unit tests; added key, pair 'none' to picmi dictionary of field BCs * also using 'none' for upper boundary condition for RZ test Python_Langmuir_rz_multimode
2021-05-11New Input Parameter for Order of Shape Factors (#1934)Gravatar Edoardo Zoni 1-3/+1
* Define New Input Parameter interpolation.shape_factors_order * Use New Input Parameter, Remove Obsolete Ones * Add New Input Parameter to PICMI Interface * Update Docs, Use New Input Parameter in Remaining Input Files * Cleaning * New Name: algo.particle_shape
2021-05-11Feature - Time dependent Dirichlet boundary conditions for electrostatic ↵Gravatar roelof-groenewald 4-0/+40
simulations (#1761) * Update copyright notices * allow specification of boundary potentials at runtime when using Dirichlet boundary conditions in the electrostatic solver (labframe) * added parsing to boundary potentials specified at runtime to allow time dependence through a mathematical expression with t (time) * updated to picmistandard 0.0.14 in order to set the electrostatic solver convergence threshold * update docs * various changes requested during PR review * fixed issue causing old tests to break and added a new test for time varying boundary potentials * possibly a fix for the failed time varying boundary condition test * changed permission on the analysis file for the time varying BCs test * switched to using yt for data analysis since h5py is not available * made changes compatible with PR#1730; changed potential boundary setting routine to use the ParallelFor construct and set all boundaries in a single call * fixed typo in computePhiRZ * updated docs and fixed other minor typos * fixed bug in returning from loop over dimensions when setting boundary potentials rather than continuing * changed to setting potentials on domain boundaries rather than tilebox boundaries and changed picmi.py to accept boundary potentials * now using domain.surroundingNodes() to get the proper boundary cells for the physical domain * fixed typo in variable name specifying z-boundary potential * changed boundary value parameter for Dirichlet BC to boundary.field_lo/hi and changed setPhiBC() to only loop over the grid points when a boundary value has changed * switched specifying potential boundary values though individual inputs of the form boundary.potential_lo/hi_x/y/z and incorporated the new BC formalism through FieldBoundaryType::Periodic and FieldBoundaryType::PEC rather than Geom(0).isPeriodic(idim) * removed incorrect check of whether the potential boundary values are already correct, also had to change the input to test space_charge_initialization_2d to comply with the new boundary condition input parameters and finally changed permissions to analysis_fields.py file for the embedded boundary test since it was failing * remove line from WarpX-tests.ini that was incorrectly added during upstream merge * changed input file for relativistic space charge initialization to new boundary condition specification * fixed outdated comment and updated documentation to reflect that the Dirichlet BCs can also be specified when using the relativistic electrostatic field solver * moved call to get domain boundaries inside the loop over levels * cleaned up the code some by using domain.smallEnd and domain.bigEnd rather than lbound and ubound * added check that a box contains boundary cells before launching a loop over that box cells to set the boundary conditions Co-authored-by: Peter Scherpelz <peter.scherpelz@modernelectron.com>
2021-02-26For picmi, fix MultiSpecies (#1745)Gravatar David Grote 1-2/+8
2021-02-25Add multiple particles source (#1718)Gravatar David Grote 1-8/+10
* Added multiple particles injection source * Added documentation for MultipleParticles
2021-02-18Add "." to libwarpx Aliases (#1720)Gravatar Axel Huebl 1-4/+3
* Add "." to libwarpx Aliases Add a "." to the suffix of the short-hand `libwarpx.<DIM>.<so|dll>` libs. This unifies the suffix with the structure in executables and makes it easier to find a "long" version of the library (not in this PR). Also fixes the suffix naming on Windows to ".dll", since this is a true C/C++ library, not a Python module (aka not a shared library following Python entry points and conventions). * CMake: Add library alias in install Also add the expected library alias in CMake install prefixes.
2021-02-05Input load balance parameters as `algo.load_balance_param` (#1683)Gravatar Michael E Rowan 1-2/+12
* Load balance params now input as algo. * load balance params to algo * Backward compatibility and knapsack_factor_doc * Update Docs/source/running_cpp/parameters.rst * backward_strings * picmi
2021-02-03Updates to match picmi version 0.0.14 (#1672)Gravatar David Grote 1-0/+1
* Updates to match picmi version 0.0.14 Added call to register constants. * Python: Bump Versions Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-01-22Cleaned up field diagnostic in picmi interface (#1649)Gravatar David Grote 1-11/+2
2021-01-14Unify intervals notation (#1485)Gravatar NeilZaim 1-4/+4
* Unify intervals notation * Fix diagnostic intervals with PICMI * Use new syntax in updated Larmor test * Update PICMI to comply with the standard * Update new hybrid test * Update particles_in_PML test input files
2021-01-11Add electrostatic to picmi (#1548)Gravatar David Grote 1-4/+27
* Update ElectrostaticSolver in picmi * Added relativistic option to picmi ElectrostaticSolver * Update PICMI version * Fix electrostatic with picmi Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2020-12-11PSATD Runtime Control (#1300)Gravatar Axel Huebl 1-3/+2
* Docs: PSATD Runtime Option * Tests: PSATD Runtime Option Add new runtime option to PSATD regression test matrix. * PICMI: PSATD runtime option * Source: PSATD Runtime Option
2020-12-04CMake: objects, shared library, Python (#1519)Gravatar Axel Huebl 1-2/+10
* CMake: libwarpx Reorder CMake builds to collect everything in an object file library, which is then used to link out a shared library and the WarpX executable app. * setup.py: Install up to 3 libs at once Inside CMake build dir: ``` PYWARPX_LIB_DIR=$PWD/lib python3 -m pip wheel ../Python/ ``` * Docs: CMake + Python * CI: Python CMake Package
2020-12-02Fix python wrapper (#1532)Gravatar David Grote 2-61/+71
* Fixes to the Python interface for accessing field and particle data * In Python wrapper, cleaned up how ngrow is handled
2020-12-01Update and fix to picmi.py (#1539)Gravatar David Grote 1-2/+5
2020-11-17use_filter now controls physical and k-space filtering (#1516)Gravatar David Grote 1-7/+2
* use_filter now controls physical and k-space filtering * Added backward compatibility error if use_kspace_filter is set
2020-11-16Update picmi constants to match the values in PhysConst (#1483)Gravatar David Grote 1-6/+12
* Update picmi constants to match the values in PhysConst * In picmi, use string q_e for charge instead of float with charge_state = +-1 * Updated benchmarks of picmi tests
2020-10-22picmi - minor cleanup, removing unneeded input quantities (#1446)Gravatar David Grote 1-9/+0
2020-10-12picmi - do name mangling on expression variables to ensure their uniqueness ↵Gravatar David Grote 2-30/+89
(#1361) Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2020-10-08Add laser phase to gaussian profile (#1155)Gravatar Igor Andriyash 1-0/+1
* added the phase argument for the gaussian laser * removed signature * added laser phase to picmi api * added doc string for phi0 * Update parameters.rst typo fix Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2020-10-05PICMI: read flag for laser continuous injection (#1358)Gravatar Edoardo Zoni 1-1/+3
* PICMI: read flag for laser continuous injection * Simplify assignment of do_continuous_injection * Update PICMI version Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2020-09-22Initial version of use_damp_fields_in_z_guard option (#1304)Gravatar David Grote 1-0/+3
* Initial version of use_damp_in_z_guard option * Fix typo in WarpX.H Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Changed use_damp_in_z_guard to use_damp_fields_in_z_guard * Added documentatin for use_damp_fields_in_z_guard * Clean up for use_damp_fields_in_z_guard * Added use_damp_fields_in_z_guard to picmi interface, and moved it to the psatd input group * For RZ spectral, damping of the fields is on by default when not periodic * Updated documentation for use_damp_fields_in_z_guard Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2020-09-17[Mini]picmi - convert True/False to 1/0 (#1341)Gravatar David Grote 1-0/+2
* picmi - convert True/False to 1/0 * picmi - update picmi input files to use True/False for booleans
2020-09-17picmi - implemented rigid advance species option (#1338)Gravatar David Grote 2-3/+17
2020-09-15For PICMI, expect length 2 args for 2D solver (#1326)Gravatar David Grote 1-4/+8
* picmi - For 2D, changed arguments to expect length 2 lists * picmi - For 2D, guard_cells should be length 2
2020-09-14picmi: replaced warpx_n[xyz]_guard with grid.guard_cells (#1317)Gravatar David Grote 1-6/+4
2020-09-14PICMI analytic applied fields (#1306)Gravatar David Grote 2-1/+60
* PICMI Added applied fields * PICMI fixed typo in Constants * Change picmistandard version requirement to 0.0.9 * Increment required picmi version Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2020-09-14picmi: use kspace filter automatically for RZ PSATD (#1318)Gravatar David Grote 1-5/+4
2020-08-31[mini]Bug fix in ParticleListDistribution (#1252)Gravatar David Grote 1-1/+1
This fixes a small bug in the `picmi.ParticleListDistribution` class.
2020-08-24For PICMI, added more arguments for psatd solver (#1259)Gravatar David Grote 1-6/+16
2020-07-27Input: Remove n<something> options (#1217)Gravatar Axel Huebl 3-7/+5
* Input: Remove n<something> options The information in - lasers.nlasers - particles.nspecies - collisions.ncollisions is redundant with their `<...>.names` counter-part and requires users to change info at two locations. We just remove this now since we can query the size of names automatically in the parser. * Examples: remove n<something> Removes: - lasers.nlasers - particles.nspecies - collisions.ncollisions from examples. * QED: Update nspecies * Removed nspecies and nlasers from the Python interface Co-authored-by: Dave Grote <grote1@llnl.gov>
2020-07-27Rename Input to `algo.maxwell_solver` (#1188)Gravatar Axel Huebl 1-1/+1
* Rename Input to `algo.maxwell_solver` Rename the input option `algo.maxwell_fdtd_solver` to `algo.maxwell_solver` and throw a useful error message for users using the old option. This is in preparation to unify FDTD and PSATD input control to reduce mutually exclusive binary variants of WarpX. * MW Solver Name: Update Examples Update all example to use the new algo.maxwell_solver option. * Fix typo in comutation of dt Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
2020-07-27Added k-space filter for RZ spectral solver (#1006)Gravatar David Grote 1-1/+9
* Added k-space filter for RZ spectral solver * Added SpectralBinomialFilter files for RZ spectral solver * Added RZspectral binomial filter to CMakeLists.txt * Update Docs/source/running_cpp/parameters.rst Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Docs/source/running_cpp/parameters.rst Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/FieldSolver/SpectralSolver/SpectralBinomialFilter.H Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/FieldSolver/SpectralSolver/SpectralBinomialFilter.cpp Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Update Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Fixed literals in SpectralBinomialFilter.cpp * For RZ spectral, apply filter to rho old and new * Added SpectralBinomialFilter::InitFilterArray * For SpectralBinomialFilter, combine R and Z into one routine Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * For SpectralBinomialFilter, combine R and Z into one routine, part 2 Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * For SpectralBinomialFilter, combine R and Z into one routine, part 3 Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
2020-07-02PSATD: current correction works only with global FFTs (#1131)Gravatar Edoardo Zoni 1-2/+2
* Clean up implementation of current correction: - abort when current correction runs with psatd.periodic_single_box_fft=0 - rename input parameter from psatd.do_current_correction to psatd.current_correction - add nodal tests in 2D and 3D (using direct current deposition) - change 2D test: use Esirkepov deposition, instead of direct, as in 3D test - add/update relevant checksum benchmarks * Small clean-up
2020-06-26Removed references to particle E and B from Python (#1122)Gravatar David Grote 2-73/+7