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

MLMG: Minimum domain width #4129

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ MLABecLaplacianT<MF>::supportNSolve () const
bool support = false;
if (this->m_overset_mask[0][0]) {
if (this->m_geom[0].back().Domain().coarsenable(MLLinOp::mg_coarsen_ratio,
MLLinOp::mg_domain_min_width)
this->mg_domain_min_width)
&& this->m_grids[0].back().coarsenable(MLLinOp::mg_coarsen_ratio, MLLinOp::mg_box_min_width))
{
support = true;
Expand Down
15 changes: 10 additions & 5 deletions Src/LinearSolvers/MLMG/AMReX_MLLinOp.H
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,7 @@ protected:

static constexpr int mg_coarsen_ratio = 2;
static constexpr int mg_box_min_width = 2;
#ifdef AMREX_USE_EB
static constexpr int mg_domain_min_width = 4;
#else
static constexpr int mg_domain_min_width = 2;
#endif
int mg_domain_min_width = 2;

LPInfo info;

Expand Down Expand Up @@ -803,6 +799,15 @@ MLLinOpT<MF>::defineGrids (const Vector<Geometry>& a_geom,
{
BL_PROFILE("MLLinOp::defineGrids()");

#ifdef AMREX_USE_EB
if ( ! a_factory.empty() ) {
auto const* ebf = dynamic_cast<EBFArrayBoxFactory const*>(a_factory[0]);
if (ebf && !(ebf->isAllRegular())) { // Has non-trivial EB
mg_domain_min_width = 4;
}
}
#endif

m_num_amr_levels = 0;
for (int amrlev = 0; amrlev < a_geom.size(); amrlev++) {
if (!a_grids[amrlev].empty()) {
Expand Down
Loading