1#ifndef AMREX_MLMGBNDRY_H_
2#define AMREX_MLMGBNDRY_H_
3#include <AMReX_Config.H>
106template <
typename MF>
112template <
typename MF>
119 setLOBndryConds(lo, hi,
IntVect(ratio), a_loc, a_crse_fine_bc_type);
122template <
typename MF>
130 const Real* dx = this->geom.CellSize();
131 const Box& domain = this->geom.Domain();
143 const int i = fsi.index();
144 const Box& grd = ba[i];
148 for (
int icomp = 0; icomp < this->
nComp(); ++icomp) {
150 setBoxBC(bloc, bct, grd, domain, lo[icomp], hi[icomp], dx, ratio, a_loc,
153 is_periodic, a_crse_fine_bc_type);
154 for (
int idim = 0; idim < 2*AMREX_SPACEDIM; ++idim) {
155 bctag[idim][icomp] = bct[idim];
161template <
typename MF>
164 const Box& bx,
const Box& domain,
174 using T =
typename MF::value_type;
181 if (domain[face] == bx[face] && !is_periodic[dir])
184 bloc[face] =
static_cast<T
>
185 (face.
isLow() ? domain_bloc_lo[dir] : domain_bloc_hi[dir]);
186 const auto linop_bc = face.
isLow() ? lo[dir] : hi[dir];
194 amrex::Abort(
"MLMGBndry::setBoxBC: Unknown LinOpBCType");
200 bctag[face] =
static_cast<int>(a_crse_fine_bc_type);
201 bloc[face] =
static_cast<T
>(ratio[dir] > 0 ?
Real(0.5)*
static_cast<Real>(ratio[dir])*dx[dir]
202 : interior_bloc[dir]);
#define AMREX_ASSERT(EX)
Definition AMReX_BLassert.H:38
Boundary data specialization that interpolates coarse data into fine ghost cells.
#define AMREX_LO_NEUMANN
Definition AMReX_LO_BCTYPES.H:6
#define AMREX_LO_DIRICHLET
Definition AMReX_LO_BCTYPES.H:5
#define AMREX_LO_REFLECT_ODD
Definition AMReX_LO_BCTYPES.H:7
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
Array< value_type, 2 *3 > RealTuple
Some useful typedefs.
Definition AMReX_BndryData.H:98
Reference-counted collection of Boxes.
Definition AMReX_BoxArray.H:676
Calculates the distribution of FABs to MPI processes.
Definition AMReX_DistributionMapping.H:51
Convenience iterator that reuses MFIter semantics for FabSet traversal.
Definition AMReX_FabSet.H:281
Rectangular problem domain geometry.
Definition AMReX_Geometry.H:75
An InterpBndryData object adds to a BndryData object the ability to manipulate and set the data store...
Definition AMReX_InterpBndryData.H:45
bool isValid() const noexcept
Is the iterator valid i.e. is it associated with a FAB?
Definition AMReX_MFIter.H:172
Boundary helper for MLMG that manages coarse/fine and physical BC metadata.
Definition AMReX_MLMGBndry.H:20
MLMGBndryT< MF > & operator=(const MLMGBndryT< MF > &rhs)=delete
typename BndryDataT< MF >::RealTuple RealTuple
Definition AMReX_MLMGBndry.H:24
MLMGBndryT(const MLMGBndryT< MF > &rhs)=delete
void setLOBndryConds(const Vector< Array< LinOpBCType, 3 > > &lo, const Vector< Array< LinOpBCType, 3 > > &hi, int ratio, const RealVect &a_loc, LinOpBCType a_crse_fine_bc_type=LinOpBCType::Dirichlet)
Populate BC tags at coarse/fine and physical boundaries for an integer refinement ratio.
Definition AMReX_MLMGBndry.H:114
static void setBoxBC(RealTuple &bloc, BCTuple &bctag, const Box &bx, const Box &domain, const Array< LinOpBCType, 3 > &lo, const Array< LinOpBCType, 3 > &hi, const Real *dx, IntVect const &ratio, const RealVect &interior_bloc, const Array< Real, 3 > &domain_bloc_lo, const Array< Real, 3 > &domain_bloc_hi, const GpuArray< int, 3 > &is_periodic, LinOpBCType a_crse_fine_bc_type)
Helper that sets up BC tuples for a single box.
Definition AMReX_MLMGBndry.H:163
MLMGBndryT(const BoxArray &_grids, const DistributionMapping &_dmap, int _ncomp, const Geometry &_geom)
Allocate BC metadata for _grids/_geom.
Definition AMReX_MLMGBndry.H:107
MLMGBndryT(MLMGBndryT< MF > &&rhs)=delete
Array< BoundCond, 2 *3 > BCTuple
Definition AMReX_MLMGBndry.H:23
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__ bool isLow() const noexcept
Returns true if Orientation is low.
Definition AMReX_Orientation.H:89
__host__ __device__ int coordDir() const noexcept
Returns the coordinate direction.
Definition AMReX_Orientation.H:83
@ low
Definition AMReX_Orientation.H:34
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition AMReX_Vector.H:29
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:79
std::array< T, N > Array
Definition AMReX_Array.H:31
Definition AMReX_Amr.cpp:50
int nComp(FabArrayBase const &fa)
Definition AMReX_FabArrayBase.cpp:2852
LinOpBCType
Definition AMReX_LO_BCTYPES.H:27
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:38
void Abort(const std::string &msg)
Print a fatal-error message to stderr and abort execution.
Definition AMReX.cpp:241
Fixed-size array that can be used on GPU.
Definition AMReX_Array.H:52