XYZDelaunayGenerator
Creates tetrahedral 3D meshes within boundaries defined by input meshes.
An input mesh will be used to define the outer boundary of a generated tetrahedral output mesh. Additional interior vertices can be automatically generated by specifying a desired tetrahedral volume. Additional interior boundary "holes" can be specified by the mesh generators specified in the "holes" vector parameter.
Each input mesh, as specified in the "boundary" parameter and optionally in the "holes" parameter, can define a closed manifold of boundary triangles.
The "boundary" input mesh can either include 2D surface elements or 3D volume elements whose external faces comprise the boundary manifold. If the "boundary" input mesh contains volume elements with non-Tri3 surface sides or non-Tri3 surface elements, the elements (from the entire boundary input mesh) can be converted automatically by this mesh generator to ensure Tri-3 surface elements.
The "holes" input mesh can contain either all 3D volume elements, or all 2D surface elements. If one of the "holes" meshes contains non-Tri3 surface elements, or volume elements with non-Tri3 side elements on its external surface, the elements (from the entire holes) can be converted automatically by this mesh generator to ensure Tri-3 surface elements.
If multiple disconnected manifolds exist in a boundary mesh, only the manifold enclosing the rest of the mesh is considered to be "the" boundary. Input meshes which are not connected, which therefore have multiple outer boundary manifolds, are not yet supported.
Nodes internal to the boundary mesh are currently ignored. Future expansions of this class may allow such nodes to be retained as nodes in the output tetrahedralization.
Using stitching options, meshes used as "holes" can subsequently be stitched into those portions of the output mesh. If a hole mesh contains volume elements with non-Tri3 surface sides, it cannot be stitched with the output mesh without modifications. "convert_holes_for_stitching" needs to be set as true
to allow the stitching of such hole meshes after modifications.
commentnote
In distributed mesh mode, the "boundary" input mesh is temporarily serialized when it is set to be stitched with at least one of the "holes" input meshes. Additionally, the "holes" input meshes are always temporarily serialized to ensure compatibility with required processing methods.
Interior vertices can be adjusted after mesh generation using the "smooth_triangulation" parameter, to produce a more "smooth" mesh, but currently the only mesh smoother option is a simple Laplacian smoother; this can have unwanted side-effects on meshes with concave boundaries or poor nodal valences, and so it is disabled by default for robustness.
The elements generated by XYZDelaunayGenerator
can be refined according to a given uniform element volume specified as "desired_volume". This refinement is currently controlled by the third-party Netgen code.
holes
C++ Type:std::vector<MeshGeneratorName>
Controllable:No
Description:The MeshGenerators that create meshes defining the holes. A hole mesh must contain either 3D volume elements where the external surface of the mesh works as the closed manifold that defines the hole, or 2D surface elements that form the closed manifold that defines the hole.
boundary
C++ Type:MeshGeneratorName
Controllable:No
Description:The input MeshGenerator defining the output outer boundary. The input mesh (the output mesh of the input mesh generator) can either include 3D volume elements or 2D surface elements.
holes
C++ Type:std::vector<MeshGeneratorName>
Controllable:No
Description:The MeshGenerators that create meshes defining the holes. A hole mesh must contain either 3D volume elements where the external surface of the mesh works as the closed manifold that defines the hole, or 2D surface elements that form the closed manifold that defines the hole.
boundary
C++ Type:MeshGeneratorName
Controllable:No
Description:The input MeshGenerator defining the output outer boundary. The input mesh (the output mesh of the input mesh generator) can either include 3D volume elements or 2D surface elements.
boundary
C++ Type:MeshGeneratorName
Controllable:No
Description:The input MeshGenerator defining the output outer boundary. The input mesh (the output mesh of the input mesh generator) can either include 3D volume elements or 2D surface elements.
holes
C++ Type:std::vector<MeshGeneratorName>
Controllable:No
Description:The MeshGenerators that create meshes defining the holes. A hole mesh must contain either 3D volume elements where the external surface of the mesh works as the closed manifold that defines the hole, or 2D surface elements that form the closed manifold that defines the hole.
holes
C++ Type:std::vector<MeshGeneratorName>
Controllable:No
Description:The MeshGenerators that create meshes defining the holes. A hole mesh must contain either 3D volume elements where the external surface of the mesh works as the closed manifold that defines the hole, or 2D surface elements that form the closed manifold that defines the hole.
convert_holes_for_stitching
Default:False
C++ Type:bool
Controllable:No
Description:Whether to convert the 3D hole meshes with non-TRI3 surface sides into all-TET4 meshes to allow stitching.
boundary
C++ Type:MeshGeneratorName
Controllable:No
Description:The input MeshGenerator defining the output outer boundary. The input mesh (the output mesh of the input mesh generator) can either include 3D volume elements or 2D surface elements.
holes
C++ Type:std::vector<MeshGeneratorName>
Controllable:No
Description:The MeshGenerators that create meshes defining the holes. A hole mesh must contain either 3D volume elements where the external surface of the mesh works as the closed manifold that defines the hole, or 2D surface elements that form the closed manifold that defines the hole.
holes
C++ Type:std::vector<MeshGeneratorName>
Controllable:No
Description:The MeshGenerators that create meshes defining the holes. A hole mesh must contain either 3D volume elements where the external surface of the mesh works as the closed manifold that defines the hole, or 2D surface elements that form the closed manifold that defines the hole.
smooth_triangulation
Default:False
C++ Type:bool
Controllable:No
Description:Whether to do Laplacian mesh smoothing on the generated triangles.
desired_volume
Default:0
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Desired (maximum) tetrahedral volume, or 0 to skip uniform refinement
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_nested.i)
[Mesh]
[inner_cube]
type = GeneratedMeshGenerator
dim = 3
elem_type = TET4
nx = 1
ny = 1
nz = 1
xmin = -0.4
xmax = 0.4
ymin = -0.4
ymax = 0.4
zmin = -0.4
zmax = 0.4
[]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
[]
[layer_2_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "z+x"
y_function = "y"
z_function = "z-x"
[]
[layer_3_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "3*x"
y_function = "3*y"
z_function = "3*z"
[]
[layer_4_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "4*x"
y_function = "4*y"
z_function = "4*z"
[]
[triang_2]
type = XYZDelaunayGenerator
boundary = 'layer_2_bdy'
holes = 'inner_cube'
stitch_holes = 'true'
desired_volume = 0.1
[]
[triang_3]
type = XYZDelaunayGenerator
boundary = 'layer_3_bdy'
holes = 'triang_2'
stitch_holes = 'true'
desired_volume = 0.2
[]
[triang_4]
type = XYZDelaunayGenerator
boundary = 'layer_4_bdy'
holes = 'triang_3'
stitch_holes = 'true'
desired_volume = 0.4
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
csv = true
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_stitching.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
elem_type = TET4
nx = 1
ny = 1
nz = 1
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "z+x"
y_function = "y"
z_function = "z-x"
[]
[hole_1]
type = ParsedNodeTransformGenerator
input = gmg
x_function = ".25+.125*x"
y_function = ".25+.125*y"
z_function = ".25+.125*z"
[]
[hole_1_name]
type = RenameBlockGenerator
input = hole_1
old_block = 0
new_block = hole
[]
[hole_2]
type = ParsedNodeTransformGenerator
input = gmg
x_function = ".75+.125*x"
y_function = ".75+.125*y"
z_function = ".75+.125*z"
[]
[hole_2_name_1]
type = RenameBlockGenerator
input = hole_2
old_block = 0
new_block = 1
[]
[hole_2_name_2]
type = RenameBlockGenerator
input = hole_2_name_1
old_block = 1
new_block = hole
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
holes = 'hole_1_name
hole_2'
stitch_holes = 'true
false'
desired_volume = 10000
output_subdomain_name = "triangles"
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
csv = true
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_bcid.i)
bcid_shift = 0
[Mesh]
[big]
type = GeneratedMeshGenerator
dim = 3
elem_type = TET4
nx = 1
ny = 1
nz = 1
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
[]
[h1]
type = GeneratedMeshGenerator
dim = 3
elem_type = TET4
nx = 1
ny = 1
nz = 1
xmin = -0.7
xmax = -0.3
ymin = -0.7
ymax = -0.3
zmin = -0.7
zmax = -0.3
subdomain_ids = '1'
boundary_id_offset = 10
boundary_name_prefix = h1
[]
[h2]
type = GeneratedMeshGenerator
dim = 3
elem_type = TET4
nx = 1
ny = 1
nz = 1
xmin = 0.3
xmax = 0.7
ymin = 0.3
ymax = 0.7
zmin = 0.3
zmax = 0.7
subdomain_ids = '2'
boundary_id_offset = 20
boundary_name_prefix = h2
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'big'
holes = 'h1 h2'
desired_volume = 1
output_boundary = 'ext'
hole_boundaries = 'h1 h2'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[ext_area_name]
type = AreaPostprocessor
boundary = 'ext'
[]
[h1_area_name]
type = AreaPostprocessor
boundary = 'h1'
[]
[h2_area_name]
type = AreaPostprocessor
boundary = 'h2'
[]
[ext_area_id]
type = AreaPostprocessor
boundary = ${fparse bcid_shift + 0}
[]
[h1_area_id]
type = AreaPostprocessor
boundary = ${fparse bcid_shift + 1}
[]
[h2_area_id]
type = AreaPostprocessor
boundary = ${fparse bcid_shift + 2}
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = 'FINAL'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_with_holes_1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[hole_1d]
type = ParsedCurveGenerator
x_formula = 'cos(t)'
y_formula = 'sin(t)'
section_bounding_t_values = '0.0 ${fparse 2.0*pi}'
nums_segments = '10'
constant_names = 'pi'
constant_expressions = '${fparse pi}'
is_closed_loop = true
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
holes = 'hole_1d'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_mesh_generator_3d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
# Let NetGen know interior points are okay
desired_volume = 100000
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
[output]
type = CSV
file_base = 'xyzdelaunay_mesh_generator_out'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_mesh_generator_2d.i)
[Mesh]
[fmg]
type = FileMeshGenerator
file = 'gold/2d_cube.e'
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = fmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
# Let NetGen know interior points are okay
desired_volume = 100000
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
[output]
type = CSV
file_base = 'xyzdelaunay_mesh_generator_out'
[]
[]
(test/tests/meshgenerators/cut_mesh_by_level_set_generator/cut_xyzd.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 10
ny = 10
nz = 10
xmin = -1
ymin = -1
zmin = -1
elem_type = HEX8
[]
[lsc]
type = CutMeshByLevelSetGenerator
input = gmg
level_set = 'x*x+y*y+z*z-0.81'
cut_face_id = 345
cut_face_name =ls
[]
[xyzd]
type = XYZDelaunayGenerator
boundary = lsc
desired_volume = 1
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
csv = true
[]
(test/tests/meshgenerators/boundary_2d_delaunay_generator/cylinder.i)
[Mesh]
[circle]
type = ConcentricCircleMeshGenerator
has_outer_square = false
radii = 1
num_sectors = 4
rings = 1
preserve_volumes = false
[]
[side]
type = SideSetsAroundSubdomainGenerator
input = circle
new_boundary = side
block = 1
[]
[extrude]
type = AdvancedExtruderGenerator
input = side
heights = '2'
num_layers = '3'
direction = '0 0 1'
[]
[side_1]
type = ParsedGenerateSideset
combinatorial_geometry = 'x>=0&y>=0'
new_sideset_name = 'side_1'
input = 'extrude'
included_boundaries = 'side'
[]
[bd_1]
type = Boundary2DDelaunayGenerator
input = side_1
boundary_names = 'side_1'
use_auto_area_func = true
[]
[side_2]
type = ParsedGenerateSideset
combinatorial_geometry = 'x<0&y>=0'
new_sideset_name = 'side_2'
input = 'extrude'
included_boundaries = 'side'
[]
[bd_2]
type = Boundary2DDelaunayGenerator
input = side_2
boundary_names = 'side_2'
use_auto_area_func = true
[]
[side_3]
type = ParsedGenerateSideset
combinatorial_geometry = 'x<0&y<0'
new_sideset_name = 'side_3'
input = 'extrude'
included_boundaries = 'side'
[]
[bd_3]
type = Boundary2DDelaunayGenerator
input = side_3
boundary_names = 'side_3'
use_auto_area_func = true
[]
[side_4]
type = ParsedGenerateSideset
combinatorial_geometry = 'x>=0&y<0'
new_sideset_name = 'side_4'
input = 'extrude'
included_boundaries = 'side'
[]
[bd_4]
type = Boundary2DDelaunayGenerator
input = side_4
boundary_names = 'side_4'
use_auto_area_func = true
[]
[bd_bot]
type = Boundary2DDelaunayGenerator
input = extrude
boundary_names = '2'
use_auto_area_func = true
[]
[bd_top]
type = Boundary2DDelaunayGenerator
input = extrude
boundary_names = '3'
use_auto_area_func = true
[]
[smg]
type = StitchMeshGenerator
inputs = 'bd_1 bd_2 bd_3 bd_4 bd_top bd_bot'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = '0 0;0 0;0 0;0 0;0 0'
merge_boundaries_with_same_name = true
prevent_boundary_ids_overlap = false
[]
[xyzd]
type = XYZDelaunayGenerator
boundary = smg
desired_volume = 1
output_subdomain_name = 'matrix'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[area]
type = VolumePostprocessor
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = 'FINAL'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_with_holes_2d.i)
[Mesh]
[fmg]
type = FileMeshGenerator
file = 'gold/2d_cube.e'
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = fmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[hole_1]
type = ParsedNodeTransformGenerator
input = fmg
x_function = ".25+.125*x"
y_function = ".25+.125*y"
z_function = ".25+.125*z"
[]
[hole_2]
type = ParsedNodeTransformGenerator
input = fmg
x_function = ".75+.125*x"
y_function = ".75+.125*y"
z_function = ".75+.125*z"
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
holes = 'hole_1
hole_2'
# Let NetGen know interior points are okay
desired_volume = 100000
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
[output]
type = CSV
file_base = 'xyzdelaunay_with_holes_out'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/err_xyzdelaunay_with_holes_mix.i)
[Mesh]
[fmg]
type = FileMeshGenerator
file = 'gold/2d_cube.e'
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = fmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[hole_1_2d]
type = ParsedNodeTransformGenerator
input = fmg
x_function = ".25+.125*x"
y_function = ".25+.125*y"
z_function = ".25+.125*z"
[]
[hole_1]
type = ElementGenerator
input = 'hole_1_2d'
elem_type = TET4
nodal_positions = '0 0 0
0 1 0
1 0 0
0 0 1'
element_connectivity = '0 1 2 3'
[]
[hole_2]
type = ParsedNodeTransformGenerator
input = fmg
x_function = ".75+.125*x"
y_function = ".75+.125*y"
z_function = ".75+.125*z"
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
holes = 'hole_1
hole_2'
# Let NetGen know interior points are okay
desired_volume = 100000
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_smoothed.i)
[Mesh]
[inner_cube]
type = GeneratedMeshGenerator
dim = 3
elem_type = TET4
nx = 1
ny = 1
nz = 1
xmin = -0.4
xmax = 0.4
ymin = -0.4
ymax = 0.4
zmin = -0.4
zmax = 0.4
[]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
[]
[layer_2_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "z+x"
y_function = "y"
z_function = "z-x"
[]
[layer_3_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "3*x"
y_function = "3*y"
z_function = "3*z"
[]
[layer_4_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "4*x"
y_function = "4*y"
z_function = "4*z"
[]
[triang_2]
type = XYZDelaunayGenerator
boundary = 'layer_2_bdy'
holes = 'inner_cube'
stitch_holes = 'true'
desired_volume = 0.1
smooth_triangulation = true
[]
[triang_3]
type = XYZDelaunayGenerator
boundary = 'layer_3_bdy'
holes = 'triang_2'
stitch_holes = 'true'
desired_volume = 0.2
smooth_triangulation = true
[]
[triang_4]
type = XYZDelaunayGenerator
boundary = 'layer_4_bdy'
holes = 'triang_3'
stitch_holes = 'true'
desired_volume = 0.4
smooth_triangulation = true
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
csv = true
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_with_holes_3d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[hole_1]
type = ParsedNodeTransformGenerator
input = gmg
x_function = ".25+.125*x"
y_function = ".25+.125*y"
z_function = ".25+.125*z"
[]
[hole_2]
type = ParsedNodeTransformGenerator
input = gmg
x_function = ".75+.125*x"
y_function = ".75+.125*y"
z_function = ".75+.125*z"
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
holes = 'hole_1
hole_2'
# Let NetGen know interior points are okay
desired_volume = 100000
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
[output]
type = CSV
file_base = 'xyzdelaunay_with_holes_out'
[]
[]