From 51e866e9a3f450d7767df97b0a2011cf65857c7a Mon Sep 17 00:00:00 2001 From: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Date: Thu, 27 Feb 2020 11:17:56 -0800 Subject: Implement div(E) diagnostics for spectral case (#720) * Implement div(E) diagnostics for spectral case. * split travis tests in bigger matrix * split more TravisCI tests, add electrostatic, use defaults values * typo * Move computation of div(E) to base class SpectralBaseAlgorithm. * need to split psatd too * consistent variable names and use function to avoid duplication * fix typo for qed tests * typo * also need to update run_tests.sg * Update copyright tags. * change matrix * Add test of div(E) vs rho/epsilon_0 in PML test. * SpectralFieldIndex: reuse memory slot for Bx when computing divE. Co-authored-by: MaxThevenet --- Source/FieldSolver/SpectralSolver/SpectralFieldData.H | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Source/FieldSolver/SpectralSolver/SpectralFieldData.H') diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H index 2c5a45faa..db3979796 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H +++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H @@ -20,10 +20,12 @@ // Declare type for spectral fields using SpectralField = amrex::FabArray< amrex::BaseFab >; -/** Index for the regular fields, when stored in spectral space */ +/** Index for the regular fields, when stored in spectral space: + * - n_fields is automatically the total number of fields + * - divE reuses the memory slot for Bx, since Bx is not used when computing divE + */ struct SpectralFieldIndex { - enum { Ex=0, Ey, Ez, Bx, By, Bz, Jx, Jy, Jz, rho_old, rho_new, n_fields }; - // n_fields is automatically the total number of fields + enum { Ex=0, Ey, Ez, Bx, By, Bz, Jx, Jy, Jz, rho_old, rho_new, n_fields, divE=3 }; }; /** Index for the PML fields, when stored in spectral space */ -- cgit v1.2.3