Use CustomLib to write node coordinates

Moderator: GiD Team

Post Reply
chanun
Posts: 2
Joined: Wed Jul 17, 2019 1:05 am

Use CustomLib to write node coordinates

Post by chanun »

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,

chanun
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Use CustomLib to write node coordinates

Post by escolano »

Probably is not a good idea to mix the information of the nodes's coordinates and the data of the conditions.
If you are designing this input format and are free to modify it you can re-consider it.

In any case, if the input format cannot be changed:

GiD provide the special command GiD_WriteCalculationFile that allow write the mesh (coordinates, connectivities,...) and also the conditions data by groups, this command is efficient but not always could be used, like your case.

Then you can use the rest of tcl commands that ask GID information, you can manipulate this information (with Tcl lists, arrays, dicts, ...)and then write exactly as you want.
e.g. you can ask the list of nodes coordinates with
GiD_Info Mesh nodes (there are extra flags for some variants)
also you can ask information for a single node with
GiD_Mesh get node $num
can get information about groups and its entities with
GiD_Groups list ...
GiD_EntitiesGroups get ...

The syntax of the GiD-tcl extra commands is explained in the 'GiD customization manual'->TCL AND TK EXTENSION->Special Tcl commands

Note: the XML information of the customLib tree could be asked with tdom standard commands (see PROBLEMTYPE SYSTEM->Access to tree data information)
chanun
Posts: 2
Joined: Wed Jul 17, 2019 1:05 am

Re: Use CustomLib to write node coordinates

Post by chanun »

Thank you for your advice.
Since the input format in my case was fixed, I tried to use the tcl commands to organize my format.
Now, I have successfully made my custom ProblemType with the desired format. Thank you very much.

Regards,

chanun
Post Reply