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

Fix Assertion in MLEBNodeFDLaplacian #3594

Merged
merged 1 commit into from
Oct 16, 2023
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
15 changes: 1 addition & 14 deletions Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,20 +284,7 @@ MLEBNodeFDLaplacian::prepareForSolve ()
});
}

if (m_is_bottom_singular)
{
int amrlev = 0;
int mglev = 0;
auto const& dotmasks = m_coarse_dot_mask.arrays();
auto const& dirmasks = m_dirichlet_mask[amrlev][mglev]->const_arrays();
amrex::ParallelFor(m_coarse_dot_mask,
[=] AMREX_GPU_DEVICE (int box_no, int i, int j, int k) noexcept
{
if (dirmasks[box_no](i,j,k)) {
dotmasks[box_no](i,j,k) = Real(0.);
}
});
}
AMREX_ASSERT(!isBottomSingular());

Gpu::streamSynchronize();

Expand Down
2 changes: 1 addition & 1 deletion Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_sten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ MLNodeLaplacian::buildStencil ()
});
}

if (m_is_bottom_singular)
if (isBottomSingular())
{
int amrlev = 0;
int mglev = 0;
Expand Down
4 changes: 3 additions & 1 deletion Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.H
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ protected:
CoarseningStrategy m_coarsening_strategy = CoarseningStrategy::Sigma;
#endif

bool m_is_bottom_singular = false;
bool m_masks_built = false;
bool m_overset_dirichlet_mask = false;
#ifdef AMREX_USE_GPU
Expand All @@ -165,6 +164,9 @@ protected:
int m_smooth_num_sweeps = 2;
#endif
mutable bool m_in_solution_mode = true;

private:
bool m_is_bottom_singular = false;
};

}
Expand Down