@@ -8,12 +8,11 @@ using namespace amrex;
88
99void main_main ()
1010{
11- int nx = 128 ;
12- int ny = 128 ;
13- int nz = 128 ;
14- int max_grid_size = 64 ;
11+ int nx = 64 ;
12+ int ny = 64 ;
13+ int nz = 64 ;
14+ int max_grid_size = 32 ;
1515 std::string plot_file{" plt" };
16- int which_stl = 0 ;
1716 Real xmin = -1.2 ;
1817 Real xmax = 1.2 ;
1918 Real ymin = -1.2 ;
@@ -26,149 +25,18 @@ void main_main ()
2625 pp.query (" ny" , ny);
2726 pp.query (" nz" , nz);
2827 pp.query (" max_grid_size" , max_grid_size);
29- pp.query (" plot_file" , plot_file);
30- pp.query (" which_stl" , which_stl);
3128
3229 ParmParse ppeb2 (" eb2" );
3330 std::string geom_type (" stl" );
3431 ppeb2.add (" geom_type" , geom_type);
32+ ppeb2.add (" test_marching_cubes" , 1 );
3533 }
3634
3735 {
38- std::string stl_file;
36+ std::string stl_file ( " cube.stl " ) ;
3937 Real stl_scale = 1.0 ;
4038 std::vector<Real> stl_center{0.0 , 0.0 , 0.0 };
4139
42- if (which_stl == 0 ) {
43- stl_file = " AileM6_with_sharp_TE.stl" ;
44- nx = ny = nz = 256 ;
45- stl_scale = 0.001 ;
46- stl_center = std::vector<Real>{-0.8 , -0.8 , 0 .};
47- } else if (which_stl == 1 ) {
48- stl_file = " sphere.stl" ;
49- } else if (which_stl == 2 ) {
50- stl_file = " cube.stl" ;
51- } else if (which_stl == 3 ) {
52- stl_file = " Sphericon.stl" ;
53- stl_scale = 0.001 ;
54- } else if (which_stl == 4 ) {
55- stl_file = " stls/blindt.stl" ;
56- stl_scale = 0.012 ;
57- stl_center = std::vector<Real>{-1 ., 0 ., -1 .};
58- } else if (which_stl == 5 ) {
59- stl_file = " stls/cone_2.stl" ;
60- stl_center = std::vector<Real>{-1 ., -1 ., -0.45 };
61- } else if (which_stl == 6 ) {
62- stl_file = " stls/cone.stl" ;
63- stl_center = std::vector<Real>{-1 ., -1 ., -0.25 };
64- } else if (which_stl == 7 ) {
65- stl_file = " stls/cube.stl" ;
66- stl_scale = 2 .;
67- stl_center = std::vector<Real>{-1 ., -1 ., -1 .};
68- } else if (which_stl == 8 ) {
69- stl_file = " stls/cylinder.stl" ;
70- stl_scale = 0.4 ;
71- stl_center = std::vector<Real>{0 ., 0 ., -1 .};
72- } else if (which_stl == 9 ) {
73- stl_file = " stls/elbow1.stl" ;
74- stl_scale = 1.7 ;
75- stl_center = std::vector<Real>{1 ., 0 ., 1 .};
76- } else if (which_stl == 10 ) {
77- stl_file = " stls/elbow2.stl" ;
78- stl_scale = 1.0 ;
79- stl_center = std::vector<Real>{1 ., 0 ., 1 .};
80- } else if (which_stl == 11 ) {
81- stl_file = " stls/elbow3.stl" ;
82- stl_scale = 1.0 ;
83- stl_center = std::vector<Real>{1 ., 0 ., 1 .};
84- } else if (which_stl == 12 ) {
85- stl_file = " stls/elbow5.stl" ;
86- stl_scale = 0.35 ;
87- stl_center = std::vector<Real>{1 ., 0 ., 1 .};
88- } else if (which_stl == 13 ) {
89- stl_file = " stls/elbow.stl" ;
90- stl_scale = 0.022 ;
91- stl_center = std::vector<Real>{-1 ., -1 ., 0 .};
92- } else if (which_stl == 14 ) {
93- stl_file = " stls/halfsphere.stl" ;
94- stl_scale = 0.16 ;
95- stl_center = std::vector<Real>{0 ., 0 ., 0.49 };
96- } else if (which_stl == 15 ) {
97- // VERY slow
98- stl_file = " stls/pipe_area_change1.stl" ;
99- stl_scale = 0.0155 ;
100- stl_center = std::vector<Real>{0 ., 0 ., -0.1 };
101- } else if (which_stl == 16 ) {
102- // VERY slow
103- stl_file = " stls/pipe_area_change2.stl" ;
104- stl_scale = 0.012 ;
105- stl_center = std::vector<Real>{0 ., 0 ., 0.1 };
106- } else if (which_stl == 17 ) {
107- stl_file = " stls/pipe_area_change3.stl" ;
108- stl_scale = 0.018 ;
109- stl_center = std::vector<Real>{0 ., -1 ., 0 .};
110- } else if (which_stl == 18 ) {
111- stl_file = " stls/rect.stl" ;
112- stl_scale = 6.6 ;
113- stl_center = std::vector<Real>{-0.5 , -0.5 , -1 .};
114- } else if (which_stl == 19 ) {
115- // VERY slow
116- stl_file = " stls/unit_sphere.stl" ;
117- stl_scale = 4 .;
118- stl_center = std::vector<Real>{0 ., 0 ., 0 .};
119- } else if (which_stl == 20 ) {
120- stl_file = " stls/stl-annulus/CA_500.stl" ;
121- stl_scale = 0.002 ;
122- stl_center = std::vector<Real>{0 ., 0 ., -1 .};
123- } else if (which_stl == 21 ) {
124- stl_file = " stls/stl-annulus/CA_600.stl" ;
125- stl_scale = 0.002 ;
126- stl_center = std::vector<Real>{0 ., 0 ., -1 .};
127- } else if (which_stl == 22 ) {
128- stl_file = " stls/stl-annulus/CA_950.stl" ;
129- stl_scale = 0.002 ;
130- stl_center = std::vector<Real>{0 ., 0 ., -1 .};
131- } else if (which_stl == 23 ) {
132- stl_file = " stls/stl-annulus/CA_ALL.stl" ;
133- stl_scale = 0.002 ;
134- stl_center = std::vector<Real>{0 ., 0 ., -1 .};
135- } else if (which_stl == 24 ) {
136- stl_file = " AileM6_with_sharp_TE.stl" ;
137- xmin = -40 .;
138- xmax = 1280 .;
139- ymin = -40 .;
140- ymax = 1280 .;
141- zmin = -40 .;
142- zmax = 40 .;
143- nx = 528 ;
144- ny = 528 ;
145- nz = 32 ;
146- } else if (which_stl == 25 ) {
147- stl_file = " stls/HLPW-4_CRM-HL_40-37_Nominal_v2.stl" ;
148- stl_scale = 1.5e-5 ;
149- stl_center = std::vector<Real>{-0.5 , 0.01 , 0 .};
150- xmin = -0.5 ;
151- xmax = 0.5 ;
152- ymin = 0.0 ;
153- ymax = 0.5 ;
154- zmin = 0.0 ;
155- zmax = 0.25 ;
156- nx = 512 ;
157- ny = 256 ;
158- nz = 128 ;
159- } else if (which_stl == 26 ) {
160- stl_file = " armadillo.stl" ;
161- xmin = -64 .;
162- xmax = 64 .;
163- ymin = -64 .;
164- ymax = 128 .;
165- zmin = -64 .;
166- zmax = 64 ;
167- nx = 128 ;
168- ny = 192 ;
169- nz = 128 ;
170- }
171-
17240 ParmParse pp (" eb2" );
17341 pp.add (" stl_file" , stl_file);
17442 pp.add (" stl_scale" , stl_scale);
@@ -187,21 +55,6 @@ void main_main ()
18755 EB2::BuildMultiValuedMultiCut (geom,0 ,0 );
18856 double t1 = amrex::second ();
18957 amrex::Print () << " Build time: " << t1-t0 << " \n " ;
190-
191- #if 0
192-
193- auto const& factory = makeEBFabFactory(geom, ba, dm, {1,1,1}, EBSupport::full);
194- MultiFab const& vfrc = factory->getVolFrac();
195- amrex::VisMF::Write(vfrc, "vfrc");
196- //#if 0
197- amrex::WriteMLMF(plot_file, {&vfrc}, {geom});
198- MultiFab foo(vfrc.boxArray(), vfrc.DistributionMap(), 2, vfrc.nGrowVect());
199- foo.setVal(1.0);
200- MultiFab::Copy(foo, vfrc, 0, 0, 1, vfrc.nGrowVect());
201- MultiFab::Subtract(foo, vfrc, 0, 1, 1, vfrc.nGrowVect());
202- amrex::WriteMLMF("plt2", {&foo}, {geom});
203- //#endif
204- #endif
20558}
20659
20760int main (int argc, char * argv[])
0 commit comments