Efficiently handling boundary and interior regions separately in AMReX #4446
-
Hello, I am currently working with AMReX and need to perform different operations on the boundary layers (ghost cells) and the main computational region. Right now, I am iterating over both the boundary and main regions together, then overwriting the interior data. This approach works, but I am wondering if there's a more efficient way to handle this where I can separate the operations for the boundary and interior regions more cleanly. Here's the code I’m currently using:
} Is there a way to iterate only over the boundary layers for the first operation and only the interior cells for the second operation, without having to perform redundant operations over the entire region? This would help me avoid issues where the interior data is being overwritten unnecessarily. Any suggestions or best practices would be greatly appreciated! Thanks in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There is variable shadowing in your code. It can be very confusing. So I think you should fix that. It also appears to me that you are assuming the code is always 2d. Even in that case, I would still access the data with That being said, I suggest you do something like
|
Beta Was this translation helpful? Give feedback.
There is variable shadowing in your code. It can be very confusing. So I think you should fix that. It also appears to me that you are assuming the code is always 2d. Even in that case, I would still access the data with
(i,j,k,n)
, not(i,j,n)
.That being said, I suggest you do something like