Block-Structured AMR Software Framework
AMReX_MLCellABecLap_1D_K.H
Go to the documentation of this file.
1 #ifndef AMREX_MLCELLABECLAP_1D_K_H_
2 #define AMREX_MLCELLABECLAP_1D_K_H_
3 #include <AMReX_Config.H>
4 
5 namespace amrex {
6 
8 int coarsen_overset_mask (Box const& bx, Array4<int> const& cmsk, Array4<int const> const& fmsk)
9  noexcept
10 {
11  int nerrors = 0;
12  const auto lo = amrex::lbound(bx);
13  const auto hi = amrex::ubound(bx);
14  for (int i = lo.x; i <= hi.x; ++i) {
15  int ii = 2*i;
16  cmsk(i,0,0) = fmsk(ii,0,0) + fmsk(ii+1,0,0);
17  if (cmsk(i,0,0) == 2) {
18  cmsk(i,0,0) = 1;
19  } else if (cmsk(i,0,0) != 0) {
20  ++nerrors;
21  }
22  }
23  return nerrors;
24 }
25 
27 void coarsen_overset_mask (int i, int, int, Array4<int> const& cmsk,
28  Array4<int const> const& fmsk) noexcept
29 {
30  int ii = 2*i;
31  cmsk(i,0,0) = fmsk(ii,0,0) + fmsk(ii+1,0,0);
32  if (cmsk(i,0,0) == 2) {
33  cmsk(i,0,0) = 1;
34  }
35 }
36 
37 }
38 
39 #endif
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int coarsen_overset_mask(Box const &bx, Array4< int > const &cmsk, Array4< int const > const &fmsk) noexcept
Definition: AMReX_MLCellABecLap_1D_K.H:8
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 ubound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:315
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 lbound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:308