aboutsummaryrefslogtreecommitdiff
path: root/Source/EmbeddedBoundary/WarpXInitEB.cpp
diff options
context:
space:
mode:
authorGravatar Andrew Myers <atmyers@lbl.gov> 2022-01-13 15:36:41 -0800
committerGravatar GitHub <noreply@github.com> 2022-01-13 15:36:41 -0800
commite636cdad3c2a6bd7356d4c15e223f74427434d8f (patch)
tree217cf496274c7523a7a221b74490c084c3e1464c /Source/EmbeddedBoundary/WarpXInitEB.cpp
parenteffc3b58c02622f225aea5c8df1b29e30d59b0f9 (diff)
downloadWarpX-e636cdad3c2a6bd7356d4c15e223f74427434d8f.tar.gz
WarpX-e636cdad3c2a6bd7356d4c15e223f74427434d8f.tar.zst
WarpX-e636cdad3c2a6bd7356d4c15e223f74427434d8f.zip
Use signed distance instead of imp. func when computing distance to EB. (#2682)
Diffstat (limited to 'Source/EmbeddedBoundary/WarpXInitEB.cpp')
-rw-r--r--Source/EmbeddedBoundary/WarpXInitEB.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/Source/EmbeddedBoundary/WarpXInitEB.cpp b/Source/EmbeddedBoundary/WarpXInitEB.cpp
index a51ecd148..aa9d41f53 100644
--- a/Source/EmbeddedBoundary/WarpXInitEB.cpp
+++ b/Source/EmbeddedBoundary/WarpXInitEB.cpp
@@ -398,17 +398,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
}