AMReX-Codes / amrex

AMReX: Software Framework for Block Structured AMR
https://amrex-codes.github.io/amrex
Other
520 stars 339 forks source link

Very small domains with periodic boundaries #665

Open eschnett opened 4 years ago

eschnett commented 4 years ago

I set up a vertex-centred domain that is 1 cell wide (expecting 2 points) in the y and z directions, with a larger size (64 cells) in the x direction. I also used periodic boundaries. I found nans after synchronizing, which applies boundary conditions. There was no mesh refinement. I used 2 ghost zones.

Does AMReX have the special logic necessary to handle very small domains that might be smaller than the number of ghost zones?

The problem went away when I increased the domain size to be 5 cells instead of a single cell.

WeiqunZhang commented 4 years ago

We don't have special logic for that. But I am surprised you need 5 cells. I thought 2 cells might be enough.

eschnett commented 4 years ago

I tried 5 cells first for "historic reasons" (the Einstein Toolkit parameter files specify grid sizes including ghost zones). It'll probably work with 2 cells as well.

WeiqunZhang commented 4 years ago

It's not immediately clear to me how much work is needed to make AMReX's boundary functions work with a 2D slab in 3D space. Let's keep this issue open. I will give it a try at some point.

eschnett commented 4 years ago

I forgot that this was an issue and had to debug it again. Can you make this emit an error if the domain is too small for periodic boundaries?

asalmgren commented 4 years ago

How small is your domain? Is the issue that of trying to fill multiple layers of ghost cells ends up extending past the domain itself?

E.g. if the domain is 4 wide but you want to fill 5 ghost cells?

or is there another issue?

On Tue, Jun 23, 2020 at 12:59 PM Erik Schnetter notifications@github.com wrote:

I forgot that this was an issue and had to debug it again. Can you make this emit an error if the domain is too small for periodic boundaries?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AMReX-Codes/amrex/issues/665#issuecomment-648386617, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRE6YS7QUV6FJRTUR7OFLDRYECTXANCNFSM4KIMNU5A .

-- Ann Almgren Senior Scientist; CCSE Group Lead

eschnett commented 4 years ago

My domain has 1 interior cell and 3 ghost cells. It's a 2d test of a 3d code. So I expect the altogether 6 cells to be filled by copies of the 1 interior cell.

I assume AMReX tries to do this in a single operations, but since the source is too small, there need to be 6 independent copies.