Skip to content
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

New feature in EB: Add regular coarse levels #3414

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

WeiqunZhang
Copy link
Member

@WeiqunZhang WeiqunZhang commented Jul 9, 2023

Summary

This feature could be useful when the EB is so thin that it is only resolved at the finest level and the usual way of generate coarse levels fails with multi-cut or multi-value cells. When the EB is fully refined to the finest level and there is no subcycling, no EB information is really needed at coarse levels. Note that tagging cut cells for refinement no longer works if that level has all regular EB. amrex::TagCutCells has been updated to work with the new feature.

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

Copy link
Member

@drummerdoc drummerdoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this means that we need to implement some other approach to keep the fine grid on the EB or we'll lose it on the first regrid. Is there somewhere the capability to tag IntVects on the coarse level where there are cut cells on the fine?

@WeiqunZhang
Copy link
Member Author

Are you using amrex::TagCutCells? We can probably make it work for this case.

@drummerdoc
Copy link
Member

Are you using amrex::TagCutCells? We can probably make it work for this case.

Yeah, using that.

@WeiqunZhang
Copy link
Member Author

amrex::TagCutCell has been updated. I tested with EB_CNS. Regrid appears to work.

diff --git a/Tests/EB_CNS/Source/CNS_init_eb2.cpp b/Tests/EB_CNS/Source/CNS_init_eb2.cpp
index c64663a8bb..a729aebedf 100644
--- a/Tests/EB_CNS/Source/CNS_init_eb2.cpp
+++ b/Tests/EB_CNS/Source/CNS_init_eb2.cpp
@@ -69,6 +69,8 @@ initialize_EB2 (const Geometry& geom, int /*required_coarsening_level*/,
     else
 #endif
     {
-        EB2::Build(geom, max_coarsening_level, max_coarsening_level, 4);
+//        EB2::Build(geom, max_coarsening_level, max_coarsening_level, 4);
+        EB2::Build(geom, 0, 0, 4);
+        EB2::addRegularCoarseLevels(max_coarsening_level);
     }
 }

Copy link
Member

@drummerdoc drummerdoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Thanks Weiqun. This looks great. Can't wait to try it out on a thin body problem!

@WeiqunZhang
Copy link
Member Author

Hopefully, the fully covered cells will not cause any issues for your code.

@drummerdoc
Copy link
Member

Hopefully, the fully covered cells will not cause any issues for your code.

What's the concern?

@WeiqunZhang
Copy link
Member Author

Like averageDown triggers floating point exceptions.

This feature could be useful when the EB is so thin that it is only resolved
at the finest level and the usual way of generate coarse levels fails with
multi-cut or multi-value cells. When the EB is fully refined to the finest
level and there is no subcycling, no EB information is really needed at
coarse levels.

amrex::TagCutCells has been updated to work with the new feature.
@WeiqunZhang WeiqunZhang merged commit 6dfdd48 into AMReX-Codes:development Jul 12, 2023
66 checks passed
@WeiqunZhang WeiqunZhang deleted the eb_coarse_regular branch July 12, 2023 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants