hm_getmeshvolumesinfo
Returns the number of volumes and lists containing the element IDs and volume indices for each input element.
Syntax
hm_getmeshvolumesinfo mark_id mode
Type
HyperMesh Tcl Query
Description
This command returns the number of volumes and multiple lists containing the element IDs and volume indices for each input element.
Inputs
- mark_id
- The mark of elements to find volumes for. Valid values are 1 and 2.
- mode
- 0: internal voids considered as "voids" and do not make a new volume
The output from this command is in the following format:
{n} {elem_id1 volume_i1 volume_j1} {elem_id2 volume_i2 volume_j2} ...
{n} – The number of identified volumes.
{elem_id volume_i volume_j} – List containing the ID of the shell element and a pair of volumes of corresponding element sides. The first volume (i) corresponds to the volume on the shell element side with normal pointing out. A volume of 0 represents free space (no volume).
If 0 volumes are detected, only {n} is returned.
Example
To orient all shell elements so that the normal points toward the inside of the volume with the smallest ID (or inside if there is only one volume):
*createmark elements 1 displayed
set volumes_list [hm_getmeshvolumesinfo 1 0]
set num_volumes [lindex $volumes_list 0]
set volumes_list [lreplace $volumes_list 0 0]
set reverse_list""
foreach elem $volumes_list{
set elemid [lindex $elem 0]
set vol1 [lindex $elem 1]
set vol2 [lindex $elem 2]
if {$vol1 > $vol2} {
lappend reverse_list $elemid
}
}
if { [llength $reverse_list ] } {
*clearmark elements 2
eval *createmark elements 2 $reverse_list
eval *normalsreverse elements 2 1.e-10
*clearmark elements 2
}
Errors
if { [ catch {command_name...} ] } {
# Handle error
}
Version History
9.0