From bb7429d1d6088a2875d2020c1b9a79e66282c296 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Date: Mon, 29 Mar 2021 14:41:35 -0700 Subject: Add option for finite-order centering of currents (nodal to staggered) (#1763) * Start adding centering of current * Implement arbitrary order centering and split inputs * No need to define a brand new interpolation function * Update input file of hybrid CI tests * Clean up * Clean up more * Fix bug and clean up * Use current centering in two existing CI tests * Update documentation * Move Calls To UpdateCurrentNodalToStag Into SyncCurrent * Add Doxygen For New Function UpdateCurrentNodalToStag * Add Doxygen For New Functions Used For Stencil Coefficients * Finite-Order Centering of Currents Not Implemented With MR --- Source/Initialization/WarpXInitData.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Source/Initialization/WarpXInitData.cpp') diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 1852d871f..f07995c84 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -316,6 +316,11 @@ WarpX::InitLevelData (int lev, Real /*time*/) } } + if (WarpX::do_current_centering) + { + current_fp_nodal[lev][i]->setVal(0.0); + } + if (B_ext_grid_s == "constant" || B_ext_grid_s == "default") { Bfield_fp[lev][i]->setVal(B_external_grid[i]); if (fft_do_time_averaging) { -- cgit v1.2.3