Block-Structured AMR Software Framework
AMReX_extrapolater_1D_K.H
Go to the documentation of this file.
1 #ifndef AMReX_extrapolater_1D_K_H_
2 #define AMReX_extrapolater_1D_K_H_
3 #include <AMReX_Config.H>
4 
5 namespace amrex {
6 
9 void
11  int nComp,
13  amrex::Array4<amrex::Real> const& data) noexcept
14 {
15  constexpr int crsecell = 0;
16 
17  const auto lo = amrex::lbound(bx);
18  const auto hi = amrex::ubound(bx);
19 
20  if (mask(lo.x-1,lo.y,lo.z) == crsecell) {
21  for (int n = 0; n < nComp; n++) {
22  data(lo.x-1,lo.y,lo.z,n) = data(lo.x,lo.y,lo.z,n);
23  }
24  }
25  if (mask(hi.x+1,hi.y,hi.z) == crsecell) {
26  for (int n = 0; n < nComp; n++) {
27  data(hi.x+1,hi.y,hi.z,n) = data(hi.x,hi.y,hi.z,n);
28  }
29  }
30 
31 }
32 
35 void
36 amrex_first_order_extrap_gpu(int i, int j, int k, int n,
37  amrex::Box const& bx,
39  amrex::Array4<amrex::Real> const& data) noexcept
40 {
41  constexpr int crsecell = 0;
42 
43  const auto lo = amrex::lbound(bx);
44  const auto hi = amrex::ubound(bx);
45 
46  if ( (i == lo.x-1) && ( mask(i,j,k) == crsecell ) ) {
47  data(i,j,k,n) = data(i+1,j,k,n);
48  }
49 
50  if ( (i == hi.x+1) && ( mask(i,j,k) == crsecell ) ) {
51  data(i,j,k,n) = data(i-1,j,k,n);
52  }
53 }
54 
55 }
56 #endif
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
Array4< int const > mask
Definition: AMReX_InterpFaceRegister.cpp:93
Definition: AMReX_Amr.cpp:49
int nComp(FabArrayBase const &fa)
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
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void amrex_first_order_extrap_gpu(int i, int j, int k, int n, amrex::Box const &bx, amrex::Array4< const int > const &mask, amrex::Array4< amrex::Real > const &data) noexcept
Definition: AMReX_extrapolater_1D_K.H:36
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void amrex_first_order_extrap_cpu(amrex::Box const &bx, int nComp, amrex::Array4< const int > const &mask, amrex::Array4< amrex::Real > const &data) noexcept
Definition: AMReX_extrapolater_1D_K.H:10
Definition: AMReX_Array4.H:61