*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.
- 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.
- 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.
"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 - 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).
- 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.
- 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.
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"
or
"tet: tet_opts growth_rate uniform_layers max_size qt_ratio 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).
- 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).
"cfd: cfd_opts bl_thick0 bl_thicktotal bl_growthrate size_trans_flag"
- cfd_opts
- Flags for smooth/native boundary layer meshes.
- 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.
"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.
"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.
- 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.
- 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.
- 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.
"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 (for example, "save_as: \"C:\Program Files\mesh.dat\"").
"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
*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
*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
*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
*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
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.