*element2Dshiftnodes

Reorders the nodes in a 2D element.

Syntax

*element2Dshiftnodes element_id mode shift_value first_node_id second_node_id direction_vector

Type

HyperMesh Tcl Modify Command

Description

Reorders the nodes in 2D elements based on various modes.

Inputs

element_id
The 2D element ID to reorder.
mode
Determines how the nodes are reordered.
  • 1 - Shift the first node by the value given by shift_value.
  • 2 - Shift the first node by the value given by shift_value and reverse the element orientation.
  • 3 - Make first_node_id the first node.
  • 4 - Make first_node_id the first node and reverse the element orientation.
  • 5 - Make first_node_id the first node and second_node_id the second. This may reverse the element orientation.
  • 6 - Find the element’s oriented side closest to the direction of direction_vector and set the first 2 nodes to be this side.
  • 7 - Find the element’s oriented side closest to the direction of direction_vector and set the first 2 nodes to be this side with the reverse orientation.
shift_value
When mode is 1 or 2, this is an integer defining the shift of the element nodes.
first_node_id
When mode is 3, 4 or 5, this defines the first node in the reordered 2D element.
second_node_id
When mode is 5, this defines the second node in the reordered 2D element.
direction_vector
The vector ID closest to the orientation of the element’s first and second nodes. This vector is created with *createvector.

Example

If the original element ID 100 is ordered with nodes 34, 62, 88, 11.

To reorder element ID 100 as 88, 11, 34, 62:
*element2Dshiftnodes 100 1 2 0 0 0
To reorder element ID 100 as 88, 62, 34, 11 (reverse element normal):
*element2Dshiftnodes 100 2 2 0 0 0
To reorder element ID 100 as 62, 88, 11, 34:
*element2Dshiftnodes 100 3 0 62 0 0
To reorder element ID 100 as 62, 34, 11, 88:
*element2Dshiftnodes 100 4 0 62 0 0
To reorder element ID 100 as 88, 62, 34, 11 (in this example it reverses the element normal too):
*element2Dshiftnodes 100 5 0 88 62 0
To reorder element ID 100 such that the two nodes that form a vector that is closest to the selected vector direction will chosen as n1, n2 while maintaining the element’s normal:
*createvector 1 0.0000 1.0000 0.0000
*element2Dshiftnodes 100 6 0 0 0 1
To reorder element ID 100 such that the two nodes that form a vector closest to the selected vector direction will be chosen as n1, n2 (this option may reverse the elements normal):
*createvector 1 0.0000 1.0000 0.0000
*element2Dshiftnodes 100 7 2 0 0 1

Errors

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