From 816b8b571a6876eaa464df6a813420afcd59fa32 Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Fri, 5 Aug 2022 12:24:42 -0500 Subject: [PATCH] Verify hole boundaries by default --- framework/include/meshgenerators/Poly2TriMeshGenerator.h | 3 +++ framework/src/meshgenerators/Poly2TriMeshGenerator.C | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/framework/include/meshgenerators/Poly2TriMeshGenerator.h b/framework/include/meshgenerators/Poly2TriMeshGenerator.h index 62d888212853..3ee9b5eef615 100644 --- a/framework/include/meshgenerators/Poly2TriMeshGenerator.h +++ b/framework/include/meshgenerators/Poly2TriMeshGenerator.h @@ -41,6 +41,9 @@ class Poly2TriMeshGenerator : public MeshGenerator /// Whether to do Laplacian mesh smoothing on the generated triangles const bool _smooth_tri; + /// Whether to verify holes do not intersect boundary or each other + const bool _verify_holes; + /// Holds pointers to the pointers to input meshes defining holes const std::vector *> _hole_ptrs; diff --git a/framework/src/meshgenerators/Poly2TriMeshGenerator.C b/framework/src/meshgenerators/Poly2TriMeshGenerator.C index 1d6337d5163e..e9664557f5f6 100644 --- a/framework/src/meshgenerators/Poly2TriMeshGenerator.C +++ b/framework/src/meshgenerators/Poly2TriMeshGenerator.C @@ -53,6 +53,11 @@ Poly2TriMeshGenerator::validParams() params.addParam>( "hole_boundary_ids", "Boundary ids to set on holes. Numbered up from 1 by default."); + params.addParam( + "verify_holes", + true, + "Verify holes do not intersect boundary or each other. Asymptotically costly."); + params.addParam("smooth_triangulation", false, "Whether to do Laplacian mesh smoothing on the generated triangles."); @@ -89,6 +94,7 @@ Poly2TriMeshGenerator::Poly2TriMeshGenerator(const InputParameters & parameters) _refine_bdy(getParam("refine_boundary")), _output_subdomain_id(getParam("output_subdomain_id")), _smooth_tri(getParam("smooth_triangulation")), + _verify_holes(getParam("verify_holes")), _hole_ptrs(getMeshes("holes")), _stitch_holes(getParam>("stitch_holes")), _refine_holes(getParam>("refine_holes")), @@ -162,6 +168,7 @@ Poly2TriMeshGenerator::generate() poly2tri.set_interpolate_boundary_points(_add_nodes_per_boundary_segment); poly2tri.set_refine_boundary_allowed(_refine_bdy); + poly2tri.set_verify_hole_boundaries(_verify_holes); poly2tri.desired_area() = _desired_area; poly2tri.minimum_angle() = 0; // Not yet supported