Output .dat file for only layer of interest

Moderator: GiD Team

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

Output .dat file for only layer of interest

Post by awa5114 »

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
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Output .dat file for only layer of interest

Post by escolano »

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
*if(layernum==nodeslayernum)
*nodesnum *nodescoord
*endif
*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
Post Reply