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_index <step_index> | -step_value <step_value>? ?-set_name <set_name>?:
-pre | -post: To specify to use the preproces or postprocess mesh (default -pre).
-step_index <step_index> | -step_value <step_value>:In post can specify time step if the mesh changes along the time (by default the current time step is assumed)
Must set only -step_index <step_index> or alternatively -step_value <step_value>, but not both.
the <step_index> is an integer starting from 0 (a special value all is valid and mean 'all steps' for some options)
the <step_value> is a double value representing the value of the time step.
-set_name <set_name>: for Elements of post is optional specify -set_name <set_name> to get only the elements of this set, in case that more than one.
- 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|-array2? ?-avoid_frozen_layers? ?-layer <layername>? ?-group <groupname>? ?-orphan?
Returns a list with the element numbers, 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.
Note: in -post case it return a list of items, one item by set, of the required element type, and each item is a sub-list with the data related previously (number connectivities ?radius? ?normal? material)
- Nodes ?<first_id>? ?<last_id>? ?-sublist|-array|-array2? ?-avoid_frozen_layers? ?-layer <layername>? ?-group <groupname>?: 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 flat list it returns each result item as a Tcl list (enclosed in braces)
-array : Instead of a flat list it returns the results as a list of objarrays (more efficient).
For 'Nodes' it returns a list with 1 objarray for the NodeIDs and a list with 3 objarrays: the X coordinates, the Y coordinates and the Z coordinates.
For 'Elements' it returns a list with the element type, an objarray with the element id's, a list with an objarray for each node of the connectivity (i.e. for a triangle an objarray for all node1, another for the node2 and another for the node3), and an objarray for the material id of the elements.
-array2 : Instead of a flat list it returns the results as a list of objarrays (more efficient).
For 'Nodes' it returns a list with 2 objarrays: one for the NodeIDs and another for the xyz coordinates.
For 'Elements' it returns a list with the element type, an objarray with the element id's, an objarray for all the connectivities (i.e. for a triangle an objarray with node1-node2-node3-node1-node2-node3), and an objarray for the material id of the elements.
An 'objarray' is a Tcl_Obj object specialized for arrays, implemented as a Tcl package named 'objarray'. (for more information see the local file <GiD>/scripts/objarray/objarray.pdf)
-avoid_frozen_layers : to ignore nodes or elements of frozen layers
-layer <layername> : to get only nodes of element of this layer
-group <groupname> : to get only nodes of element of this group
-orphan : for elements only, to get elements that do not belong the the mesh of any geometrical entity
- 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"
}
Example 2:
Mesh with
node_id x_coord y_coord z_coord
1 0.0 1.0 0.0
2 1.0 1.0 0.0
3 0.0 0.0 0.0
4 1.0 0.0 0.0
element_id node1 node2 node3 material
1 3 4 1 0
2 1 4 2 0
GiD_Info Mesh nodes -> 1 0.0 1.0 0.0 2 1.0 1.0 0.0 3 0.0 0.0 0.0 4 1.0 0.0 0.0 GiD_Info Mesh nodes -sublist -> {1 0.0 1.0 0.0} {2 1.0 1.0 0.0} {3 0.0 0.0 0.0} {4 1.0 0.0 0.0} GiD_Info Mesh nodes -array -> {1 2 3 4} {{0.0 1.0 0.0 1.0} {1.0 1.0 0.0 0.0} {0.0 0.0 0.0 0.0}} GiD_Info Mesh nodes -array2 -> {1 2 3 4} {0.0 1.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0} GiD_Info Mesh elements triangle -> 1 3 4 1 0 2 1 4 2 0 GiD_Info Mesh elements triangle -sublist -> {1 3 4 1 0} {2 1 4 2 0} GiD_Info Mesh elements triangle -array -> {Triangle {1 2} {{3 1} {4 4} {1 2}} {0 0}} GiD_Info Mesh elements triangle -array2 -> {Triangle {1 2} {3 4 1 1 4 2} {0 0}}