GiD_Info Mesh

This command gives the user information about the selected mesh in the project.

Without arguments it returns 1 if there is mesh, followed by a list with all types of element used in the mesh.

?-pre | -post -step <step>?: To specify to use the preproces or postprocess mesh, and the time step if it changes along the time. (default -pre)

  • NumElements <Elemtype> ?<nnode>?: returns the number of elements of the mesh.

Elemtype can be: Line | Triangle | Quadrilateral | Tetrahedra | Hexahedra | Prism | Pyramid | Point | Sphere | Circle | Any.

nnode is the number of nodes of an element, if this argument is missing the amount does not take into account the number of nodes.

  • NumNodes: Returns the total number of nodes of the mesh.
  • MaxNumElements: Returns the maximum element number.
  • MaxNumNodes: Returns the maximum node number.

  • Elements <Elemtype> ?<first_id>? ?<last_id>? ?-sublist|-array? ?-avoid_frozen_layers? : Returns a list with the element number, the connectivities , radius if it is a sphere, normal if it is a circle, and the material number, from 'first_id' to 'last_id, if they are specified.

  • Nodes ?<first_id>? ?<last_id>? ?-sublist|-array? ?-avoid_frozen_layers?: Returns a list with the node number and x y z coordinates, from 'first_id' to 'last_id', if they are specified

Modifiers:

-sublist : Instead of a plane list it returns each result item as a Tcl list (enclosed in braces)

-array : Instead of a plane list it returs the resuls as a list of vectors (more efficient).

In fact with -array it is returned an 'objarray': a Tcl_Obj object specialized for arrays, implemented as a Tcl package named 'objarray'. (for more information see scripts\objarray\objarray.pdf)

-avoid_frozen_layers : to ignore nodes or elements of frozen layers

  • EmbeddedDistances: Returns a list with 2 items, the objarray of ids of the nodes (integers) and the objarray of distances to the boundary (doubles). This information is only available meshing with embedded mesh type

Examples:

in: GiD_Info Mesh

out: "1 Tetrahedra Triangle"

in: GiD_Info Mesh MaxNumNodes

out: "1623"

set data [GiD_Info Mesh EmbeddedDistances]

lassign $data nodes distances

set length [objarray length $nodes_list]

for {set i 0} {$i < $length} {incr i } {

set node_id [objarray get $nodes $i]

set distance [objarray get $distances $i]

W "$node_id $distance"

}