diff --git a/Source/Diagnostics/BTDiagnostics.cpp b/Source/Diagnostics/BTDiagnostics.cpp index fb83f5a65e7..aba5cc14874 100644 --- a/Source/Diagnostics/BTDiagnostics.cpp +++ b/Source/Diagnostics/BTDiagnostics.cpp @@ -906,7 +906,6 @@ BTDiagnostics::DefineFieldBufferMultiFab (const int i_buffer, const int lev) auto & warpx = WarpX::GetInstance(); const int hi_k_lab = m_buffer_k_index_hi[i_buffer][lev]; - amrex::Print() << "hi_k_lab = " << hi_k_lab << "\n"; m_buffer_box[i_buffer][lev].setSmall( m_moving_window_dir, hi_k_lab - m_buffer_size + 1); m_buffer_box[i_buffer][lev].setBig( m_moving_window_dir, hi_k_lab ); amrex::BoxArray buffer_ba( m_buffer_box[i_buffer][lev] ); @@ -957,7 +956,6 @@ BTDiagnostics::DefineFieldBufferMultiFab (const int i_buffer, const int lev) // Refine the geometry object defined at the previous level, lev-1 m_geom_output[i_buffer][lev] = amrex::refine( m_geom_output[i_buffer][lev-1], WarpX::RefRatio(lev-1) ); - //amrex::Print() << "DefineFieldBufferMultiFab lev == 1 : m_geom_output[i_buffer][lev] = " << m_geom_output[i_buffer][lev] << "\n"; } m_field_buffer_multifab_defined[i_buffer] = 1; WARPX_ALWAYS_ASSERT_WITH_MESSAGE( m_mf_output[i_buffer][lev].boxArray().size() == 1, diff --git a/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp b/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp index f6f2bcd1205..874ad1ec0c6 100644 --- a/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp +++ b/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp @@ -60,6 +60,14 @@ BackTransformFunctor::operator ()(amrex::MultiFab& mf_dst, int /*dcomp*/, const const int scomp = 0; // Generate slice of the cell-centered multifab containing boosted-frame field-data // at current z-boost location for the ith buffer + // Create a 2D box for the slice in the boosted frame + const amrex::Real dx = geom.CellSize(moving_window_dir); + // index corresponding to z_boost location in the boost-frame + const int i_boost = static_cast ( ( m_current_z_boost[i_buffer] + - geom.ProbLo(moving_window_dir) ) / dx ); + amrex::Box box = warpx.boxArray(m_lev).minimalBox() ; + // Checking if the index of the slice is within the box of the boosted frame region at level, m_lev + if ( !( (i_boost > box.smallEnd(moving_window_dir) ) && (i_boost < box.bigEnd(moving_window_dir) ) ) ) return; slice = amrex::get_slice_data(moving_window_dir, m_current_z_boost[i_buffer], *m_mf_src, @@ -70,12 +78,6 @@ BackTransformFunctor::operator ()(amrex::MultiFab& mf_dst, int /*dcomp*/, const // Perform in-place Lorentz-transform of all the fields stored in the slice. LorentzTransformZ( *slice, gamma_boost, beta_boost); - // Create a 2D box for the slice in the boosted frame - const amrex::Real dx = geom.CellSize(moving_window_dir); - // index corresponding to z_boost location in the boost-frame - const int i_boost = static_cast ( ( m_current_z_boost[i_buffer] - - geom.ProbLo(moving_window_dir) ) / dx ); - // z-Slice at i_boost with x,y indices same as buffer_box amrex::Box slice_box = m_buffer_box[i_buffer]; slice_box.setSmall(moving_window_dir, i_boost); slice_box.setBig(moving_window_dir, i_boost);