Actual source code: initEB.cpp
2: #include <AMReX_EB2.H>
3: #include <AMReX_EB2_IF.H>
5: #include <AMReX_ParmParse.H>
7: #include <cmath>
8: #include <algorithm>
10: #include "MyTest.H"
11: #include "MyEB.H"
13: using namespace amrex;
15: void MyTest::initializeEB()
16: {
17: ParmParse pp("eb2");
18: std::string geom_type;
19: pp.get("geom_type", geom_type);
21: if (geom_type == "combustor") {
22: amrex::Abort("initializeEB: todo");
23: } else if (geom_type == "rotated_box") {
24: EB2::BoxIF box({AMREX_D_DECL(0.25, 0.25, 0.25)}, {AMREX_D_DECL(0.75, 0.75, 0.75)}, false);
25: auto gshop = EB2::makeShop(EB2::translate(EB2::rotate(EB2::translate(box, {AMREX_D_DECL(-0.5, -0.5, -0.5)}), std::atan(1.0) * 0.3, 2), {AMREX_D_DECL(0.5, 0.5, 0.5)}));
26: EB2::Build(gshop, geom.back(), max_level, max_level + max_coarsening_level);
27: } else if (geom_type == "two_spheres") {
28: EB2::SphereIF sphere1(0.2, {AMREX_D_DECL(0.45, 0.4, 0.58)}, false);
29: EB2::SphereIF sphere2(0.2, {AMREX_D_DECL(0.55, 0.42, 0.6)}, false);
30: auto twospheres = EB2::makeUnion(sphere1, sphere2);
31: auto gshop = EB2::makeShop(twospheres);
32: EB2::Build(gshop, geom.back(), max_level, max_level + max_coarsening_level);
33: } else if (geom_type == "two_spheres_one_box") {
34: EB2::SphereIF sphere1(0.2, {AMREX_D_DECL(0.5, 0.48, 0.5)}, false);
35: EB2::SphereIF sphere2(0.2, {AMREX_D_DECL(0.55, 0.58, 0.5)}, false);
36: EB2::BoxIF box({AMREX_D_DECL(0.25, 0.75, 0.5)}, {AMREX_D_DECL(0.75, 0.8, 0.75)}, false);
37: auto twospheres = EB2::makeUnion(sphere1, sphere2, box);
38: auto gshop = EB2::makeShop(twospheres);
39: EB2::Build(gshop, geom.back(), max_level, max_level + max_coarsening_level);
40: } else if (geom_type == "flower") {
41: FlowerIF flower(0.2, 0.1, 6, {AMREX_D_DECL(0.5, 0.5, 0.5)}, false);
42: auto gshop = EB2::makeShop(flower);
43: EB2::Build(gshop, geom.back(), max_level, max_level + max_coarsening_level);
44: } else {
45: EB2::Build(geom.back(), max_level, max_level + max_coarsening_level);
46: }
47: }