11 #include <AMReX_ParallelDescriptor.H>
12 #include <AMReX_ParmParse.H>
13 #include <AMReX_BCRec.H>
14 #include <AMReX_PhysBCFunct.H>
15 #include <AMReX_Array.H>
23 :
public BC<Set::Scalar>
33 const amrex::Box& a_box,
34 int ngrow,
int ,
int , amrex::Real ,
38 const amrex::Real* DX =
m_geom.CellSize();
40 amrex::Box box = a_box;
42 const amrex::Dim3 lo = amrex::lbound(
m_geom.Domain()), hi = amrex::ubound(
m_geom.Domain());
44 amrex::Array4<amrex::Real>
const& in = a_in.array();
46 amrex::ParallelFor(box, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
48 amrex::IntVect glevel;
49 AMREX_D_TERM(glevel[0] = std::max(std::min(0, i - lo.x), i - hi.x);,
50 glevel[1] = std::max(std::min(0, j - lo.y), j - hi.y);,
51 glevel[2] = std::max(std::min(0, k - lo.z), k - hi.z); );
72 else if (glevel[0] > 0)
85 else if (glevel[1] < 0)
90 else if (glevel[1] > 0 && (face == Orientation::yhi || face ==
Orientation::All))
101 int bc_lo[AMREX_SPACEDIM] =
102 {
AMREX_D_DECL(amrex::BCType::mathematicalBndryTypes::int_dir,
103 amrex::BCType::mathematicalBndryTypes::int_dir,
104 amrex::BCType::mathematicalBndryTypes::int_dir) };
105 int bc_hi[AMREX_SPACEDIM] =
106 {
AMREX_D_DECL(amrex::BCType::mathematicalBndryTypes::int_dir,
107 amrex::BCType::mathematicalBndryTypes::int_dir,
108 amrex::BCType::mathematicalBndryTypes::int_dir) };
110 return amrex::BCRec(bc_lo, bc_hi);