2#ifndef AMREX_INTERPBNDRYDATA_H_
3#define AMREX_INTERPBNDRYDATA_H_
4#include <AMReX_Config.H>
8#include <AMReX_InterpBndryData_K.H>
105 int bnd_start,
int num_comp, const
IntVect& ratio,
130template <typename MF>
139template <
typename MF>
148#pragma omp parallel if (Gpu::notInLaunchRegion())
152 const Box& bx = mfi.validbox();
158 auto & bnd_fab = this->
bndry[face][mfi];
159 auto const& src_fab = mf[mfi];
160 auto const& bnd_array = bnd_fab.array();
161 auto const& src_array = src_fab.const_array();
162 const Box& b = src_fab.box() & bnd_fab.box();
165 bnd_array(i,j,k,n+bnd_start) = src_array(i,j,k,n+mf_start);
172template <
typename MF>
175 int f_start,
int bnd_start,
int num_comp,
const IntVect& ratio,
176 int max_order,
int max_width)
186 if (max_order == 3) {
188 "InterpBndryDataT<MF>::setBndryValues: max_order=3 requires refinement ratio <= 4");
191 if (max_order==3 || max_order==1)
196#pragma omp parallel if (Gpu::notInLaunchRegion())
200 const Box& fine_bx = mfi.validbox();
204 if (fine_bx[face] != fine_domain[face] || this->
geom.
isPeriodic(dir))
206 auto const& crse_array =
crse[face].const_array(mfi);
207 auto const& bdry_array = this->
bndry[face].array(mfi);
208 Box const& b = this->
bndry[face][mfi].box();
209 const auto rr = ratio.
dim3();
215 interpbndrydata_o1(it,jt,kt,n,bdry_array,bnd_start,
216 crse_array,c_start,rr);
221 auto const& mask_array = this->
masks[face].const_array(mfi);
228 interpbndrydata_x_o3(it,jt,kt,n,bdry_array,bnd_start,
229 crse_array,c_start,rr,
230 mask_array, is_not_covered, max_width);
234#if (AMREX_SPACEDIM >= 2)
239 interpbndrydata_y_o3(it,jt,kt,n,bdry_array,bnd_start,
240 crse_array,c_start,rr,
241 mask_array, is_not_covered, max_width);
245#if (AMREX_SPACEDIM == 3)
250 interpbndrydata_z_o3(it,jt,kt,n,bdry_array,bnd_start,
251 crse_array,c_start,rr,
252 mask_array, is_not_covered, max_width);
262 else if (
fine.defined(mfi)) {
264 auto & bnd_fab = this->
bndry[face][mfi];
265 auto const& src_fab =
fine[mfi];
266 auto const& bnd_array = bnd_fab.array();
267 auto const& src_array = src_fab.const_array();
268 const Box& b = bnd_fab.box() & src_fab.box();
271 bnd_array(ii,jj,kk,nn+bnd_start) = src_array(ii,jj,kk,nn+f_start);
279 amrex::Abort(
"InterpBndryDataT<MF>::setBndryValues supports only max_order=1 or 3");
283template <
typename MF>
286 int num_comp,
const IntVect& ratio,
int max_order,
int max_width)
289 setBndryValues(
crse, c_start, foo, 0, bnd_start, num_comp, ratio, max_order, max_width);
292template <
typename MF>
Boundary condition descriptors used throughout AMReX.
#define AMREX_ALWAYS_ASSERT_WITH_MESSAGE(EX, MSG)
Definition AMReX_BLassert.H:49
#define AMREX_ASSERT(EX)
Definition AMReX_BLassert.H:38
Boundary data container that owns masks, boundary values, and metadata.
#define AMREX_HOST_DEVICE_FOR_4D(...)
Definition AMReX_GpuLaunchMacrosC.nolint.H:107
#define AMREX_HOST_DEVICE_PARALLEL_FOR_4D(...)
Definition AMReX_GpuLaunchMacrosC.nolint.H:111
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:46
Vector< MultiMask > masks
Boundary condition mask.
Definition AMReX_BndryData.H:171
@ not_covered
Location is inside the domain but does not coincide with any valid grid points.
Definition AMReX_BndryData.H:50
Geometry geom
Domain used for mask definitions.
Definition AMReX_BndryData.H:173
A BndryRegister organizes FabSets bounding each grid in a BoxArray. A FabSet is maintained for each b...
Definition AMReX_BndryRegister.H:46
BoxArray grids
Definition AMReX_BndryRegister.H:173
const DistributionMapping & DistributionMap() const noexcept
Returns the DistributionMapping describing which MPI ranks own each boundary FAB.
Definition AMReX_BndryRegister.H:143
FabSetT< MF > bndry[2 *3]
The data.
Definition AMReX_BndryRegister.H:172
Reference-counted collection of Boxes.
Definition AMReX_BoxArray.H:676
Calculates the distribution of FABs to MPI processes.
Definition AMReX_DistributionMapping.H:51
Rectangular problem domain geometry.
Definition AMReX_Geometry.H:75
const Box & Domain() const noexcept
Returns our rectangular domain.
Definition AMReX_Geometry.H:216
bool isPeriodic(int dir) const noexcept
Is the domain periodic in the specified direction?
Definition AMReX_Geometry.H:337
__host__ __device__ constexpr Dim3 dim3() const noexcept
Definition AMReX_IntVect.H:262
__host__ __device__ constexpr bool allLE(const IntVectND< dim > &rhs) const noexcept
Returns true if this is less than or equal to argument for all components. NOTE: This is NOT a strict...
Definition AMReX_IntVect.H:492
An InterpBndryData object adds to a BndryData object the ability to manipulate and set the data store...
Definition AMReX_InterpBndryData.H:45
void setPhysBndryValues(const MF &mf, int mf_start, int bnd_start, int num_comp)
Set bndry values at physical boundaries.
Definition AMReX_InterpBndryData.H:141
static constexpr int IBD_max_order_DEF
Definition AMReX_InterpBndryData.H:126
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:285
InterpBndryDataT() noexcept=default
default constructor
void setHomogValues()
Set boundary values to zero.
Definition AMReX_InterpBndryData.H:294
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)
Sset bndry values at coarse/fine and physical boundaries.
Definition AMReX_InterpBndryData.H:174
typename MF::value_type value_type
Definition AMReX_InterpBndryData.H:48
Iterator for looping ever tiles and boxes of amrex::FabArray based containers.
Definition AMReX_MFIter.H:88
bool isValid() const noexcept
Is the iterator valid i.e. is it associated with a FAB?
Definition AMReX_MFIter.H:172
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
__host__ __device__ int coordDir() const noexcept
Returns the coordinate direction.
Definition AMReX_Orientation.H:83
bool notInLaunchRegion() noexcept
Definition AMReX_GpuControl.H:89
Definition AMReX_Amr.cpp:50
void Abort(const std::string &msg)
Print a fatal-error message to stderr and abort execution.
Definition AMReX.cpp:241
void setVal(MF &dst, typename MF::value_type val)
dst = val
Definition AMReX_FabArrayUtility.H:1861
FabArray memory allocation information.
Definition AMReX_FabArray.H:68
Definition AMReX_MFIter.H:20
MFItInfo & SetDynamic(bool f) noexcept
Definition AMReX_MFIter.H:43