GiD - The personal pre and post processor

*set

*set. This command has the following purposes:

  • *set cond: To set a condition.
  • *set layer "layer name" *nodes|elems: To set a layer.
  • *set group "group name" *nodes|elems|faces: To set a group. (inside a *loop groups can use *GroupName as "group name" ,to get the name of the group of the current loop)
  • *set elems: To indicate the elements.
  • *set var: To indicate the variables to use.


It is not necessary to write these commands in lowercase, so *Set will also be valid in all the examples.


*set cond

In the case of the conditions, GiD allows the combination of a group of them via the use of *add cond. When a specific condition is about to be used, it must first be defined, and then this definition will be used until another is defined. If this feature is performed inside a loop over intervals, the corresponding entities will be chosen. Otherwise, the entities will be those referred to in the first interval.


It is done in this way because when you indicate to the program that a condition is going to be used, GiD creates a table that lets you know the number of entities over which this condition has been applied. It is necessary to specify whether the condition takes place over the *nodes, over the *elems or over *layers to create the table.


So, a first example to check the nodes where displacement constraints exist could be:

*Set Cond Volu-Cstrt *nodes
*Add Cond Surf-Cstrt *nodes
*Add Cond Line-Cstrt *nodes
*Add Cond Poin-Cstrt *nodes

These let you apply the conditions directly over any geometric entity.


*Set Layer


*Set Layer "layer name" *elems|nodes
*Add Layer "layer name"
*Remove Layer "layer name"
This command sets a group of nodes. In the following loops over nodes/elements with the modifier *OnlyInLayer, the iterations will only take place over the nodes/elements of that group.


Example 1:

*set Layer example_layer_1 *elems
*loop elems *OnlyInLayer
Nº:*ElemsNum Name of Layer:*ElemsLayerName Nº of Layer :*ElemsLayerNum
*end elems


Example 2:

*loop layers
*set Layer *LayerName *elems
*loop elems *OnlyInLayer
Nº:*ElemsNum Name of Layer:*ElemsLayerName Nº of Layer :*ElemsLayerNum
*end elems
*end layers

In this example the command *LayerName is used to get the layer name.


There are some modifiers available to point out particular specifications of the conditions.


If the command *CanRepeat is added after *nodes or *elems in *Set cond, one entity can appear several times in the entities list. If the command *NoCanRepeat is used, entities will appear only once in the list. By default, *CanRepeat is off except where one condition has the *CanRepeat flag already set.


A typical case where you would not use *CanRepeat might be:

*Set Cond Line-Constraints *nodes

In this case, when two lines share one endpoint, instead of two nodes in the list, only one is written.
A typical situation where you would use *CanRepeat might be:

*Set Cond Line-Pressure *elems *CanRepeat

In this case, if one triangle of a quadrilateral has more than one face in the marked boundary then we want this element to appear several times in the elements list, once for each face.


Other modifiers are used to inform the program that there are nodes or elements that can satisfy a condition more than once (for instance, a node that belongs to a certain number of lines with different prescribed movements) and that have to appear unrepeated in the data input file, or, in the opposite case, that have to appear only if they satisfy more than one condition. These requirements are achieved with the commands *or(i,type) and *and(i,type), respectively, after the input of the condition, where i is the number of the condition to be considered and type is the type of the variable (integer or real).


For the previous example there can be nodes or elements in the intersection of two lines or maybe belonging to different entities where the same condition had been applied. To avoid the repetition of these nodes or elements, GiD has the modifier *or, and in the case where two or more different values were applied over a node or element, GiD only would consider one, this value being different from zero. The reason for this can be easily understood by looking at the following example. Considering the previous commands transformed as:

*Set Cond Volu-Cstrt *nodes *or(1,int) *or(2,int)
*Add Cond Surf-Cstrt *nodes *or(1,int) *or(2,int)
*Add Cond Line-Cstrt *nodes *or(1,int) *or(2,int)
*Add Cond Poin-Cstrt *nodes *or(1,int) *or(2,int)


where *or(1,int) means the assignment of that node to the considered ones satisfying the condition if the integer value of the first conditions' field is different from zero, and (*or(2,int) means the same assignment if the integer value of the second conditions' field is different from zero). Let us imagine that a zero in the first field implies a restricted movement in the direction of the X-axis and a zero in the second field implies a restricted movement in the direction of the Y-axis. If a point belongs to an entity whose movement in the direction of the X-axis is constrained, but whose movement in the direction of the Y-axis is released and at the same time to an entity whose movement in the direction of the Y-axis is constrained, but whose movement in the direction of the X-axis is released, GiD will join both conditions at that point, appearing as a fixed point in both directions and as a node satisfying the four expressed conditions that would be counted only once.


The same considerations explained for adding conditions through the use of *add cond apply to elements, the only difference being that the command is *add elems. Moreover, it can sometimes be useful to remove sets of elements from the ones assigned to the specific conditions. This can be done with the command *remove elems. So, for instance, GiD allows combinations of the type:


*Set Cond Dummy *elems
*Set elems(All)
*Remove elems(Linear)

To indicate that all dummy elements apart from the linear ones will be considered, as well as:


*Set Cond Dummy *elems
*Set elems(Hexahedra)
*Add elems(Tetrahedra)
*Add elems(Quadrilateral)
*Add elems(Triangle)


*set var

The format for *set var differs from the syntax for the other two *set commands. Its syntax is as follows:
*Set var varname = expression
where varname is any name and expression is any arithmetical expression, number or command, where the latter must be written without * and must be defined as Int or Real.


A Tcl procedure can also be called, but it must return a numerical result.The following are valid examples for these assignments:

*Set var ko1=cond(1,real) 
*Set var ko2=2 
*Set var S1=CondNumEntities 
*Set var p1=elemsnum() 
*Set var b=operation(p1*2) 
*tcl(proc MultiplyByTwo { x } { return [expr {$x*2}] })*\
 *Set var a=tcl(MultiplyByTwo *p1)



COPYRIGHT © 2022 · GID · CIMNE