AMReX-Fluids/IAMR

Question about mask techniques in the IAMR codes

ruohai0925 opened this issue · 1 comments

Hello all,

When I learned the mask codes, I realized it is a kind of technique to differentiate different boundary conditions (fine-fine, coarse-fine, physical). According to different mask values, we know the different boundary conditions. Then, from my guessing, we can re-fill the ghost cell values according to the different boundary condition. The advantage is we can use the unified FORTRAN subroutines to do the operations (e.g. compRHS & updatevel ) without considering the differences between different boundary conditions. I mean, the FORTRAN subroutines in the AMReX and IAMR do not include the information about CPU and boundary conditions. It seems like an "encapsulation".

I am not sure if I understand it right or not. If it is like this, can someone direct some codes fractions (operations) for me to learn the mask technique better?

Here is an example to illustrate more about the above understanding. In the lid_driven case, u top=1, originally the ghost cell values for u lie on the boundary (see this question: AMReX-Codes/amrex#258 ), I guess it uses masks to signal it, then change the ghost cell values in the C++ subroutines to cell centered, so that in the FORTRAN subroutine, we can use the unified form to calculate the RHS (standard finite difference)