aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarpXMovingWindow.cpp
diff options
context:
space:
mode:
authorGravatar Prabhat Kumar <89051199+prkkumar@users.noreply.github.com> 2021-12-16 09:09:32 -0800
committerGravatar GitHub <noreply@github.com> 2021-12-16 09:09:32 -0800
commitb0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91 (patch)
tree87c199a7c3675479bcc8145a98fa264c8dd44633 /Source/Utils/WarpXMovingWindow.cpp
parent2de0fa7cbc0289e92d158759e728bb0313284bcf (diff)
downloadWarpX-b0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91.tar.gz
WarpX-b0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91.tar.zst
WarpX-b0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91.zip
AMREX_SPACEDIM : EB, Filter, Laser, Utils, and Diagnostics (#2677)
* AMREX_SPACEDIM : EB and Filter * AMREX_SPACEDIM : Laser * AMREX_SPACEDIM : Utils * AMREX_SPACEDIM : Diagnostics * Fix Typo * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * AMREX_SPACEDIM : Warpx.cpp * Update Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/Utils/WarpXMovingWindow.cpp')
-rw-r--r--Source/Utils/WarpXMovingWindow.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/Utils/WarpXMovingWindow.cpp b/Source/Utils/WarpXMovingWindow.cpp
index 3bb48d1a5..d844c2317 100644
--- a/Source/Utils/WarpXMovingWindow.cpp
+++ b/Source/Utils/WarpXMovingWindow.cpp
@@ -56,14 +56,14 @@ WarpX::UpdatePlasmaInjectionPosition (amrex::Real a_dt)
// In boosted-frame simulations, the plasma has moved since the last
// call to this function, and injection position needs to be updated
current_injection_position -= WarpX::beta_boost *
-#if ( AMREX_SPACEDIM == 3 )
+#if defined(WARPX_DIM_3D)
WarpX::boost_direction[dir] * PhysConst::c * a_dt;
-#elif ( AMREX_SPACEDIM == 2 )
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
// In 2D, dir=0 corresponds to x and dir=1 corresponds to z
// This needs to be converted in order to index `boost_direction`
// which has 3 components, for both 2D and 3D simulations.
WarpX::boost_direction[2*dir] * PhysConst::c * a_dt;
-#elif ( AMREX_SPACEDIM == 1 )
+#elif defined(WARPX_DIM_1D_Z)
// In 1D, dir=0 corresponds to z
// This needs to be converted in order to index `boost_direction`
// which has 3 components, for 1D, 2D, and 3D simulations.
@@ -371,12 +371,12 @@ WarpX::shiftMF (amrex::MultiFab& mf, const amrex::Geometry& geom, int num_shift,
[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
{
// Compute x,y,z co-ordinates based on index type of mf
-#if (AMREX_SPACEDIM==1)
+#if defined(WARPX_DIM_1D_Z)
amrex::Real x = 0.0;
amrex::Real y = 0.0;
amrex::Real fac_z = (1.0 - mf_type[0]) * dx[0]*0.5;
amrex::Real z = i*dx[0] + real_box.lo(0) + fac_z;
-#elif (AMREX_SPACEDIM==2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
amrex::Real fac_x = (1.0 - mf_type[0]) * dx[0]*0.5;
amrex::Real x = i*dx[0] + real_box.lo(0) + fac_x;
amrex::Real y = 0.0;
@@ -420,36 +420,36 @@ WarpX::ShiftGalileanBoundary ()
amrex::Real time_shift = (cur_time - time_of_last_gal_shift);
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
m_galilean_shift = {
m_v_galilean[0]*time_shift,
m_v_galilean[1]*time_shift,
m_v_galilean[2]*time_shift };
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
m_galilean_shift = {
m_v_galilean[0]*time_shift,
std::numeric_limits<amrex::Real>::quiet_NaN(),
m_v_galilean[2]*time_shift };
-#elif (AMREX_SPACEDIM == 1)
+#elif defined(WARPX_DIM_1D_Z)
m_galilean_shift = {
std::numeric_limits<Real>::quiet_NaN(),
std::numeric_limits<Real>::quiet_NaN(),
m_v_galilean[2]*time_shift };
#endif
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
for (int i=0; i<AMREX_SPACEDIM; i++) {
new_lo[i] = current_lo[i] + m_galilean_shift[i];
new_hi[i] = current_hi[i] + m_galilean_shift[i];
}
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
{
new_lo[0] = current_lo[0] + m_galilean_shift[0];
new_hi[0] = current_hi[0] + m_galilean_shift[0];
new_lo[1] = current_lo[1] + m_galilean_shift[2];
new_hi[1] = current_hi[1] + m_galilean_shift[2];
}
-#elif (AMREX_SPACEDIM == 1)
+#elif defined(WARPX_DIM_1D_Z)
{
new_lo[0] = current_lo[0] + m_galilean_shift[2];
new_hi[0] = current_hi[0] + m_galilean_shift[2];