...
Note: This command is provided to allow efficiency and relative flexibility writing the mesh and tree data related to groups, traversing the data structures without the cost of create a serialized copy in memory.
It is not compulsory to use this command, it is possible, and sometimes necesarynecessary, to use other Tcl commands to get mesh, groups and other data and reorder the information in order to be written.
...
- GiD_WriteCalculationFile init ?-mode append? ?-encoding external|utf-8? <filename>
To open for writting writing the calculation file.
Before to print any information to the file it must be opened with this command. Next prints of GiD_WriteCalculationFile will use implicilty implicitly this opened channel.
GiD internal strings are utf-8 codified,
-encoding external : (default) strings to print are converted to the current external encoding.
-encoding utf-8: strings are not converted.
It returns an file identifier that could be used with with 'GiD_File fprintf', but must not be used with Tcl standard print commands like 'puts' or 'write'
...
To get entities information related to groups: connectivities, nodes, elements of the group names specified in the <groupsDict> dictionary
for connectivities it prints the element number and its connectivities
for nodes it prints the node number and optionally (if the provided format expect it) its x y z real coordinates. If -factor <factor> is provided the coordinates are multiplied by this real number (used for units)
for elements it prints the element number (for element faces prints element numer number and face number, element from 1, face from 0)
...
Example: to print the faces of tetrahedra belonging to $group_name, printing its 3 face node ids (the %.0s is to not pring print the tetrahedra id)
Code Block |
---|
GiD_WriteCalculationFile elements -elemtype Tetrahedra -elements_faces faces -print_faces_conecs [dict create $group_name "%.0snode ids: %d %d %d\n"] |
...