diff options
author | 2022-01-25 15:01:59 -0800 | |
---|---|---|
committer | 2022-01-25 15:01:59 -0800 | |
commit | 80d468572d6a12bc514f274cb7ae95f3582eb6e5 (patch) | |
tree | 1e7bf28cc3ac747b7c142b43d0c4f66d042c1fb8 /Source/Python/WarpXWrappers.cpp | |
parent | 4833bc877091cc72a786f116ac556985e8d857c5 (diff) | |
download | WarpX-80d468572d6a12bc514f274cb7ae95f3582eb6e5.tar.gz WarpX-80d468572d6a12bc514f274cb7ae95f3582eb6e5.tar.zst WarpX-80d468572d6a12bc514f274cb7ae95f3582eb6e5.zip |
Add SyncRho call to warpx_depositChargeDensity (#2777)
* add SyncRho call to warpx_depositChargeDensity
* expose SyncRho to Python; add warpx_clearChargeDensity to reset rho_fp before deposition
* remove unneeded warpx_clearChargeDensity function
* Apply suggestions from code review
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
* add (default) option to depositChargeDensity to call SyncRho after deposition
* added option to depositChargeDensity to zero out rho_fp before deposition
* code cleanup
* import fields from inside depositChargeDensity
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/Python/WarpXWrappers.cpp')
-rw-r--r-- | Source/Python/WarpXWrappers.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Python/WarpXWrappers.cpp b/Source/Python/WarpXWrappers.cpp index 061e80c6a..6703bb665 100644 --- a/Source/Python/WarpXWrappers.cpp +++ b/Source/Python/WarpXWrappers.cpp @@ -623,9 +623,6 @@ namespace return; } - // reset rho before depositing - rho_fp->setVal(0.); - for (WarpXParIter pti(myspc, lev); pti.isValid(); ++pti) { const long np = pti.numParticles(); @@ -662,6 +659,10 @@ namespace WarpX& warpx = WarpX::GetInstance(); warpx.FillBoundaryB (warpx.getngE()); } + void warpx_SyncRho () { + WarpX& warpx = WarpX::GetInstance(); + warpx.SyncRho(); + } void warpx_SyncCurrent () { WarpX& warpx = WarpX::GetInstance(); warpx.SyncCurrent (); |