1 #ifndef ERF_FFT_UTILS_H_
2 #define ERF_FFT_UTILS_H_
8 inline Array<std::pair<FFT::Boundary,FFT::Boundary>,AMREX_SPACEDIM>
9 get_fft_bc (Geometry
const& lev_geom,
10 Array<std::string,2*AMREX_SPACEDIM> l_domain_bc_type,
11 Box
const& bounding_box) noexcept
13 Array<std::pair<FFT::Boundary,FFT::Boundary>,AMREX_SPACEDIM> r;
15 for (
int dir = 0; dir <= 1; dir++)
17 auto bc_type_lo = l_domain_bc_type[Orientation(dir,Orientation::low)];
18 auto bc_type_hi = l_domain_bc_type[Orientation(dir,Orientation::high)];
20 if ( lev_geom.isPeriodic(dir) &&
21 (lev_geom.Domain().smallEnd(dir) == bounding_box.smallEnd(dir)) &&
22 (lev_geom.Domain().bigEnd(dir) == bounding_box.bigEnd(dir)) ) {
23 r[dir] = std::make_pair(FFT::Boundary::periodic,FFT::Boundary::periodic);
27 else if ( (lev_geom.Domain().smallEnd(dir) == bounding_box.smallEnd(dir)) &&
28 (lev_geom.Domain().bigEnd(dir) == bounding_box.bigEnd(dir)) &&
29 (bc_type_lo !=
"Outflow" && bc_type_lo !=
"Open") &&
30 (bc_type_hi !=
"Outflow" && bc_type_hi !=
"Open") )
32 r[dir] = std::make_pair(FFT::Boundary::even,FFT::Boundary::even);
36 else if ( (lev_geom.Domain().smallEnd(dir) == bounding_box.smallEnd(dir)) &&
37 (lev_geom.Domain().bigEnd(dir) == bounding_box.bigEnd(dir)) &&
38 (bc_type_lo ==
"Outflow" || bc_type_lo ==
"Open") &&
39 (bc_type_hi ==
"Outflow" || bc_type_hi ==
"Open") )
41 r[dir] = std::make_pair(FFT::Boundary::odd,FFT::Boundary::odd);
45 else if ( (lev_geom.Domain().smallEnd(dir) == bounding_box.smallEnd(dir)) &&
46 (bc_type_lo ==
"Outflow" || bc_type_lo ==
"Open") )
48 r[dir] = std::make_pair(FFT::Boundary::odd,FFT::Boundary::even);
52 else if ( (lev_geom.Domain().bigEnd(dir) == bounding_box.bigEnd(dir)) &&
53 (bc_type_hi ==
"Outflow" || bc_type_hi ==
"Open") )
55 r[dir] = std::make_pair(FFT::Boundary::even,FFT::Boundary::odd);
60 r[dir] = std::make_pair(FFT::Boundary::even,FFT::Boundary::even);
68 r[2] = std::make_pair(FFT::Boundary::even,FFT::Boundary::even);
Definition: ERF_ConsoleIO.cpp:12