Loading src/inputs.hpp +4 −1 Original line number Diff line number Diff line Loading @@ -9,14 +9,17 @@ static const std::string PROB_HI("geometry.prob_hi"); static const std::string PROB_LO("geometry.prob_lo"); // Mesh static const std::string SMALL_VOLFRAC("eb2.small_volfrac"); static const std::string BLOCKING_FACTOR("amr.blocking_factor"); static const std::string FABARRAY_TILE_SZ("fabarray.mfiter_tile_size"); static const std::string GRID_SIZE_X("amr.max_grid_size_x"); static const std::string GRID_SIZE_Y("amr.max_grid_size_y"); static const std::string GRID_SIZE_Z("amr.max_grid_size_z"); static const std::string N_CELL("amr.n_cell"); static const std::string PARTICLE_GRID_SIZE_X("particles.max_grid_size_x"); static const std::string PARTICLE_GRID_SIZE_Y("particles.max_grid_size_y"); static const std::string PARTICLE_GRID_SIZE_Z("particles.max_grid_size_z"); static const std::string PARTICLE_TILE_SZ("particles.tile_size"); static const std::string SMALL_VOLFRAC("eb2.small_volfrac"); // Time static const std::string CFL("mfix.cfl"); Loading src/mesh.cpp +25 −3 Original line number Diff line number Diff line Loading @@ -43,19 +43,41 @@ std::optional<solver::MeshSettings> make_mesh(solver::InputInfo ii) { if (grid_size_x.size() != 1) { std::cout << GRID_SIZE_X << " is a scalar " << std::endl; } else { mx.grid_size = grid_size_x[0]; mx.max_grid_size = grid_size_x[0]; } auto grid_size_y = std::get<solver::NumberArray>(ii[GRID_SIZE_Y]); if (grid_size_y.size() != 1) { std::cout << GRID_SIZE_Y << " is a scalar " << std::endl; } else { my.grid_size = grid_size_y[0]; my.max_grid_size = grid_size_y[0]; } auto grid_size_z = std::get<solver::NumberArray>(ii[GRID_SIZE_Z]); if (grid_size_z.size() != 1) { std::cout << GRID_SIZE_Z << " is a scalar " << std::endl; } else { mz.grid_size = grid_size_z[0]; mz.max_grid_size = grid_size_z[0]; } auto particle_grid_size_x = std::get<solver::NumberArray>(ii[PARTICLE_GRID_SIZE_X]); if (particle_grid_size_x.size() != 1) { std::cout << PARTICLE_GRID_SIZE_X << " is a scalar " << std::endl; } else { mx.particle_max_grid_size = particle_grid_size_x[0]; } auto particle_grid_size_y = std::get<solver::NumberArray>(ii[PARTICLE_GRID_SIZE_Y]); if (particle_grid_size_y.size() != 1) { std::cout << PARTICLE_GRID_SIZE_Y << " is a scalar " << std::endl; } else { my.particle_max_grid_size = particle_grid_size_y[0]; } auto particle_grid_size_z = std::get<solver::NumberArray>(ii[PARTICLE_GRID_SIZE_Z]); if (particle_grid_size_z.size() != 1) { std::cout << PARTICLE_GRID_SIZE_Z << " is a scalar " << std::endl; } else { mz.particle_max_grid_size = particle_grid_size_z[0]; } auto bf = std::get<solver::NumberArray>(ii[BLOCKING_FACTOR]); Loading src/solver.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ struct GeometrySettings { struct MeshAxis { unsigned int fab_tile_size; unsigned int grid_size; unsigned int max_grid_size; unsigned int particle_max_grid_size; unsigned int n_cell; unsigned int particle_tile_size; }; Loading tests/solver.t.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -28,6 +28,9 @@ TEST_CASE("from_origin", "[]") { ii[GRID_SIZE_X] = solver::NumberArray({24}); ii[GRID_SIZE_Y] = solver::NumberArray({25}); ii[GRID_SIZE_Z] = solver::NumberArray({26}); ii[PARTICLE_GRID_SIZE_X] = solver::NumberArray({94}); ii[PARTICLE_GRID_SIZE_Y] = solver::NumberArray({95}); ii[PARTICLE_GRID_SIZE_Z] = solver::NumberArray({96}); // Time ii[DT_MAX] = solver::NumberArray({99.99}); Loading Loading @@ -60,9 +63,12 @@ TEST_CASE("from_origin", "[]") { CHECK(mx.n_cell == 11); CHECK(my.n_cell == 22); CHECK(mz.n_cell == 33); CHECK(mx.grid_size == 24); CHECK(my.grid_size == 25); CHECK(mz.grid_size == 26); CHECK(mx.max_grid_size == 24); CHECK(my.max_grid_size == 25); CHECK(mz.max_grid_size == 26); CHECK(mx.particle_max_grid_size == 94); CHECK(my.particle_max_grid_size == 95); CHECK(mz.particle_max_grid_size == 96); CHECK(mx.particle_tile_size == 333); CHECK(my.particle_tile_size == 444); CHECK(mz.particle_tile_size == 555); Loading Loading
src/inputs.hpp +4 −1 Original line number Diff line number Diff line Loading @@ -9,14 +9,17 @@ static const std::string PROB_HI("geometry.prob_hi"); static const std::string PROB_LO("geometry.prob_lo"); // Mesh static const std::string SMALL_VOLFRAC("eb2.small_volfrac"); static const std::string BLOCKING_FACTOR("amr.blocking_factor"); static const std::string FABARRAY_TILE_SZ("fabarray.mfiter_tile_size"); static const std::string GRID_SIZE_X("amr.max_grid_size_x"); static const std::string GRID_SIZE_Y("amr.max_grid_size_y"); static const std::string GRID_SIZE_Z("amr.max_grid_size_z"); static const std::string N_CELL("amr.n_cell"); static const std::string PARTICLE_GRID_SIZE_X("particles.max_grid_size_x"); static const std::string PARTICLE_GRID_SIZE_Y("particles.max_grid_size_y"); static const std::string PARTICLE_GRID_SIZE_Z("particles.max_grid_size_z"); static const std::string PARTICLE_TILE_SZ("particles.tile_size"); static const std::string SMALL_VOLFRAC("eb2.small_volfrac"); // Time static const std::string CFL("mfix.cfl"); Loading
src/mesh.cpp +25 −3 Original line number Diff line number Diff line Loading @@ -43,19 +43,41 @@ std::optional<solver::MeshSettings> make_mesh(solver::InputInfo ii) { if (grid_size_x.size() != 1) { std::cout << GRID_SIZE_X << " is a scalar " << std::endl; } else { mx.grid_size = grid_size_x[0]; mx.max_grid_size = grid_size_x[0]; } auto grid_size_y = std::get<solver::NumberArray>(ii[GRID_SIZE_Y]); if (grid_size_y.size() != 1) { std::cout << GRID_SIZE_Y << " is a scalar " << std::endl; } else { my.grid_size = grid_size_y[0]; my.max_grid_size = grid_size_y[0]; } auto grid_size_z = std::get<solver::NumberArray>(ii[GRID_SIZE_Z]); if (grid_size_z.size() != 1) { std::cout << GRID_SIZE_Z << " is a scalar " << std::endl; } else { mz.grid_size = grid_size_z[0]; mz.max_grid_size = grid_size_z[0]; } auto particle_grid_size_x = std::get<solver::NumberArray>(ii[PARTICLE_GRID_SIZE_X]); if (particle_grid_size_x.size() != 1) { std::cout << PARTICLE_GRID_SIZE_X << " is a scalar " << std::endl; } else { mx.particle_max_grid_size = particle_grid_size_x[0]; } auto particle_grid_size_y = std::get<solver::NumberArray>(ii[PARTICLE_GRID_SIZE_Y]); if (particle_grid_size_y.size() != 1) { std::cout << PARTICLE_GRID_SIZE_Y << " is a scalar " << std::endl; } else { my.particle_max_grid_size = particle_grid_size_y[0]; } auto particle_grid_size_z = std::get<solver::NumberArray>(ii[PARTICLE_GRID_SIZE_Z]); if (particle_grid_size_z.size() != 1) { std::cout << PARTICLE_GRID_SIZE_Z << " is a scalar " << std::endl; } else { mz.particle_max_grid_size = particle_grid_size_z[0]; } auto bf = std::get<solver::NumberArray>(ii[BLOCKING_FACTOR]); Loading
src/solver.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ struct GeometrySettings { struct MeshAxis { unsigned int fab_tile_size; unsigned int grid_size; unsigned int max_grid_size; unsigned int particle_max_grid_size; unsigned int n_cell; unsigned int particle_tile_size; }; Loading
tests/solver.t.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -28,6 +28,9 @@ TEST_CASE("from_origin", "[]") { ii[GRID_SIZE_X] = solver::NumberArray({24}); ii[GRID_SIZE_Y] = solver::NumberArray({25}); ii[GRID_SIZE_Z] = solver::NumberArray({26}); ii[PARTICLE_GRID_SIZE_X] = solver::NumberArray({94}); ii[PARTICLE_GRID_SIZE_Y] = solver::NumberArray({95}); ii[PARTICLE_GRID_SIZE_Z] = solver::NumberArray({96}); // Time ii[DT_MAX] = solver::NumberArray({99.99}); Loading Loading @@ -60,9 +63,12 @@ TEST_CASE("from_origin", "[]") { CHECK(mx.n_cell == 11); CHECK(my.n_cell == 22); CHECK(mz.n_cell == 33); CHECK(mx.grid_size == 24); CHECK(my.grid_size == 25); CHECK(mz.grid_size == 26); CHECK(mx.max_grid_size == 24); CHECK(my.max_grid_size == 25); CHECK(mz.max_grid_size == 26); CHECK(mx.particle_max_grid_size == 94); CHECK(my.particle_max_grid_size == 95); CHECK(mz.particle_max_grid_size == 96); CHECK(mx.particle_tile_size == 333); CHECK(my.particle_tile_size == 444); CHECK(mz.particle_tile_size == 555); Loading