Skip to content

Commit

Permalink
Verify hole boundaries by default
Browse files Browse the repository at this point in the history
  • Loading branch information
roystgnr committed Aug 8, 2022
1 parent 009df73 commit 816b8b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions framework/include/meshgenerators/Poly2TriMeshGenerator.h
Expand Up @@ -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<std::unique_ptr<MeshBase> *> _hole_ptrs;

Expand Down
7 changes: 7 additions & 0 deletions framework/src/meshgenerators/Poly2TriMeshGenerator.C
Expand Up @@ -53,6 +53,11 @@ Poly2TriMeshGenerator::validParams()
params.addParam<std::vector<boundary_id_type>>(
"hole_boundary_ids", "Boundary ids to set on holes. Numbered up from 1 by default.");

params.addParam<bool>(
"verify_holes",
true,
"Verify holes do not intersect boundary or each other. Asymptotically costly.");

params.addParam<bool>("smooth_triangulation",
false,
"Whether to do Laplacian mesh smoothing on the generated triangles.");
Expand Down Expand Up @@ -89,6 +94,7 @@ Poly2TriMeshGenerator::Poly2TriMeshGenerator(const InputParameters & parameters)
_refine_bdy(getParam<bool>("refine_boundary")),
_output_subdomain_id(getParam<subdomain_id_type>("output_subdomain_id")),
_smooth_tri(getParam<bool>("smooth_triangulation")),
_verify_holes(getParam<bool>("verify_holes")),
_hole_ptrs(getMeshes("holes")),
_stitch_holes(getParam<std::vector<bool>>("stitch_holes")),
_refine_holes(getParam<std::vector<bool>>("refine_holes")),
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 816b8b5

Please sign in to comment.