diff --git a/classROMSXPhysBCFunct.html b/classROMSXPhysBCFunct.html index 1ee9c67d..74247c89 100644 --- a/classROMSXPhysBCFunct.html +++ b/classROMSXPhysBCFunct.html @@ -1254,7 +1254,6 @@

-

if there are cells not in the valid + periodic grown box we need to fill them here

21 {
22  if (m_geom.isAllPeriodic()) return;
23 
@@ -1276,76 +1275,38 @@

39 #pragma omp parallel if (Gpu::notInLaunchRegion())

40 #endif
41  {
-
42  Vector<BCRec> bcrs(ncomp);
+
42  if (mf.boxArray()[0].ixType() == IndexType(IntVect(0,0,0))) {
43 
-
44  // Do all BCs except MOST
-
45  for (MFIter mfi(mf); mfi.isValid(); ++mfi)
-
46  {
-
47  const Array4<Real>& dest_arr = mf.array(mfi);
-
48  Box bx = mfi.validbox(); bx.grow(nghost);
+
44  // Cell-centered arrays only
+
45  for (MFIter mfi(mf); mfi.isValid(); ++mfi)
+
46  {
+
47  const Array4<Real>& dest_arr = mf.array(mfi);
+
48  Box bx = mfi.validbox(); bx.grow(nghost);
49 
-
50  Array4<const Real> velx_arr;
-
51  Array4<const Real> vely_arr;
-
52 
-
53  //! if there are cells not in the valid + periodic grown box
-
54  //! we need to fill them here
-
55  //!
-
56  if (!gdomain.contains(bx) || (mf.boxArray()[0].ixType() == IndexType(IntVect(0,0,1))) )
-
57  {
-
58  if (mf.boxArray()[0].ixType() == IndexType(IntVect(1,0,0)))
-
59  {
-
60  // AMREX_ALWAYS_ASSERT(ncomp == 1 && icomp == 0);
-
61  impose_xvel_bcs(dest_arr,bx,domain,dxInv,time,bccomp);
-
62 
-
63  } else if (mf.boxArray()[0].ixType() == IndexType(IntVect(0,1,0)))
-
64  {
-
65  // AMREX_ALWAYS_ASSERT(ncomp == 1 && icomp == 0);
-
66  impose_yvel_bcs(dest_arr,bx,domain,dxInv,time,bccomp);
-
67 
-
68  } else if (mf.boxArray()[0].ixType() == IndexType(IntVect(0,0,1)))
-
69  {
-
70  AMREX_ALWAYS_ASSERT(ncomp == 1 && icomp == 0);
-
71  // amrex::Warning("Dont know what to do with zvel in FillPatch!");
-
72  // impose_zvel_bcs(dest_arr,bx,domain,velx_arr,vely_arr,dx,dxInv,
-
73  // time,bccomp);
-
74 
-
75  } else if (mf.boxArray()[0].ixType() == IndexType(IntVect(0,0,0)))
-
76  {
-
77  AMREX_ALWAYS_ASSERT(icomp == 0 && icomp+ncomp <= NCONS);
-
78  impose_cons_bcs(dest_arr,bx,domain,
-
79  dxInv,icomp,ncomp,time,bccomp);
-
80  } else {
-
81  amrex::Abort("Dont know this box type in ROMSX_PhysBC");
-
82  }
-
83 
-
84  // ****************************************************************************
-
85  // Based on BCRec for the domain, we need to make BCRec for this Box
-
86  // bccomp is used as starting index for m_domain_bcs_type
-
87  // 0 is used as starting index for bcrs
-
88  // ****************************************************************************
-
89  amrex::setBC(bx, domain, bccomp, 0, ncomp, m_domain_bcs_type, bcrs);
-
90 
-
91  // xlo: ori = 0
-
92  // ylo: ori = 1
-
93  // zlo: ori = 2
-
94  // xhi: ori = 3
-
95  // yhi: ori = 4
-
96  // zhi: ori = 5
-
97 
-
98  amrex::Gpu::DeviceVector<BCRec> bcrs_d(ncomp);
-
99 #ifdef AMREX_USE_GPU
-
100  Gpu::htod_memcpy_async
-
101  (bcrs_d.data(), bcrs.data(), sizeof(BCRec)*ncomp);
-
102 #else
-
103  std::memcpy
-
104  (bcrs_d.data(), bcrs.data(), sizeof(BCRec)*ncomp);
-
105 #endif
-
106 
-
107  Gpu::streamSynchronize(); // because of bcrs_d
-
108  } // !gdomain.contains(bx)
-
109  } // MFIter
-
110  } // OpenMP
-
111 } // operator()
+
50  if (!gdomain.contains(bx)) {
+
51  AMREX_ALWAYS_ASSERT(icomp == 0 && icomp+ncomp <= NCONS);
+
52  impose_cons_bcs(dest_arr,bx,domain,
+
53  dxInv,icomp,ncomp,time,bccomp);
+
54  }
+
55  } // mfi
+
56 
+
57  } else {
+
58 
+
59  // Face-based arrays only
+
60  for (MFIter mfi(mf); mfi.isValid(); ++mfi)
+
61  {
+
62  Box bx = mfi.validbox(); bx.grow(nghost);
+
63 
+
64  if (!gdomain.contains(bx)) {
+
65  for (int nn = 0; nn < ncomp; nn++) {
+
66  const Array4<Real>& dest_arr = mf.array(mfi,nn);
+
67  impose_xvel_bcs(dest_arr,bx,domain,dxInv,time,bccomp);
+
68  }
+
69  }
+
70  } // mfi
+
71  } // box type
+
72  } // OpenMP
+
73 } // operator()

Referenced by FillBoundary().