diff --git a/framework/include/meshgenerators/RefineSidesetGenerator.h b/framework/include/meshgenerators/RefineSidesetGenerator.h index 9c151926a9a0..4b582615c34a 100644 --- a/framework/include/meshgenerators/RefineSidesetGenerator.h +++ b/framework/include/meshgenerators/RefineSidesetGenerator.h @@ -37,7 +37,7 @@ class RefineSidesetGenerator : public MeshGenerator /// Toggles whether neighboring level one elements should be refined or not. Defaults to true. const bool _enable_neighbor_refinement; - /// Side of the boundary to be refined + /// Side(s) of the boundary/boundaries to be refined. Can be either "primary"(just the boundary elements), "secondary"(just the neighboring elements), or "both." const MultiMooseEnum _boundary_side; /// The actual function refining the boundaries. This is done recursively in order to minimize the number of refinement iterations. diff --git a/framework/src/meshgenerators/RefineSidesetGenerator.C b/framework/src/meshgenerators/RefineSidesetGenerator.C index 46d02eda0c0e..9245cb3d4547 100644 --- a/framework/src/meshgenerators/RefineSidesetGenerator.C +++ b/framework/src/meshgenerators/RefineSidesetGenerator.C @@ -31,7 +31,7 @@ RefineSidesetGenerator::validParams() true, "Toggles whether neighboring level one elements should be refined or not. Defaults to true"); MultiMooseEnum boundary_side("primary secondary both", "both"); - params.addParam("boundary_side", boundary_side, " "); + params.addParam("boundary_side", boundary_side, "Whether the generator should refine itself(primary), its neighbors(secondary), or itself and its neighbors(both)"); return params; } @@ -45,16 +45,15 @@ RefineSidesetGenerator::RefineSidesetGenerator(const InputParameters & parameter _boundary_side(getParam("boundary_side")) { } + std::unique_ptr RefineSidesetGenerator::generate() { - // Get the list of boundary ids from the boundary names const auto boundary_ids = MooseMeshUtils::getBoundaryIDs(*_input, getParam>("boundaries"), true); // Check that the boundary ids/names exist in the mesh - for (std::size_t i = 0; i < boundary_ids.size(); ++i) if (boundary_ids[i] == Moose::INVALID_BOUNDARY_ID) { @@ -67,8 +66,6 @@ RefineSidesetGenerator::generate() std::unique_ptr mesh = std::move(_input); int max = *std::max_element(_refinement.begin(), _refinement.end()); - - return recursive_refine(boundary_ids, mesh, _refinement, max); } @@ -79,7 +76,7 @@ RefineSidesetGenerator::recursive_refine(std::vector boundary_ int max, int ref_step) { - +//If the refinement step has reached the largest value in the _refinement array, return the mesh, as we are done. if (ref_step == max) return dynamic_pointer_cast(mesh); mesh->prepare_for_use(); @@ -88,7 +85,6 @@ RefineSidesetGenerator::recursive_refine(std::vector boundary_ if (refinement[i] > 0 && refinement[i] > ref_step) { BoundaryInfo boundInfo = mesh->get_boundary_info(); - //declared up here to avoid weird typing bug std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > sideList = boundInfo.build_active_side_list(); for (std::tuple tuple : sideList){ if (std::get<2>(tuple) == boundary_ids[i]){ @@ -109,7 +105,6 @@ RefineSidesetGenerator::recursive_refine(std::vector boundary_ child_elem->set_refinement_flag(Elem::REFINE); } } - } } } @@ -119,7 +114,6 @@ RefineSidesetGenerator::recursive_refine(std::vector boundary_ if (!_enable_neighbor_refinement) refinedmesh.face_level_mismatch_limit() = 0; refinedmesh.refine_elements(); - ref_step++; return recursive_refine(boundary_ids, mesh, refinement, max, ref_step); }