*tetmesh

Creates tetra meshes and CFD tetra meshes (with boundary layers).

Syntax

*tetmesh entity_type1 mark_id1 mode1 entity_type2 mark_id2 mode2 string_array number_of_strings

Type

HyperMesh Tcl Modify Command

Description

A general single tetra mesh operation can involve a command block consisting of zero or more calls to *tetmesh_set_input followed by one call to *tetmesh. *tetmesh can take up to two different entity input/selections and *tetmesh_set_input supplies additional entity selections (up to four more) to *tetmesh.

The following discussion applies to the entire tetra mesh command block.

In the command argument list each triplet entity_type mark_id mode specifies a set of entity input that either define a part of the boundary of the meshing volumes or the element size control boxes.

An entity input with mark_id as 0 or mode as -1 is considered an inactive input. Inactive inputs are ignored inside the commands. However, for an inactive input, entity_type still must be a valid entity name. An input can be empty and still active. An empty active input with mode 6 will be auto filled internally.

If there are inputs with mode 2 or 3, the resulting mesh is called a CFD mesh. Otherwise, it is called a non-CFD mesh.

Also, note that not all combinations of the triplet values are valid. The general rules for all active entity inputs and the internal handling of these inputs are as follows and all must be satisfied:
  • Must have at least one active input.
  • Up to 7 inputs can be used but, each active mode value can appear no more than once.
  • Modes 0, 1, 2, 3 and 6 are for boundary inputs of the meshing volumes. For these modes, inputs with entity_type as elems or comps are boundary inputs by elems; inputs with entity_type as solids or surfs are boundary inputs by geoms. All boundary inputs must be either all by elems or all by geoms.
    • For an input by elems with modes 0, 2 and 3, all elems other than 2D elems are ignored.
    • For an input with mode 1, both 1D (plotel) and 2D elems are acceptable. In this case, 1D elems specify the elem edges that must appear in the final mesh.
    • For an input with mode 6, all elems other than 3D elems are ignored.
  • For inputs by geoms, all surfs without a pre-existing mesh are treated as float regardless of the mode of input. Internally, these surfs are auto-meshed with the 2D meshing parameters passed in through the string_array argument.
  • There can be no more than one input with entity_type as solids. That is, if there is one solids input, all other boundary inputs must have entity_type as surfs. It is further required that all these surfs selections are on the selected solids (other surfs are silently ignored).
  • For mode 4, entity_type must be comps. The selected entities must be the specially constructed components for size control boxes (others are silently ignored).
  • For mode 5, entity_type must be nodes. The nodes that are too close to other anchor nodes or that are outside of the meshing volumes or too close to the boundary of the meshing volumes are ignored.
  • For an input with mode 6, all boundary inputs must be by elems. All other boundary inputs are considered as 2D baffles (and 1D constraints). An empty input with mode 6 will be auto filled internally by the inputs of baffles (modes 0, 1, 2 and 3), size control boxes (mode 4) and anchor nodes (mode 5). Otherwise, all entities with input modes 0-5 that fall outside of the 3D selection or too close to the boundary of the 3D selection are ignored.
  • If a single command has two active entity inputs, the mark_ids must be different.
  • Inputs with different modes are allowed to have overlapping selections. The overlaps are resolved inside the command. The general rule is that the input in an earlier command has the higher priority; while within a command the later input has the priority. If an input has ent=solids, it always has the lowest priority regardless its position in the input order.

Inputs

entity_type1
The first entity type. Valid values are nodes, elems, comps, surfs, and solids.
mark_id1
The mark ID containing the first entities. Valid values are 0 (inactive input), 1 and 2.
mode1
  • -1 - Ignored (inactive input)
  • 0 - Float without boundary layer
  • 1 - Fixed without boundary layer
  • 2 - Float with boundary layer
  • 3 - Fixed with boundary layer
  • 4 - Size control boxes
  • 5 - Anchor nodes
  • 6 - 3D re-mesh
  • 7 - 3D re-mesh with free boundary swappable-float.
  • 8 - 3D re-mesh with free boundary remeshable-float.
  • 9 - Remeshable-float without BL
  • 10 - Remeshable-float with BL,
  • 11 - Elem input for fluid volume selection. Either touched (or normal pointed into) are fluid volumes.
Note: If one of the float inputs is set to remeshable by either a mode listed above or by the "shell_remesh" parameter in the "pars:…" string, all float inputs are set to remeshable. Otherwise, all floats are swappable only except for the non-BL input that receives BL imprinting.
entity_type2
The second entity type. Valid values are nodes, elems, comps, surfs, and solids.
mark_id2
The mark ID containing the second entities. Valid values are 0 (inactive input), 1 and 2.
mode2
  • -1 - Ignored (inactive input)
  • 0 - Float without boundary layer
  • 1 - Fixed without boundary layer
  • 2 - Float with boundary layer
  • 3 - Fixed with boundary layer
  • 4 - Size control boxes
  • 5 - Anchor nodes
  • 6 - 3D re-mesh
  • 7 - 3D re-mesh with free boundary swappable-float.
  • 8 - 3D re-mesh with free boundary remeshable-float.
  • 9 - Remeshable-float without BL
  • 10 - Remeshable-float with BL,
  • 11 - Elem input for fluid volume selection. Either touched (or normal pointed into) are fluid volumes.
string_array
The ID of the string array that contains the array of meshing parameters. The string array is created using the *createstringarray command. This should always be set to 1.
Each argument can be either space or comma separated.
There are 6 types of strings which can be passed, as indicated below. Different combinations of these strings can be passed, based on the specific meshing requirements.
Options for checking the validity of the input mesh:
"shchk: mode prox_tol angle_tol"
At least one of the two entity inputs needs to be filled. The check functionality takes only elems or comps as input and only shell elems are considered. If only one input is filled, the check is a "self" check, that is, all elements causing interference are collected. If both inputs are non-empty, the check is a "mutual" check, that is, an interference pair is collected only if it involves both inputs.

The message bar provides a brief view of what is detected. For example:

32790 elems:x=34698 pairs, prx=168@0.001/min1.91e-7, angle=3@0.5, dups=0 on 0
  • 32790 elems - Input has 32790 shell elements
  • x=34698 pairs - Found 34689 self-intersecting element pairs
  • prx=168@0.001/min1.91e-7 - Found 168 proximiy element pairs for threshold distance 0.001 with the worst being 1.91e-7
  • angle=3@0.5,min0.01 - Found 3 elem pairs having dihedral angle < 0.5 degrees, with the worst being 0.01 degrees
  • dups=45 on 10 - Found 45 duplicated shell element pairs involving a total of 10 shell elements
mode
Tetra mesh options. Bit values are used and the value is calculated as (Bit0_Bit1 + 16*Bit4 + 32*Bit5).
Bit0_Bit1: Volume analysis:
  • 0 - Reserved
  • 1 - Do per-volume check after analyzing volumes using inward-positive orientation (inside is positive). It is an error if the input does not form volumes. For proximity, proximities on the positive side are collected. For dihedral angle, as orientation is used, an angle "A" is distinct from "360-A" ( as opposed to without orientation value=3, "A" is equivalent to "360-A").
  • 2 - Do not analyze volumes, but element normal is used. To have the orientation meaningful, user needs to adjust the input to a consistent normal before doing the check here (for orientation effect, see the per-volume check above).
  • 3 - Do not analyze volumes and do not use orientation . Two sides of each element are treated equally.
Bit4: Collection options. The specially names are:
  • ^err_x_elems - Elements having self-intersections
  • ^err_prx_elems - Elements having failing proximity (no self-intersection)
  • ^err_agl_elems - Elements having failing dihedral angle
Note: Each comp or set can only collect the same element once. That is, all pair info are lost.
  • 0 - Detected elements are duplicated in specially named comps (red color)
  • 1 - Detected elements are pladed in specially named sets
Bit5: Group-by cluster options:
  • 0 - Do not further classify detections by cluster
  • 1 - Further classify detections by clusters. A cluster is a set of elements related by adjacency and interference pairing. With this option, each cluster has its own comp or set having the name appended with _<cluster_id> (e.g. ^err_x_elems_2.
prox_tol
A threshold value for proximity detection. Input elements having a distance to other input elements less than this value are collected in comps or sets depending on mode. Two elems may have proximity only if they do not share an edge, and at least one is in the forward (or backward) cone of the other. The shape of the cone is defined internally.
< 0.0 - Proximity detection is disabled
= 0.0 - Detect only self-intersection
> 0.0 - Detect both self-intersection and proximity
angle_tol
A threshold value for dihedral angle detection. Input elements having a diheral angle to other adjacent input elements less than this value are collected in comps or sets depending on mode.
< 0.0 - Angle detection is disabled
Tetra meshing parameters that control the tetra core part of the mesh. This is required for all meshing types:
"tet: tet_opts growth_rate uniform_layers max_size qt_ratio min_size min_height"
tet_opts
Tetra mesh options. Bit values are used and the value is calculated as (Bit0_Bit1_Bit2 + Bit5_Bit6_Bit7 + 256*Bit8).
Bit0_Bit1_Bit2: Core tetra mesh and optimization method.
  • 0 - Unused.
  • 1 - Normal.
  • 2 - Optimize for performance.
  • 3 - Optimize for quality.
  • 4 - Generate boundary layer only. Valid only if there are boundary layer inputs.
Bit5_Bit6_Bit7: Quad transition settings. Used only if there are fixed quad inputs.
  • 0 - Keep quads as-is. Only valid for BL only mode.
  • 32 - Build a layer of 1 pyramid per quad transition.
  • 64 - Build a layer of 5 pyramids and 2 tetras per quad transition.
  • 96 - BL hexas are split into prisms for all layers.
  • 128 - BL elems are split into tetras for all layers.
Bit8: Elems-to-geometry flag. Effective only for non-CFD meshes with inputs by geoms. For CFD mesh, the elems are always placed in fixed comps with special names. For all other cases, elems go to the current comp.
  • 0 - Elements to current component.
  • 256 - Elements to geometry component.
Bit10: Fix midnodes flag. The method of optimazing the midnode of 2nd order tets that are on surfaces.
  • 0 - Surface midnodes are allowed to move to an optimazed location.
  • 1024 - Surface midnodes will be made fixed (no relocation).
growth_rate
The tetra mesh elem size growth rate for the boundary (typical 1.2, range >1.0).
uniform_layers
The number of tetra layers that are to have uniform elem sizes (typical 2.0, range >0).
max_size
The limit on the max elem size. A value of 0.0 means no limit (typical 0.0).
qt_ratio
Affect only the quad transition layer. This determines the layer height as a fraction of the local 2D elem size (typical 0.8).
min_size
The nominal lower bound for the element size. A value of 0.0 means not bounded (typical 0.0).
min_height
The minimal element height. A value of 0.0 means not bounded (typical 0.0).
If not specified, the command behaves as if this capability was not implemented.
CFD boundary layer meshing parameters. This is only required if one or more boundary selections are of mode=2 or mode=3:
"cfd: cfd_opts bl_thick0 bl_thicktotal bl_growthrate size_trans_flag"
cfd_opts
Flags for smooth/native boundary layer meshes.
Bit0: Split mode. Effective only for native boundary layers or when size_trans_flag=1.
  • 0 - All 3D non-tetra elems are split into tetras.
  • 1 - Prism and pyramid elems in the boundary layer are not split into tetras.
Bit1: The main boundary layer mode.
  • 0 - Native boundary layer method is used.
  • 2 - Smooth boundary layer method is used.
Bit2-Bit3: Boundary layer total thickness mode. Effective only for smooth boundary layer method.
  • 0 - bl_thicktotal specifies the total boundary layer thickness.
  • 4 - bl_thicktotal specifies the total number of boundary layers.
  • 8 - bl_thicktotal specifies the ratio of the total boundary layer thickness over the average input elem size.
Bit4: Non-boundary layer remesh mode. Effective only for smooth boundary layer method.
  • 0 - The float non-boundary layer inputs that intersect the boundary layer elems are morphed to accommodate the boundary layers.
  • 32 - The float non-boundary layer inputs that intersect the boundary layer elems are imprint-remeshed to accommodate the boundary layers.
Bit5: Distribute boundary layer thickness mode. Effective only for smooth boundary layer method.
  • 0 - No special boundary layer thickness distribution.
  • 64 - The special load comp ^CFD_BL_Thickness is used to extract the boundary layer thickness reduction ratio distribution. Note that this component needs to be pre-constructed with either the auto or manual boundary layer thickness generation utilities.
Bit7: Special comp cleanup mode. Effective only for smooth boundary layer method.
  • 0 - Do not delete elements in special CFD_boundary_layer and CFD_tetramesh_core components first.
  • 128 - Delete elements in special CFD_boundary_layer and CFD_tetramesh_core components first.
Bit8: Determines if multiple normals should be used for baffle edges or inward sharp edges that are sharper than a given threshold angle. This threshold angle is 1.5 degrees by default and can be reset byunoffsettable_angle in the "pars:…" string below.
  • 0 - Collapse BL for nodes on the baffle edges and inward-sharp edges.
  • 256 - Use multiple normals (currently 2) per node on the baffle edges and inward-sharp edges so to generate a wrapping BL around them.
bl_thick0
The first layer thickness.
bl_thicktotal
Either the total boundary layer thickness, or the number of layers, depending on cfd_opts. Effective only for the smooth boundary layer method.
bl_growthrate
The boundary layer growth rate (typical 1.1, range >1.0).
size_trans_flag
The boundary layer to tetra core elem size transition mode. Effective only for smooth boundary layer method. If set to 1, the boundary layer heights are smoothly transitioned to the core elem size whenever possible. In rare situations where the smooth boundary layer is unable to be built for some baffle elems, activation of this mode may cause meshing failures.
For elem size control box:
"size_ctrl: x1 y1 z1 x2 y2 z2 … x8 y8 z8"
This string contains 25 double numbers and inputs a single size control box. Note, a size control box can be input also using components that are specially pre-constructed for size control boxes (see *tetmesh_create_size_ctrl). The first 24 numbers above consist of 8 triplets that each defines the 3d coordinates of a corner of the control box. The corners are ordered the same as an hm hex element. The last number is the target element size for elems inside and near the box.
For the 2D auto meshing parameters, which are used for meshing unmeshed input surfaces. This is required only for meshing by geometries:
"2d: elem_order elem_type mesh_type elem_size min_size max_angle use_existing_mesh"
elem_order
The element order. Should be the same as the global elem order setting. Valid values are 1 and 2.
elem_type
The element type. Valid values are:
  • 0 - trias
  • 1 - quads
  • 2 - mixed
  • 3 - R-trias
  • 4 - quads only
mesh_type
The mesh type. Valid values are:
  • 1 - No chordal and no curvature and no proximity
  • 2 - Chordal and no curvature and no proximity
  • 3 - No chordal and no curvature and proximity
  • 4 - Chordal and curvature and proximity
  • 5 - Chordal and curvature and no proximity
elem_size
The 2D element size.
min_size
The minimum element size.
max_angle
The feature angle in degrees (typically 30).
elem_size
  • 0 - Recreate 2D mesh on input surfaces even if there is an existing mesh
  • 1 - Create 2D mesh only on the input surfaces that do not have an existing mesh (default)

Other meshing parameters that either aren't categorized, or are less used. Pairs are separated by either a space or a comma. In general a key may have a default off-value and a default on-value. When a key is not present in the "pars..." string, it assumes the default off-value; while when the key is in the "pars:…" string without the "=value" part, it assumes the default on-value. Note also, not all keys have default on-values. In this case the "=value" part is mandatory.

"pars: key1=value1 key2=value2 …"
aft/delauney/octree
  • aft - Node insertion based on the legacy advancing front method.
  • delauney - Node insertion based on the Delauney method (default if not specified).
  • octree - Node insertion based on the octree method.
Integer value parameters:
auto_cfd_bc
If on, the floating input shell elements will be updated by the corresponding faces of resulting solid elements.
  • 0 - Do not reclassify interfacial input elements (default off)
  • 1 - All interfacial input elements between meshing fluid volumes are auto reclassified as float non-BL input regardless of how they are specified on input (default on)
bdr_iso_lyrs
  • 0 - Do not create isotropic layered mesh (default off)
  • 1 - Create isotropic layered mesh (default on)
feature_angle
Valid only if skip_aflr3 is on. The feature angle to use for tet mesh optimization.
fill_void
Determines if auto-detected voids are to be meshed.
  • 0 - No fill (default off)
  • 1 - Fill (default on)
fix_comp_bdr
Preserves the boundary between input components.
  • 0 - Do not preserve (default off)
  • 1 - Preserve (default on)
fix_top_bdr
Valid only if skip_aflr3 is on.
  • 0 - Node-wide (as opposed to topologically) preserve the surface boundary while doing tet mesh optimization (default off)
  • 1 - Topologically (as opposed to node-wise) preserve the surface boundary while doing tet mesh optimization (default on)
niter
Valid only if skip_aflr3 is on. The max iterations to use for tet mesh optimization. Must be a value >= 0. The default off is 0 and there is no default on value.
nlayer_tet
The minimum number of tetra mesh layers, >= 1 (default 1).
no_tetra_has_2btri
  • 0 - Do not prevent any resulting tetra from having more than one face on a boundary (default off)
  • 1 - Prevent any resulting tetra from having more than one face on a boundary (default on)
post_cln
If on, if tet meshing fails, the shell elements are checked and cleaned before tet meshing is retried.
  • 0 - Do not clean after tet failure (default off)
  • 1 - Clean after tet failure (default on)
pre_cln
If on, input shell elements are checked and cleaned before tet meshing.
  • 0 - Do not clean (default off)
  • 1 - Clean (default on)
shell_remesh
  • 0 - Swap only (default off)
  • 1 - Float input can be remeshed (default on)
shell_swap
Valid only if skip_aflr3 is on. The input triangles are swappable only while doing tet mesh optimization.
shell_validation
  • 0 - Do not check shell validity before tet meshing (default off)
  • 1 - Check shell validity before tet meshing (default on)
skip_aflr3
  • 0 - Do not skip AFLR3 (default off)
  • 1 - Skip AFLR3 (default on)
upd_shell
If on, the floating input shell elements will be updated by the corresponding faces of resulting solid elements.
  • 0 - Do not update float shells (default off)
  • 1 - Update float shells (default on)
task
  • 0 - Normal run (default off)
  • 1 - Initial tetra Delaunay, only an initial tetra Delaunay mesh with minimum insertion of nodes will be created. The inserted nodes are only for the purpose of a successful recovery of the boundary shell.
  • 64 - Generate a convex hull of inputs.
Double value parameters:
bl_core_r
The dynamic BL thickness reduction parameter for avoiding BL collisions. Valid values are:
  • 1.0 - Disabled (default off value).
  • > 0.0 - Enabled with the specified value as the thickness ration of the tetcore thickness vs the BL thickness.
bl_corer_r
The dynamic BL thickness reduction parameter for sharp corners for avoiding BL collisions. Valid values are 1.0 >= value > 0.0. The default off value is 0.3.
  • 1.0 - Disabled (default off value).
  • > 0.0 - Enabled with the specified value as the thickness ration of the tetcore thickness vs the BL thickness.
bl_int_lyrs
The initial number of BL layers that are to be interpolated, instead of done by smoothing layer-by-layer. A value >= 0.0, with a default off value of 0.0.
bl_iter_max
The max BL per layer smooth interations, between 0.0 and 3000. 0.0 means auto-calculate. The default off value is 0.0.
bl_res_thr
The BL smooth relative residue convergence criteria, between 0.0 and 1.0. At any smooth iteration, if the worst relative residue is below this value, smoothing is performed. 0.0 means auto-calculate. The default off value is 0.002.
unoffsettable_angle
A threshold angle in degrees, between 0.0 and 45.0. An element edge is classified as inward-sharp if the inward-dihedral angle is sharper than this threshold. Baffle edges are always considered as sharp edges. BL on a sharp edge is handled either by BL node collapsing or BL wrapping by multiple normals per node depending on bit 8 of cfd_flags options in the "cfd:…" string. The default off value is 1.5.
shell_dev=<off geom>,<along geom>
Defines the optional allowed deviation off and along the "geometry" while improving tet quality. A typical value might be shell_dev=0.01,0.1.
Quality parameters, any combination can be used:
aspect
Aspect ratio. Range > 1.0, typical is 8.0.
cell_squ
Cell squish. Range [0-1.0], typical is 0.9.
skew
Skew. Range > 0.0, typical is 60.
stretch
SimLab stretch criteria=sqrt(R/Lmax) where R is the radius of the inscribed sphere and Lmax is the longest tet edge. For an equilateral tet, stretch is 1. Range [0-1.0], typical is 0.1.
tet_clps
Tet collapse. Range [0-1.0], typical is 0.1.
vol_ar
Volumetric aspect ratio. Range > 1.22, typical is 8.0.
vol_skew
Volumetric skewness. Range [0-1.0], typical is 0.95.
For saving mesh to file. This string is optional and it is mainly for large model handling. When this string exists, the resulting mesh will not be created on the HM database. Instead, it will be written directly to the indicated file in Nastran format.
"save_as: file_path"
file_path
The file path to save the mesh. If the path has spaces, it should be double quoted by \" pairs (e.g. "save_as: \"C:\Program Files\mesh.dat\"").
For advanced control of tetra meshing core. These parameter values take precedence over those defined by the tetra meshing string. Each name/value pair must be a proper parameter string name/value pair as defined in AFLR3.
"aflr3_int: str_name1 int1 …"
"aflr3_dble: str_name1 double1 …"
"aflr3_str: str_name1 str_value1 …"
number_of_strings
Integer indicating the size (number of strings) in the string array created using *createstringarray.

Examples

Tetra mesh:
*createstringarray 1 "tet: 579 1.2 2 0 0.8 0 0"
*createmark comps 2 "inlet" "outlets" "wall" "wall_cyl"
*tetmesh comps 2 0 elems 0 -1 1 1
Tetra re-mesh with fixed baffles:
*createstringarray 1 "tet: 579 1.2 2 0 0.8 0 0"
*createmark comps 2 "some_3d_elems"
*createmark comps 1 "some_baffle_elems"
*tetmesh comps 2 6 comps 2 0 1 1
Tetra mesh by geometries:
*createstringarray 2 "tet: 547 1.2 2 0 0.8 0 0" "2d: 1 0 1 4 0.8 30"
*createmark solids 1 4 5
*tetmesh solids 1 1 elems 0 -1 1 2
CFD mesh:
*createstringarray 2 "tet: 579 1.2 2 0 0.8 0 0" "cfd: 86 0.2 1 1.2 0"
*createmark comps 2 "inlet" "outlets"
*createmark comps 1 "wall" "wall_cyl"
*tetmesh comps 2 0 comps 1 2 1 2

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

11.0

2017.1 - Added aft/delauney/octree values for the pars string.

2020 - Added new parameter min_height to the tet string.

2020.1 - Added new parameter shell_dev to the pars string. The tet string parameters max_size, min_height, and min_size are now active optimization targets, instead of just passive split constraints. Multiple criteria are now allowed for regular tetra meshing.