aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarpXMovingWindow.cpp
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2019-05-29 11:13:49 -0700
committerGravatar GitHub <noreply@github.com> 2019-05-29 11:13:49 -0700
commit83fef5b08c6632cb6461b42412731b6d1c00308f (patch)
tree0ecb39949fcb298e4abaec2f5afe6153770d7b8e /Source/Utils/WarpXMovingWindow.cpp
parent24147a2d9977426c8c3461b9f6459e0834d3ce7a (diff)
parentc5ef5d1dcde41d1add1d56c5823fcc49a1bb0683 (diff)
downloadWarpX-83fef5b08c6632cb6461b42412731b6d1c00308f.tar.gz
WarpX-83fef5b08c6632cb6461b42412731b6d1c00308f.tar.zst
WarpX-83fef5b08c6632cb6461b42412731b6d1c00308f.zip
Merge pull request #97 from RevathiJambunathan/SliceGeneration_IndexTypeofData_Diagnostics
Slice generation index typeof data diagnostics
Diffstat (limited to 'Source/Utils/WarpXMovingWindow.cpp')
-rw-r--r--Source/Utils/WarpXMovingWindow.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/Utils/WarpXMovingWindow.cpp b/Source/Utils/WarpXMovingWindow.cpp
index a0ab1f26f..ae781f9aa 100644
--- a/Source/Utils/WarpXMovingWindow.cpp
+++ b/Source/Utils/WarpXMovingWindow.cpp
@@ -65,6 +65,26 @@ WarpX::MoveWindow (bool move_j)
ResetProbDomain(RealBox(new_lo, new_hi));
+ // Moving slice coordinates - lo and hi - with moving window //
+ // slice box is modified only if slice diagnostics is initialized in input //
+ if ( slice_plot_int > 0 )
+ {
+ Real new_slice_lo[AMREX_SPACEDIM];
+ Real new_slice_hi[AMREX_SPACEDIM];
+ const Real* current_slice_lo = slice_realbox.lo();
+ const Real* current_slice_hi = slice_realbox.hi();
+ for ( int i = 0; i < AMREX_SPACEDIM; i++) {
+ new_slice_lo[i] = current_slice_lo[i];
+ new_slice_hi[i] = current_slice_hi[i];
+ }
+ int num_shift_base_slice = static_cast<int> ((moving_window_x -
+ current_slice_lo[dir]) / cdx[dir]);
+ new_slice_lo[dir] = current_slice_lo[dir] + num_shift_base_slice*cdx[dir];
+ new_slice_hi[dir] = current_slice_hi[dir] + num_shift_base_slice*cdx[dir];
+ slice_realbox.setLo(new_slice_lo);
+ slice_realbox.setHi(new_slice_hi);
+ }
+
int num_shift = num_shift_base;
int num_shift_crse = num_shift;