Skip to content

Commit

Permalink
cut box to plasma radius in init (#988)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSinn authored Jun 27, 2023
1 parent bf79a25 commit 6ece70d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/particles/plasma/PlasmaParticleContainerInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,21 @@ InitParticles (const amrex::IntVect& a_num_particles_per_cell,

for(amrex::MFIter mfi = MakeMFIter(lev, DfltMfi); mfi.isValid(); ++mfi)
{
const amrex::Box& tile_box = mfi.tilebox(box_nodal, box_grow);
amrex::Box tile_box = mfi.tilebox(box_nodal, box_grow);

if (a_radius != std::numeric_limits<amrex::Real>::infinity()) {
amrex::IntVect lo_limit {
static_cast<int>(std::round((-a_radius - plo[0])/dx[0] - 2)),
static_cast<int>(std::round((-a_radius - plo[1])/dx[1] - 2)),
tile_box.smallEnd(2)
};
amrex::IntVect hi_limit {
static_cast<int>(std::round(( a_radius - plo[0])/dx[0] + 2)),
static_cast<int>(std::round(( a_radius - plo[1])/dx[1] + 2)),
tile_box.bigEnd(2)
};
tile_box &= amrex::Box(lo_limit, hi_limit, box_nodal);
}

const auto lo = amrex::lbound(tile_box);
const auto hi = amrex::ubound(tile_box);
Expand Down

0 comments on commit 6ece70d

Please sign in to comment.