Skip to content
Discussion options

You must be logged in to vote

@SahajSJain -- because you defined both MultiFabs using the same BoxArrays and DistributionMaps, you know that they have the same boxes and that for each MultiFab, box "i" is on the same MPI rank. The way you know you are accessing the same box at the same time is these lines:

const amrex::Array4amrex::Real& phiOld = phi_old.array(mfi);
const amrex::Array4amrex::Real& phiNew = phi_new.array(mfi);

which tell you that you are accessing the data in phiOld and phiNew that is stored in box "i" where we can know "i" = mfi.index() -- writing phi_old.array(mfi) is the same as saying I want a pointer to the data of phi_old that is stored in box mfi.index()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SahajSJain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants