2 #ifndef AMREX_INTERPBNDRYDATA_H_
3 #define AMREX_INTERPBNDRYDATA_H_
4 #include <AMReX_Config.H>
36 template <
typename MF>
93 int bnd_start,
int num_comp, const
IntVect& ratio,
117 template <typename MF>
126 template <
typename MF>
135 #pragma omp parallel if (Gpu::notInLaunchRegion())
139 const Box& bx = mfi.validbox();
145 auto & bnd_fab = this->
bndry[face][mfi];
146 auto const& src_fab = mf[mfi];
147 auto const& bnd_array = bnd_fab.array();
148 auto const& src_array = src_fab.const_array();
149 const Box&
b = src_fab.box() & bnd_fab.box();
152 bnd_array(i,j,k,n+bnd_start) = src_array(i,j,k,n+mf_start);
159 template <
typename MF>
162 int f_start,
int bnd_start,
int num_comp,
const IntVect& ratio,
163 int max_order,
int max_width)
169 if (max_order==3 || max_order==1)
174 #pragma omp parallel if (Gpu::notInLaunchRegion())
178 const Box& fine_bx = mfi.validbox();
182 if (fine_bx[face] != fine_domain[face] || this->
geom.
isPeriodic(dir))
184 auto const& crse_array =
crse[face].const_array(mfi);
185 auto const& bdry_array = this->
bndry[face].array(mfi);
186 Box const&
b = this->
bndry[face][mfi].box();
187 const auto rr = ratio.
dim3();
194 crse_array,c_start,rr);
199 auto const& mask_array = this->
masks[face].const_array(mfi);
207 crse_array,c_start,rr,
208 mask_array, is_not_covered, max_width);
212 #if (AMREX_SPACEDIM >= 2)
218 crse_array,c_start,rr,
219 mask_array, is_not_covered, max_width);
223 #if (AMREX_SPACEDIM == 3)
229 crse_array,c_start,rr,
230 mask_array, is_not_covered, max_width);
240 else if (
fine.defined(mfi)) {
242 auto & bnd_fab = this->
bndry[face][mfi];
243 auto const& src_fab =
fine[mfi];
244 auto const& bnd_array = bnd_fab.array();
245 auto const& src_array = src_fab.const_array();
246 const Box&
b = bnd_fab.box() & src_fab.box();
249 bnd_array(ii,jj,kk,nn+bnd_start) = src_array(ii,jj,kk,nn+f_start);
257 amrex::Abort(
"InterpBndryDataT<MF>::setBndryValues supports only max_order=1 or 3");
261 template <
typename MF>
264 int num_comp,
const IntVect& ratio,
int max_order,
int max_width)
267 setBndryValues(
crse, c_start, foo, 0, bnd_start, num_comp, ratio, max_order, max_width);
270 template <
typename MF>
#define AMREX_ASSERT(EX)
Definition: AMReX_BLassert.H:38
#define AMREX_HOST_DEVICE_FOR_4D(...)
Definition: AMReX_GpuLaunch.nolint.H:51
#define AMREX_HOST_DEVICE_PARALLEL_FOR_4D(...)
Definition: AMReX_GpuLaunch.nolint.H:55
Array4< Real > fine
Definition: AMReX_InterpFaceRegister.cpp:90
Array4< Real const > crse
Definition: AMReX_InterpFaceRegister.cpp:92
A BndryData stores and manipulates boundary data information on each side of each box in a BoxArray.
Definition: AMReX_BndryData.H:41
Vector< MultiMask > masks
Boundary condition mask.
Definition: AMReX_BndryData.H:146
typename MF::value_type value_type
Definition: AMReX_BndryData.H:46
@ not_covered
Definition: AMReX_BndryData.H:44
Geometry geom
Domain used for mask definitions.
Definition: AMReX_BndryData.H:148
A BndryRegister organizes FabSets bounding each grid in a BoxArray. A FabSet is maintained for each b...
Definition: AMReX_BndryRegister.H:41
void setVal(value_type v)
Set all boundary FABs to given value.
Definition: AMReX_BndryRegister.H:210
const DistributionMapping & DistributionMap() const noexcept
Returns constant reference to associated DistributionMapping.
Definition: AMReX_BndryRegister.H:111
BoxArray grids
Definition: AMReX_BndryRegister.H:126
FabSetT< MF > bndry[2 *AMREX_SPACEDIM]
The data.
Definition: AMReX_BndryRegister.H:125
A collection of Boxes stored in an Array.
Definition: AMReX_BoxArray.H:550
Calculates the distribution of FABs to MPI processes.
Definition: AMReX_DistributionMapping.H:41
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
const Box & Domain() const noexcept
Returns our rectangular domain.
Definition: AMReX_Geometry.H:210
bool isPeriodic(int dir) const noexcept
Is the domain periodic in the specified direction?
Definition: AMReX_Geometry.H:331
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 dim3() const noexcept
Definition: AMReX_IntVect.H:163
An InterpBndryData object adds to a BndryData object the ability to manipulate and set the data store...
Definition: AMReX_InterpBndryData.H:40
void setPhysBndryValues(const MF &mf, int mf_start, int bnd_start, int num_comp)
Set bndry values at physical boundaries.
Definition: AMReX_InterpBndryData.H:128
static constexpr int IBD_max_order_DEF
Definition: AMReX_InterpBndryData.H:113
void updateBndryValues(BndryRegisterT< MF > &crse, int c_start, int bnd_start, int num_comp, const IntVect &ratio, int max_order=IBD_max_order_DEF, int max_width=2)
Update boundary values at coarse/fine boundaries.
Definition: AMReX_InterpBndryData.H:263
InterpBndryDataT() noexcept=default
default constructor
void setHomogValues()
Set boundary values to zero.
Definition: AMReX_InterpBndryData.H:272
void setBndryValues(BndryRegisterT< MF > const &crse, int c_start, const MF &fine, int f_start, int bnd_start, int num_comp, const IntVect &ratio, int max_order=IBD_max_order_DEF, int max_width=2)
Definition: AMReX_InterpBndryData.H:161
Definition: AMReX_MFIter.H:57
bool isValid() const noexcept
Is the iterator valid i.e. is it associated with a FAB?
Definition: AMReX_MFIter.H:141
An Iterator over the Orientation of Faces of a Box.
Definition: AMReX_Orientation.H:135
Encapsulation of the Orientation of the Faces of a Box.
Definition: AMReX_Orientation.H:29
AMREX_GPU_HOST_DEVICE int coordDir() const noexcept
Returns the coordinate direction.
Definition: AMReX_Orientation.H:83
bool notInLaunchRegion() noexcept
Definition: AMReX_GpuControl.H:87
static int fi(amrex::Real t, N_Vector y_data, N_Vector y_rhs, void *user_data)
Definition: AMReX_SundialsIntegrator.H:49
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void interpbndrydata_y_o3(int i, int j, int, int n, Array4< T > const &bdry, int nb, Array4< T const > const &crse, int nc, Dim3 const &r, Array4< int const > const &mask, int not_covered, int max_width) noexcept
Definition: AMReX_InterpBndryData_2D_K.H:75
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void interpbndrydata_x_o3(int i, int, int, int n, Array4< T > const &bdry, int nb, Array4< T const > const &crse, int nc, Dim3 const &r, Array4< int const > const &, int, int) noexcept
Definition: AMReX_InterpBndryData_1D_K.H:22
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void interpbndrydata_z_o3(int i, int j, int k, int n, Array4< T > const &bdry, int nb, Array4< T const > const &crse, int nc, Dim3 const &r, Array4< int const > const &mask, int not_covered, int) noexcept
Definition: AMReX_InterpBndryData_3D_K.H:90
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void interpbndrydata_o1(int i, int, int, int n, Array4< T > const &bdry, int nb, Array4< T const > const &crse, int nc, Dim3 const &r) noexcept
Definition: AMReX_InterpBndryData_1D_K.H:11
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition: AMReX.cpp:225
FabArray memory allocation information.
Definition: AMReX_FabArray.H:66
Definition: AMReX_MFIter.H:20
MFItInfo & SetDynamic(bool f) noexcept
Definition: AMReX_MFIter.H:34