Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


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.

Note: To print mesh nodes or elements by layers it exists other specialized command: GiD_EntitiesLayers print <layer> nodes|elements ?-element_type <types_allowed>? ?-offset_element_num <offset>? ?-factor <factor>? <format> <channel>


GiD_WriteCalculationFile init|end|puts|coordinates|all_connectivities|connectivities|nodes|elements|has_elements ?-elemtype <etype>? ?-localaxes <formatLADict> ""? ?-elements_faces all|elements|faces? ?-number_ranges <NRDict>? ?-unique? ?-multiple? ?-all_entities? ?-do_subst? ?-sorted? ?-count? ?-return? ?-print_faces_conecs ? -connec_ordering? corner_face_corner_face <groupsDict>

  • 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.e
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"]

...

Code Block
GiD_WriteCalculationFile elements -elemtype Tetrahedra -elements_faces faces [dict create $group_name "element id:%d face index:%d\n"]


Example: to print node id and the local axes (as 3 euler angles) of the nodes belonging to $group_name that have local axis assigned.

Code Block
GiD_WriteCalculationFile nodes -return -localaxes [dict create $group_name "%d Euler1=%.15g Euler2=%.15g Euler3=%.15g\n"] {}