Use CustomLib to write node coordinates?

Moderator: GiD Team

OwenJoseph
Posts: 1
Joined: Tue Aug 18, 2020 9:45 am

Use CustomLib to write node coordinates?

Postby OwenJoseph » Tue Aug 18, 2020 9:46 am

Hi,
I have successfully created my ProblemType using CustomLib, but have a problem with input file format.
However, my exe file needs the input file of which node coordinates and node conditions (e.g. constraints) are written in the same lines.
Is it possible for CustomLib to write node coordinates and node conditions in the same lines?
In the manual, to write node conditions, I saw only customlib::WriteNodes command which does not tell how to write node coordinates.

Regards
User avatar
escolano
Posts: 1699
Joined: Thu Sep 18, 2014 3:31 pm

Re: Use CustomLib to write node coordinates?

Postby escolano » Tue Sep 01, 2020 3:18 pm

Probably is a bad idea to write in the same line the data of the condition and the x y z of the node (in case of condition over nodes).
It is better to write the data of the condition and the node id (to avoid repeat multiple times x y z and to know the node linked to the condition, not only its spatial location)

In any case GiD_WriteCalculationFile is the main GiD-Tcl command to write, in an efficient way, the customlib data (tree data related to groups of entities)

It is specialized to print to file the data of a loop of mesh nodes (node id and x y z coordinates), mesh elements of some type (element id and its node ids), or loop of nodes or elements of a group

procs like customlib::WriteCoordinates or customlib::WriteNodes are convenience procs to simplify its use for simple common cases, and rely on GiD_WriteCalculationFile.

In case of require print more special formats, e.g. somehow combine data of more of one group, must collect the information you want with Tcl commands like GiD_Groups, GiD_Info mesh, etc, reorder as you want with Tcl scripting, and print it directly to the output file with
GiD_WriteCalculationFile puts ?-nonewline? $string
This won't be as efficient for big models, because is necessary to do loops over a lot of entities, store in memory a lot of data, but allow to do what you want.

Return to “Customization”

Who is online

Users browsing this forum: No registered users and 1 guest