Skip to content

Commit

Permalink
Add BCRec::set for convenience (AMReX-Codes#2993)
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Oct 18, 2022
1 parent 56b6402 commit 9502b99
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Src/Base/AMReX_BCRec.H
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ public:
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void setHi (int dir, int bc_val) noexcept { bc[AMREX_SPACEDIM+dir] = bc_val; }
/**
* \brief Explicitly set bndry value for given face.
*/
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void set (Orientation face, int bc_val) noexcept {
if (face.isLow()) {
setLo(face.coordDir(), bc_val);
} else {
setHi(face.coordDir(), bc_val);
}
}
/**
* \brief Return bndry values (used in calls to FORTRAN).
*/
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Expand Down

0 comments on commit 9502b99

Please sign in to comment.