aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/WarpXPushFieldsEM.cpp
diff options
context:
space:
mode:
authorGravatar Olga Shapoval <30510597+oshapoval@users.noreply.github.com> 2020-07-08 07:51:01 -0700
committerGravatar GitHub <noreply@github.com> 2020-07-08 07:51:01 -0700
commitcaa138c8cc6b877888e8a7b18ef7cb72882b18d5 (patch)
treecf7eb52a6c4d93233664da6b86dbd7a4bbacc18b /Source/FieldSolver/WarpXPushFieldsEM.cpp
parentff34274fa4e2eff4942847c57243e140e7b12fc8 (diff)
downloadWarpX-caa138c8cc6b877888e8a7b18ef7cb72882b18d5.tar.gz
WarpX-caa138c8cc6b877888e8a7b18ef7cb72882b18d5.tar.zst
WarpX-caa138c8cc6b877888e8a7b18ef7cb72882b18d5.zip
Averaged Galilean PSATD (#869)
* Read Galilean velocity * Prepare structures for Galilean solver * Started implementing Galilean equations * Analytical limits for X1, X2, X3, X4 coefficients added * Slight changes added * Added Galilean position pusher * Scale galilean velocity * Remove unneeded Abort * Fix Galilean pusher * Allocate Theta2 array * Fix definition of coefficients * Increase guard cells for Galilean * Add guard cell in particle exchange * Added modifications for PICSAR galilean branch * Averaged coefficients added * Type corrected * v_gal added to warpx_current_deposition * v_gal added to WarpXParticleContainer.H * Bug fixed - update particle x-position over one time step * Fix issues with merge from dev * Averaged fileds allocated on fine patch (Ex) * Preparation for merging dev into galilean. * remove TABs by hand * Removed a tab. * Redeclared v_galilean as a vector & related changed * Added an automated test * Moved v_galilean inside WarpX constructor * Added analysis script for the automated test * Changed name of the automated test to galilean_psatd * Added InitializeSpectralCoefficients method * Removed temporary comments * Averaged fields added to FiledGather * Added infinite order k[i] * Setting kx_mod( kz_mod) = 0 for index = nx/2(-nz/2) * Adding galilean shift * Implemented galilean shift * Changed method's name from GalileanShift to ShiftGalileanBoundary * Added doxygen string for ShiftGalileanBoundary * Removed never used method LowerCornerWithCentering * Removed temporary comments * Removed dt as a variable from DepositCharge method and its dependencies * Changing type of v_galilean from amrex::Vector to amrex::Array * Changed back ng_fft to be equal nox_fft * Changed v_galilean's type from amrex::vector to amrex::array * Removed type * Removed temporary comments * Added flag 'do_time_averaging' to swith from unaveraged to averaged Galilean PSATD * Updated doxygen * Small fix on using 'do_time_averaging' flag * Remove some commented Print statements * [skip ci] Further cleanup * Fix compilation * Guard cells update of the averaged E,B fields * Corrected included header file accordingly * Removed EOL * Removed EOL * Corrected path of the included header file * Updated choice of the spectral solver. * Cleanup. * use amrex::exp instead of std::exp * no backward FFT for avg fields if avg is off * Need to shift avg fields in MoveWindow * Further cleaning * Added 2D automated test for averaged PSATD * Added automated 2D and 3D tests for averaged PSATD * Removed comments * Added specifications for averaged Galilean PSATD tests. * Bug fixed - do FillBoundary of the averaged fields only if averaged is activated * Do shiftMF of the averaged fields only if fft_do_time_averaging=true * Add checksum json benchmarks for averaged Galilean PSATD * Add missing indentation * Add missing indentation * Updated automated analysis script * Updated diags period * Fixed bug: no backtransform of the averaged fields when WARPX_DIM_RZ is set * Fixed an uninitialized variable * Clean-up * Changed permissions for analysis_avg_*d.py * Compactified variables initialization via conditional assignment * Initialized averaged E_avg, B_avg fields * Updated automated test for 2D averaged galilean PSATD * Updated benchmark for 2D averaged galilean PSATD * Updated automated 2D averaged PSATD test & benchmark * Updated automated 3D averaged PSATD test & benchmark * Fixed typo * Updated benchmark averaged_galilean_3d_psatd * Initialize the averaged fields only if the averaged Galilean PSATD algorithm is enabled * Encreased time step for automated 3D averaged Galilean PSATD (to be equal c*dt=dz while dz/dx=3) * Updated 3D automated test: specified standard deviations `.ux_th, .uy_th, .uz_th` along each direction * Typo from the previous commit: enabled the averaged algorithm * Trying out another input parameters for 3D averaged automated test with v_gal = v_plasma * Update benchmark for previously added 3D averaged automated test * Update 2D averaged automated test and corresponding benchmark * Revert "Updated diags period" This reverts commit 7334729b05e96589e020c981efdb430ca095991d. * Cleanup: removed unwanted comment. * Added descriptions of the 2D and 3D automated tests for the averaged Galilean PSATD. * Updated value calculated via standard Galilean PSATD. * Encreased relative error tolerance for 3D automated test for the averaged Galilean PSATD. * Removed to avoid duplication since it already specified in the corresponding 2D/3D input scripts. * Removed unwanted empty lines * Added spaces after function's names * Removed unwanted empty line * Removed * Fixed indentation * Cleanup: removed #include <math.h> * Cleanup: removed empty lines and fixed indentation * Added 'AvgGalileanAlgorithm.cpp' to 'CMakeLists.txt' Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> Co-authored-by: MaxThevenet <mthevenet@lbl.gov>
Diffstat (limited to 'Source/FieldSolver/WarpXPushFieldsEM.cpp')
-rw-r--r--Source/FieldSolver/WarpXPushFieldsEM.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/Source/FieldSolver/WarpXPushFieldsEM.cpp b/Source/FieldSolver/WarpXPushFieldsEM.cpp
index 1925bd883..a6487cf13 100644
--- a/Source/FieldSolver/WarpXPushFieldsEM.cpp
+++ b/Source/FieldSolver/WarpXPushFieldsEM.cpp
@@ -36,10 +36,12 @@ namespace {
#endif
std::array<std::unique_ptr<amrex::MultiFab>,3>& Efield,
std::array<std::unique_ptr<amrex::MultiFab>,3>& Bfield,
+ std::array<std::unique_ptr<amrex::MultiFab>,3>& Efield_avg,
+ std::array<std::unique_ptr<amrex::MultiFab>,3>& Bfield_avg,
std::array<std::unique_ptr<amrex::MultiFab>,3>& current,
std::unique_ptr<amrex::MultiFab>& rho ) {
- using Idx = SpectralFieldIndex;
+ using Idx = SpectralAvgFieldIndex;
// Perform forward Fourier transform
#ifdef WARPX_DIM_RZ
@@ -87,6 +89,18 @@ namespace {
solver.BackwardTransform(*Bfield[1], Idx::By);
#endif
solver.BackwardTransform(*Bfield[2], Idx::Bz);
+
+#ifndef WARPX_DIM_RZ
+ if (solver.fft_do_time_averaging){
+ solver.BackwardTransform(*Efield_avg[0], Idx::Ex_avg);
+ solver.BackwardTransform(*Efield_avg[1], Idx::Ey_avg);
+ solver.BackwardTransform(*Efield_avg[2], Idx::Ez_avg);
+
+ solver.BackwardTransform(*Bfield_avg[0], Idx::Bx_avg);
+ solver.BackwardTransform(*Bfield_avg[1], Idx::By_avg);
+ solver.BackwardTransform(*Bfield_avg[2], Idx::Bz_avg);
+ }
+#endif
}
}
@@ -109,10 +123,10 @@ WarpX::PushPSATD (int lev, amrex::Real /* dt */)
{
// Update the fields on the fine and coarse patch
PushPSATDSinglePatch( *spectral_solver_fp[lev],
- Efield_fp[lev], Bfield_fp[lev], current_fp[lev], rho_fp[lev] );
+ Efield_fp[lev], Bfield_fp[lev], Efield_avg_fp[lev], Bfield_avg_fp[lev], current_fp[lev], rho_fp[lev] );
if (spectral_solver_cp[lev]) {
PushPSATDSinglePatch( *spectral_solver_cp[lev],
- Efield_cp[lev], Bfield_cp[lev], current_cp[lev], rho_cp[lev] );
+ Efield_cp[lev], Bfield_cp[lev], Efield_avg_cp[lev], Bfield_avg_cp[lev], current_cp[lev], rho_cp[lev] );
}
}
#endif
ng-slash-object'>plt-1768-trailing-slash-object Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/examples/framework-lit (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-02-06[ci] update lockfile (#2527)Gravatar Fred K. Schott 1-208/+238
2022-02-06[ci] collect statsGravatar FredKSchott 1-0/+1
2022-02-05[ci] collect statsGravatar FredKSchott 1-0/+1
2022-02-04[ci] yarn formatGravatar natemoo-re 1-2/+3
2022-02-04fix: HTML/SVG boolean attributes (#2538)Gravatar Nate Moore 2-3/+21
2022-02-04[ci] yarn formatGravatar matthewp 1-4/+2
2022-02-04fix: import local plugins into markdown (#2534)Gravatar Juan Martín Seery 9-22/+41
2022-02-04[ci] collect statsGravatar FredKSchott 1-0/+1
2022-02-03Append to list of HMR modules, don't override (#2532)Gravatar Matthew Phillips 2-1/+6
2022-02-03add back dev server host support (#2531)Gravatar Fred K. Schott 2-1/+14
2022-02-03simplify status code regexGravatar Fred K. Schott 2-87/+4
2022-02-03Adding StackUp Digital to the list of sponsors (#2521)Gravatar Astroalex 3-0/+10
2022-02-03[ci] collect statsGravatar FredKSchott 1-0/+1
2022-02-03[ci] yarn formatGravatar FredKSchott 2-3/+85
2022-02-02Handles all http error code file names the same as 404 files. (#2525)Gravatar Zade Viggers 2-4/+7
2022-02-02fix(sitemap): remove debug if sitemap disabled (#2514)Gravatar Mark Pinero 1-2/+2
2022-02-02[ci] update lockfile (#2515)Gravatar Fred K. Schott 1-276/+279
2022-02-02[ci] yarn formatGravatar matthewp 1-8/+8
2022-02-02[ci] release (next) (#2523)astro@0.23.0-next.1Gravatar github-actions[bot] 28-34/+41
2022-02-02[ci] yarn formatGravatar matthewp 2-17/+29
2022-02-02Fix support for scss in static build (#2522)Gravatar Matthew Phillips 6-20/+114
2022-02-02[ci] collect statsGravatar FredKSchott 1-0/+1
2022-02-01[ci] yarn formatGravatar matthewp 2-12/+12
2022-02-01[ci] release (next) (#2492)astro@0.23.0-next.0@astrojs/test-static-build-pkg@0.0.2@astrojs/markdown-remark@0.6.1-next.0Gravatar github-actions[bot] 31-43/+93
2022-02-01[ci] collect statsGravatar FredKSchott 1-0/+1
2022-01-31update congratsbot format againGravatar Fred K. Schott 1-1/+1
2022-01-31update congratsbot againGravatar Fred K. Schott 1-1/+1
2022-01-31Remove SVG animation on GitHub/NPM (#2512)Gravatar Nate Moore 1-21/+0
2022-01-31[ci] yarn formatGravatar natemoo-re 2-4/+6
2022-01-31Add Shiki as an alternative to Prism (#2497)Gravatar Juan Martín Seery 26-9/+356
2022-01-31Deprecate unescaped HTML inside of expressions (#2489)Gravatar Nate Moore 9-31/+74