MCPcopy Create free account
hub / github.com/BLAST-WarpX/warpx / BuildBufferMasksInBox

Method BuildBufferMasksInBox

Source/WarpX.cpp:3511–3532  ·  view source on GitHub ↗

* \brief Build buffer mask within given FArrayBox * * \param tbx Current FArrayBox * \param buffer_mask Buffer mask to be set * \param guard_mask Guard mask used to set buffer_mask * \param ng Number of guard cells */

Source from the content-addressed store, hash-verified

3509 * \param ng Number of guard cells
3510 */
3511void
3512WarpX::BuildBufferMasksInBox ( const amrex::Box tbx, amrex::IArrayBox &buffer_mask,
3513 const amrex::IArrayBox &guard_mask, const int ng )
3514{
3515 auto const& msk = buffer_mask.array();
3516 auto const& gmsk = guard_mask.const_array();
3517 const amrex::Dim3 ng3 = amrex::IntVect(ng).dim3();
3518 amrex::ParallelFor(tbx, [=] AMREX_GPU_DEVICE (int i, int j, int k)
3519 {
3520 for (int kk = k-ng3.z; kk <= k+ng3.z; ++kk) {
3521 for (int jj = j-ng3.y; jj <= j+ng3.y; ++jj) {
3522 for (int ii = i-ng3.x; ii <= i+ng3.x; ++ii) {
3523 if ( gmsk(ii,jj,kk) == 0 ) {
3524 msk(i,j,k) = 0;
3525 return;
3526 }
3527 }
3528 }
3529 }
3530 msk(i,j,k) = 1;
3531 });
3532}
3533
3534const iMultiFab*
3535WarpX::CurrentBufferMasks (int lev)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected