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

Use signed distance instead of imp. func when computing distance to EB. #2682

Merged
merged 1 commit into from
Jan 13, 2022
Merged
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
17 changes: 5 additions & 12 deletions Source/EmbeddedBoundary/WarpXInitEB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,17 +412,10 @@ WarpX::ComputeDistanceToEB () {
#ifdef AMREX_USE_EB
BL_PROFILE("ComputeDistanceToEB");

amrex::ParmParse pp_warpx("warpx");
std::string impf;
pp_warpx.query("eb_implicit_function", impf);
if (! impf.empty()) {
auto eb_if_parser = makeParser(impf, {"x", "y", "z"});
ParserIF pif(eb_if_parser.compile<3>());
auto gshop = amrex::EB2::makeShop(pif);
amrex::FillImpFunc(*m_distance_to_eb[maxLevel()], gshop, Geom(maxLevel()));
m_distance_to_eb[maxLevel()]->negate(m_distance_to_eb[maxLevel()]->nGrow()); // signed distance f = - imp. f.
} else {
m_distance_to_eb[maxLevel()]->setVal(100.0); // some positive value
}
const amrex::EB2::IndexSpace& eb_is = amrex::EB2::IndexSpace::top();
const amrex::EB2::Level& eb_level = eb_is.getLevel(Geom(maxLevel()));
auto const eb_fact = fieldEBFactory(maxLevel());

amrex::FillSignedDistance(*m_distance_to_eb[maxLevel()], eb_level, eb_fact, 1);
#endif
}