diff --git a/ExampleCodes/EB/STLtest/inputs b/ExampleCodes/EB/STLtest/inputs index c0bb4c3e..648e0159 100644 --- a/ExampleCodes/EB/STLtest/inputs +++ b/ExampleCodes/EB/STLtest/inputs @@ -1,6 +1,13 @@ -prob_lo= 0 0 0 -prob_hi= 220 35 60 -ncells = 128 32 64 -stl_file=airfoil.stl -max_grid_size=8 -outside_point=250.0 250.0 250.0 +eb2.geom_type = stl +eb2.stl_file = airfoil.stl + +eb2.stl_scale = 1 # default is 1 +eb2.stl_center = 0 0 0 # default is (0,0,0) +eb2.stl_reverse_normal = 0 # default is 0. + +prob_lo = 0 0 0 +prob_hi = 220 35 60 +ncells = 128 32 64 + +max_grid_size = 8 + diff --git a/ExampleCodes/EB/STLtest/main.cpp b/ExampleCodes/EB/STLtest/main.cpp index 7344e7dd..3cbdaab6 100644 --- a/ExampleCodes/EB/STLtest/main.cpp +++ b/ExampleCodes/EB/STLtest/main.cpp @@ -14,25 +14,19 @@ using namespace amrex; int main (int argc, char* argv[]) { amrex::Initialize(argc,argv); - { int nghost = 1; int max_grid_size=64; - MultiFab marker,apx,apy,apz; - std::string stl_fname; Vector plo; Vector phi; - Vector ncells; - Vector pointoutside; + Vector ncells; Real dx[3]; - ParmParse pp; + amrex::ParmParse pp; pp.getarr("prob_lo",plo); pp.getarr("prob_hi",phi); pp.getarr("ncells",ncells); - pp.get("stl_file",stl_fname); - pp.getarr("outside_point",pointoutside); pp.query("max_grid_size",max_grid_size); RealBox real_box({AMREX_D_DECL(plo[0], plo[1], plo[2])}, @@ -53,26 +47,19 @@ int main (int argc, char* argv[]) Geometry geom(domain,real_box,CoordSys::cartesian,is_periodic); DistributionMapping dm(ba); - BoxArray nodal_ba = amrex::convert(ba, IntVect::TheNodeVector()); - - marker.define(nodal_ba, dm, 1, nghost); - - STLtools stlobj; - - stlobj.read_ascii_stl_file(stl_fname); - Real plo_arr[]={plo[0],plo[1],plo[2]}; - Real po_arr[]={pointoutside[0],pointoutside[1],pointoutside[2]}; + int required_coarsening_level = 0; // typically the same as the max AMR level index + int max_coarsening_level = 0; // typically a huge number so MG coarsens as much as possible + // build a simple geometry using the "eb2." parameters in the inputs file + EB2::Build(geom, required_coarsening_level, max_coarsening_level); - stlobj.stl_to_markerfab(marker,geom,po_arr); - - marker.FillBoundary(geom.periodicity()); - - //write plot file std::string pltfile; - pltfile = "plt"; - WriteSingleLevelPlotfile(pltfile, marker, {"marker"}, geom, 0.0, 0); + auto const& factory = makeEBFabFactory(geom, ba, dm, {1,1,1}, EBSupport::full); + MultiFab const& vfrc = factory->getVolFrac(); + MultiFab object(ba,dm,1,0); + object.setVal(1.0); + MultiFab::Subtract(object, vfrc, 0,0,1,0); + amrex::WriteMLMF("plt", {&object}, {geom}); } - amrex::Finalize(); }