Output .dat file for only layer of interest

Moderator: GiD Team

Posts: 43
Joined: Thu Jan 26, 2017 5:10 pm

Output .dat file for only layer of interest

Postby awa5114 » Fri Jul 20, 2018 1:33 pm

I have a question regarding the use of layers in GiD.

I have two layers in which I am preparing different geometries with different conditions and materials. I would like to output the .dat file of each layer independently. When I click on calculate it currently outputs a "mix" of both layers. For example if I have 10 nodes in Layer A and 20 nodes in Layer B I get a total of 30 nodes in my output layer. I would like to get only either 10 nodes or 20 nodes, depending on the layer I have selected.

Is this possible to do in GiD? Really what I am looking for is possibility to have multiple boundary problems simultaneously defined in one GiD session. I prefer this over the 1 GiD project - 1 calculation file requirement. I want to be able to generate multiple calculation files for each GiD project.
User avatar
Posts: 1605
Joined: Thu Sep 18, 2014 3:31 pm

Re: Output .dat file for only layer of interest

Postby escolano » Fri Jul 20, 2018 5:11 pm

It is possible to do everything in GiD,

If you are doing a 'classic-problemtype' each .bas template file will create a .dat output file
but you can also write the calculation files with Tcl scripting, raised for example by the GiD-event BeforeWriteCalcFileGIDProject
proc BeforeWriteCalcFileGIDProject { file } {
#do here in Tcl what you want

customLib-like problemtypes are usually writing the calculation file with Tcl scripting, without .bas templates

Classic-problemtypes commonly use interval-data to define separated boundary conditions (e.g. different loads for a structural simulation),
Each GiD interval store its own set of GiD conditions (and interval-data questions)

Related to layers, it is possible to do something with .bas templates, like this to write nodes of each layer
*loop layers
*layernum *layername *layercolorrgb
*loop nodes
*nodesnum *nodescoord
*end nodes
*end layers

but for non-trivial things it is recommended to use Tcl procedures that are much powerful and robust that .bas templates

You can access from Tcl to GiD data with commands like GiD_Info, GiD_Layers, etc.
See GiD help on Customization->TCL AND TK EXTENSION

Return to “Customization”

Who is online

Users browsing this forum: No registered users and 1 guest