Skip to content

Commit 8b1df67

Browse files
authored
OpenBC FFT Solver: Fix 2d mode bug (#4703)
PR #4671 did not fix all the issues with the 2d mode OpenBC FFT solver in 3D WarpX/ImpactX runs. The scaling was still wrong.
1 parent 4b4347a commit 8b1df67

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

Src/FFT/AMReX_FFT_R2C.H

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,12 +1228,8 @@ T R2C<T,D,C>::scalingFactor () const
12281228
{
12291229
#if (AMREX_SPACEDIM == 3)
12301230
if (m_info.twod_mode) {
1231-
if (m_real_domain.length(2) > 1) {
1232-
return T(1)/T(Long(m_real_domain.length(0)) *
1233-
Long(m_real_domain.length(1)));
1234-
} else {
1235-
return T(1)/T(m_real_domain.length(0));
1236-
}
1231+
return T(1)/T(Long(m_real_domain.length(0)) *
1232+
Long(m_real_domain.length(1)));
12371233
} else
12381234
#endif
12391235
{

Src/FFT/AMReX_FFT_R2X.H

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,7 @@ R2X<T>::R2X (Box const& domain,
187187
} // else: x-fft: r2r(m_rx)
188188

189189
#if (AMREX_SPACEDIM >= 2)
190-
191-
#if (AMREX_SPACEDIM == 2)
192-
bool batch_on_y = false;
193-
#else
194-
bool batch_on_y = m_info.twod_mode && (m_dom_0.length(2) == 1);
195-
#endif
196-
197-
if ((domain.length(1) > 1) && !batch_on_y) {
190+
if (domain.length(1) > 1) {
198191
if (! m_cx.empty()) {
199192
// copy(m_cx->m_cy)
200193
m_dom_cy = Box(IntVect(0), IntVect(AMREX_D_DECL(m_dom_cx.bigEnd(1),

0 commit comments

Comments
 (0)