diff options
author | 2021-10-25 09:31:34 -0700 | |
---|---|---|
committer | 2021-10-25 09:31:34 -0700 | |
commit | 8e8a77a1a468c95f14f4a18b288fa42ed446003c (patch) | |
tree | 55068eb42eb99b7892f603dead5a9ddb5bda0e27 /Source/EmbeddedBoundary | |
parent | 90c75145f9fc97898ebc492b07752342cf7e2f3f (diff) | |
download | WarpX-8e8a77a1a468c95f14f4a18b288fa42ed446003c.tar.gz WarpX-8e8a77a1a468c95f14f4a18b288fa42ed446003c.tar.zst WarpX-8e8a77a1a468c95f14f4a18b288fa42ed446003c.zip |
Increase EB coarsening level for linear solvers (#2457)
* Increase EB coarsening level for linear solvers
* Apply suggestions from code review
Add comments.
Diffstat (limited to 'Source/EmbeddedBoundary')
-rw-r--r-- | Source/EmbeddedBoundary/WarpXInitEB.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/EmbeddedBoundary/WarpXInitEB.cpp b/Source/EmbeddedBoundary/WarpXInitEB.cpp index 2ae8dfee6..1ef07aba1 100644 --- a/Source/EmbeddedBoundary/WarpXInitEB.cpp +++ b/Source/EmbeddedBoundary/WarpXInitEB.cpp @@ -93,14 +93,21 @@ WarpX::InitEB () auto eb_if_parser = makeParser(impf, {"x", "y", "z"}); ParserIF pif(eb_if_parser.compile<3>()); auto gshop = amrex::EB2::makeShop(pif, eb_if_parser); - amrex::EB2::Build(gshop, Geom(maxLevel()), maxLevel(), maxLevel()); + // The last argument of amrex::EB2::Build is the maximum coarsening level + // to which amrex should try to coarsen the EB. It will stop after coarsening + // as much as it can, if it cannot coarsen to that level. Here we use a big + // number (e.g., maxLevel()+20) for multigrid solvers. Because the coarse + // level has only 1/8 of the cells on the fine level, the memory usage should + // not be an issue. + amrex::EB2::Build(gshop, Geom(maxLevel()), maxLevel(), maxLevel()+20); } else { amrex::ParmParse pp_eb2("eb2"); if (!pp_eb2.contains("geom_type")) { std::string geom_type = "all_regular"; pp_eb2.add("geom_type", geom_type); // use all_regular by default } - amrex::EB2::Build(Geom(maxLevel()), maxLevel(), maxLevel()); + // See the comment above on amrex::EB2::Build for the hard-wired number 20. + amrex::EB2::Build(Geom(maxLevel()), maxLevel(), maxLevel()+20); } #endif |