XYDelaunayGenerator

Triangulates meshes within boundaries defined by input meshes.

Examples

Using instances of the PolyLineMeshGenerator to create a boundary and a few holes, followed by a XYDelaunayGenerator object to triangulate the region between them, the Mesh block shown in the input file snippet below generates the final mesh shown in Figure 1.

For this example a specified fixed interpolation of boundary edges is used, but refinement to a desired maximum triangle size allows automatic placement of nodes in the mesh interior.

[Mesh]
  [outer_bdy]
    type = PolyLineMeshGenerator
    points = '-1.0 0.0 0.0
              0.0 -1.0 0.0
              1.0 0.0 0.0
              0.0 2.0 0.0'
    loop = true
  []
  [hole_1]
    type = PolyLineMeshGenerator
    points = '-0.5 -0.1 0.0
              -0.3 -0.1 0.0
              -0.3 0.1 0.0
              -0.5 0.1 0.0'
    loop = true
  []
  [hole_2]
    type = PolyLineMeshGenerator
    points = '0.3 -0.1 0.0
              0.5 -0.1 0.0
              0.5 0.1 0.0
              0.3 0.1 0.0'
    loop = true
  []
  [triang]
    type = XYDelaunayGenerator
    boundary = 'outer_bdy'
    holes = 'hole_1
             hole_2'
    add_nodes_per_boundary_segment = 3
    refine_boundary = false
    desired_area = 0.05
  []
[]
(test/tests/meshgenerators/xy_delaunay_generator/xydelaunay_with_holes.i)

Figure 1: Fig. 1: Resulting triangulated mesh from a polyline boundary and holes.

With the stitching options, meshes used as "holes" can be inserted into those portions of the output mesh. For this use case some care may be required: refinement of stitched hole boundaries should be disallowed so that the boundary nodes in the newly triangulated mesh still precisely match the boundary nodes in the hole mesh.

In the input file snippet below, hole stitching is done recursively, so that each internal "boundary" polyline (after refinement) remains preserved in the final mesh shown in Figure 2.

[Mesh]
  [inner_square_sbd_0]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 3
    ny = 3
    xmin = -0.4
    xmax = 0.4
    ymin = -0.4
    ymax = 0.4
  []
  [inner_square]
    type = SubdomainIDGenerator
    input = inner_square_sbd_0
    subdomain_id = 1 # Exodus dislikes quad ids matching tri ids
  []
  [layer_2_bdy]
    type = PolyLineMeshGenerator
    points = '-1.0 0.0 0.0
              0.0 -1.0 0.0
              1.0 0.0 0.0
              0.0 1.0 0.0'
    loop = true
  []
  [layer_3_bdy]
    type = PolyLineMeshGenerator
    points = '-1.5 -1.5 0.0
              1.5 -1.5 0.0
              1.5 1.5 0.0
              -1.5 1.5 0.0'
    loop = true
  []
  [layer_4_bdy]
    type = PolyLineMeshGenerator
    points = '-4.0 0.0 0.0
              0.0 -4.0 0.0
              4.0 0.0 0.0
              0.0 4.0 0.0'
    loop = true
  []
  [triang_2]
    type = XYDelaunayGenerator
    boundary = 'layer_2_bdy'
    holes = 'inner_square'
    stitch_holes = 'true'
    refine_holes = 'false'
    verify_holes = false
    add_nodes_per_boundary_segment = 2
    refine_boundary = false
    desired_area = 0.05
  []
  [triang_3]
    type = XYDelaunayGenerator
    boundary = 'layer_3_bdy'
    holes = 'triang_2'
    stitch_holes = 'true'
    refine_holes = 'false'
    add_nodes_per_boundary_segment = 2
    refine_boundary = false
    desired_area = 0.1
  []
  [triang_4]
    type = XYDelaunayGenerator
    boundary = 'layer_4_bdy'
    holes = 'triang_3'
    stitch_holes = 'true'
    refine_holes = 'false'
    verify_holes = false
    add_nodes_per_boundary_segment = 2
    refine_boundary = true
    desired_area = 0.2
  []
[]
(test/tests/meshgenerators/xy_delaunay_generator/xydelaunay_nested.i)

Figure 2: Fig. 2: Resulting triangulated mesh with nested polyline boundaries and an internal grid.

Input Parameters

  • boundaryThe input MeshGenerator that defines the output mesh outer boundary.

    C++ Type:MeshGeneratorName

    Controllable:No

    Description:The input MeshGenerator that defines the output mesh outer boundary.

Required Parameters

  • add_nodes_per_boundary_segment0How many more nodes to add in each outer boundary segment.

    Default:0

    C++ Type:unsigned int

    Controllable:No

    Description:How many more nodes to add in each outer boundary segment.

  • algorithmBINARYControl the use of binary search for the nodes of the stitched surfaces.

    Default:BINARY

    C++ Type:MooseEnum

    Options:BINARY, EXHAUSTIVE

    Controllable:No

    Description:Control the use of binary search for the nodes of the stitched surfaces.

  • desired_area0Desired (maximum) triangle area, or 0 to skip uniform refinement

    Default:0

    C++ Type:double

    Controllable:No

    Description:Desired (maximum) triangle area, or 0 to skip uniform refinement

  • desired_area_funcDesired area as a function of x,y; omit to skip non-uniform refinement

    C++ Type:std::string

    Controllable:No

    Description:Desired area as a function of x,y; omit to skip non-uniform refinement

  • hole_boundariesBoundary names to set on holes. Default IDs are numbered up from 1.

    C++ Type:std::vector<BoundaryName>

    Controllable:No

    Description:Boundary names to set on holes. Default IDs are numbered up from 1.

  • holesThe MeshGenerators that define mesh holes.

    C++ Type:std::vector<MeshGeneratorName>

    Controllable:No

    Description:The MeshGenerators that define mesh holes.

  • input_boundary_names2D-input-mesh boundaries defining the output mesh outer boundary

    C++ Type:std::vector<BoundaryName>

    Controllable:No

    Description:2D-input-mesh boundaries defining the output mesh outer boundary

  • input_subdomain_names1D-input-mesh subdomains defining the output mesh outer boundary

    C++ Type:std::vector<SubdomainName>

    Controllable:No

    Description:1D-input-mesh subdomains defining the output mesh outer boundary

  • output_boundaryBoundary name to set on new outer boundary. Default ID 0.

    C++ Type:BoundaryName

    Controllable:No

    Description:Boundary name to set on new outer boundary. Default ID 0.

  • output_subdomain_nameSubdomain name to set on new triangles.

    C++ Type:SubdomainName

    Controllable:No

    Description:Subdomain name to set on new triangles.

  • refine_boundaryTrueWhether to allow automatically refining the outer boundary.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Whether to allow automatically refining the outer boundary.

  • refine_holesWhether to allow automatically refining each hole boundary.

    C++ Type:std::vector<bool>

    Controllable:No

    Description:Whether to allow automatically refining each hole boundary.

  • smooth_triangulationFalseWhether to do Laplacian mesh smoothing on the generated triangles.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether to do Laplacian mesh smoothing on the generated triangles.

  • stitch_holesWhether to stitch to the mesh defining each hole.

    C++ Type:std::vector<bool>

    Controllable:No

    Description:Whether to stitch to the mesh defining each hole.

  • verbose_stitchingFalseWhether mesh stitching should have verbose output.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether mesh stitching should have verbose output.

  • verify_holesTrueVerify holes do not intersect boundary or each other. Asymptotically costly.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Verify holes do not intersect boundary or each other. Asymptotically costly.

Optional Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set the enabled status of the MooseObject.

  • save_with_nameKeep the mesh from this mesh generator in memory with the name specified

    C++ Type:std::string

    Controllable:No

    Description:Keep the mesh from this mesh generator in memory with the name specified

Advanced Parameters

  • nemesisFalseWhether or not to output the mesh file in the nemesisformat (only if output = true)

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not to output the mesh file in the nemesisformat (only if output = true)

  • outputFalseWhether or not to output the mesh file after generating the mesh

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not to output the mesh file after generating the mesh

  • show_infoFalseWhether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)

Debugging Parameters

Input Files