-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MLMG failed #2088
Comments
Hi @asalmgren, thanks for the detailed information. I didn't pay attention to blocking_factor before. Yes, I restarted the run after using the coarse grid to reach a steady state first. I have two quick questions:
|
No -- n_error_buf doesn't have anything to do with the eventual specific size/shape of the grid, it just says how much you "buffer" the features you care about before you start the tagging procedure. One way to think about that is if you know a feature is moving at one grid cell per time step but you don't want to refine every timestep, you would set n_error_buf to be roughly regrid_int, so, for example, if you set n_error_buf = 5 then you could move 5 timesteps before the feature reached the coarse/fine boundary because you had created the grids with that much extra space to start with. This is overly simplistic, but hopefully gives the idea. |
If you start with a relatively small grid (e.g. 32x64) and require the fine grids to be "relatively large", it will typically fill a lot of the domain. I also noticed that when the problem starts there aren't any well-defined regions to define. Can you share a picture of when the gridding is doing something you don't want it to do? |
Thanks for the clarification, but then I still don’t understand why level 1 isn't 'ideal.' Could you point out where the settings show that the level 1 grid is not ideal? |
There are tradeoffs between grid size and multigrid performance. Multigrid -- to work well-- needs to be able to coarsen. Imagine at level 1 if you have a 4x4x4 grid and a 64x64x64 grids. The level will only be able to coarsen once, which means the "bottom solver" has to deal with a 2x2x2 grid (fine) and a 32x32x32 grid (expensive). So ideally we want blocking factor at least 8 ... but when you try to decompose the level into boxes that are coarsenable by 8 and cover all your tagged points, it's a hard problem. |
My suggestion is to cut n_error_buf down to 2 -- that's our usual default -- and set max_grid_size = 8. How does that work? |
Thanks for the details and suggestion. I've tested the following settings:
Result: MLMG: Failed to converge after 100 iterations. Increase blocking_factor:
Result: Entire domain is refined. Reduce grid_eff:
Result: Entire domain is refined. |
I think the code is doing exactly what you're telling it to do subject to the constraints. Can you modify your tagging criteria to make it only a very small region refined and verify that you can get one grid not covering the whole region? Keep in mind btw that blocking_factor = 8 means not just that the grids have to be 8 wide but more specifically that the left edge will have to be at i = 0, 8, 16, 32, 40, 48, or 56. |
One thing we can think about if the smaller grids are important -- if we implement an algorithm without the subcyling in time between levels, then the Poisson solves would be over the whole grid hierarchy which means we don't need the level 1 grids to be so coarsenable. But that would take a little time to make those changes. |
Thanks for the information, @asalmgren! I have another question (not sure whether this is related to the dynamic regridding issue I met). I found that the smaller grid is hard to be separated horizontally. For some simple tests of static mesh refinement, I tried to refine half of the domain. Separating the grid vertically works well, but separating the grid horizontally always fail. Below is how I cut the grid. The domain:
This works well:
This fails (output: SIGILL Invalid, privileged, or ill-formed instruction):
This is the output of the last step before failing. Some values appear as large as e+21 or e+22:
Below are some other inputs information that may affect:
|
@wang1202 -- Sorry for the delay! I believe this issue is now fixed in PR 2095 -- can you give it a try? |
Hi @asalmgren, I think it works now. Thank you for the assistance! Allowing the horizontal refinement seems important to me. Although I'm still testing the options to have a stabler run, now I can see the box separated horizontally as shown here. |
Hello,
Thank you for resolving the previous grid refinement issue. Now I'm testing the case DevTests/FlowInABox, and I found that the refined grid is very unstable. I can set amr.grid_eff = 0.1 or amr.n_error_buf = 5 to have the simulation run for hundreds of steps, but this causes the entire domain to be refined, which is not desired. Do you have any suggestions? Below is the last 5 iterations information when setting erf.mg_v = 4:
And below is the input I adjusted:
The text was updated successfully, but these errors were encountered: