These commands return more than one value in a prescribed order, writing them one after the other. All of them except LocalAxesDef are able to return one single value when a numerical argument giving the order of the value is added to the command. In this way, these commands can appear within an expression. Neither LocalAxesDef nor the rest of the commands without the numerical argument can be used inside expressions. Below, a list of the commands with the appropriate description is displayed.

• *NodesCoord. This command writes the node's coordinates. It must be inside a loop (see *loop) over the nodes or elements. The coordinates are considered as real numbers (see *realformat and *format). It will write two or three coordinates according to the number of dimensions the problem has (see *Ndime).

If *NodesCoord receives an integer argument (from 1 to 3) inside a loop of nodes, this argument indicates which coordinate must be written: x, y or z. Inside a loop of nodes:

*NodesCoord writes three or two coordinates depending on how many dimensions there are.

*NodesCoord(1) writes the x coordinate of the actual node of the loop.

*NodesCoord(2) writes the y coordinate of the actual node of the loop.

*NodesCoord(3) writes the z coordinate of the actual node of the loop.

If the argument real is given, the coordinates will be treated as real numbers.

Example: using *NodesCoord inside a loop of nodes

Coordinates:

Node X Y

*loop nodes

*format "%5i%14.5e%14.5e"

*NodesNum *NodesCoord(1,real) *NodesCoord(2,real)

*end nodes

This command effects a rundown of all the nodes in the mesh, listing their identifiers and coordinates (x and y).

The contents of the project_name.dat file could be something like this:

Coordinates:

Node X Y

1 -1.28571e+001 -1.92931e+000

2 -1.15611e+001 -2.13549e+000

3 -1.26436e+001 -5.44919e-001

4 -1.06161e+001 -1.08545e+000

5 -1.12029e+001 9.22373e-002

...

*NodesCoord can also be used inside a loop of elements. In this case, it needs an additional argument that gives the local number of the node inside the element. After this argument it is also possible to give which coordinate has to be written: x, y or z.

Inside a loop of elements:

*NodesCoord(4) writes the coordinates of the 4th node of the actual element of the loop.

*NodesCoord(5,1) writes the x coordinate of the 5th node of the actual element of the loop.

*NodesCoord(5,2) writes the y coordinate of the 5th node of the actual element of the loop.

*NodesCoord(5,3) writes the z coordinate of the 5th node of the actual element of the loop.

• *ElemsConec. This command writes the element's connectivities, i.e. the list of the nodes that belong to the element, displaying the direction for each case (anti-clockwise direction in 2D, and depending on the standards in 3D). For shells, the direction must be defined. However, this command accepts the argument swap and this implies that the ordering of the nodes in quadratic elements will be consecutive instead of hierarchical. The connectivities are considered as integers (see *intformat and *format).

If *ElemsConec receives an integer argument (begining from 1), this argument indicates which element connectity must be written:

*loop elems

all conectivities: *elemsconec

first conectivity *elemsconec(1)

*end elems

Note: In the first versions of GiD, the optional parameter of the last command explained was invert instead of swap, as it is now. It was changed due to technical reasons. If you have an old .bas file prior to this specification, which contains this command in its previous form, when you try to export the calculation file, you will be warned about this change of use. Be aware that the output file will not be created as you expect.

• *GlobalNodes. This command returns the nodes that belong to an element's face where a condition has been defined (on the loop over the elements). The direction for this is the same as for that of the element's connectivities. The returned values are considered as integers (see *intformat and *format).If *GlobalNodes receives an integer argument (beginning from 1), this argument indicates which face connectity must be written.

So, the local numeration of the faces is: Triangle: 1-2 2-3 3-1

Quadrilateral: 1-2 2-3 3-4 4-1

Tetrahedra: 1-2-3 2-4-3 3-4-1 4-2-1

Hexahedra: 1-2-3-4 1-4-8-5 1-5-6-2 2-6-7-3 3-7-8-4 5-8-7-6

Prism: 1-2-3 1-4-5-2 2-5-6-3 3-6-4-1 4-5-6

Pyramid: 1-2-3-4 1-5-2 2-5-3 3-5-4 4-5-1

• *LocalNodes. The only difference between this and the previous one is that the returned value is the local node's numbering for the corresponding element (between 1 and nnode).

• *CondElemFace. This command return the number of face of the element where a condition has been defined (beginning from 1). The information is equivalent to the obtained with the localnodes command

• *ElemsNnode. This command returns the number of nodes of the current element (valid only inside a loop over elements).

Example:

*loop elems

*ElemsNnode

*end elems

• *ElemsNnodeCurt. This command returns the number of vertex nodes of the current element (valid only inside a loop over elements). For example, for a quadrilateral of 4, 8 or 9 nodes, it returns the value 4.

• *ElemsNNodeFace. This command returns the number of face nodes of the current element face (valid only inside a loop over elements onlyincond, with a previous *set cond of a condition defined over face elements).

Example:

*loop elems

*ElemsNnodeFace

*end elems

• *ElemsNNodeFaceCurt. This command returns the short (corner nodes only) number of face nodes of the current element face (valid only inside a loop over elements onlyincond, with a previous *set cond of a condition defined over face elements).

Example:

*loop elems

*ElemsNnodeFaceCurt

*end elems

• *ElemsType: This returns the current element type as a integer value: 1=Linear, 2=Triangle, 3=Quadrilateral, 4=Tetrahedra, 5=Hexahedra, 6=Prism, 7=Point,8=Pyramid,9=Sphere,10=Circle. (Valid only inside a loop over elements.)

• *ElemsTypeName: This returns the current element type as a string value: Linear, Triangle, Quadrilateral, Tetrahedra, Hexahedra, Prism, Point, Pyramid, Sphere, Circle. (Valid only inside a loop over elements.)

• *ElemsCenter: This returns the element center. (Valid only inside a loop over elements.)

Note: This command is only available in GiD version 9 or later.

• *ElemsRadius: This returns the element radius. (Valid only inside a loop over sphere or Circle elements.)

Note: This command is only available in GiD version 8.1.1b or later.

• *ElemsNormal. This command writes the normal's coordinates. It must be inside a loop (see *loop) over elements, and it is only defined for triangles, quadrilaterals, and circles (and also for lines in 2D cases).

If *ElemsNormal receives an integer argument (from 1 to 3) this argument indicates which coordinate of the normal must be written: x, y or z.

• *LocalAxesDef. This command returns the nine numbers that define the transformation matrix of a vector from the local axes system to the global one.

Example:

*loop localaxes

*format "%10.4lg %10.4lg %10.4lg"

x'=*LocalAxesDef(1) *LocalAxesDef(4) *LocalAxesDef(7)

*format "%10.4lg %10.4lg %10.4lg"

y'=*LocalAxesDef(2) *LocalAxesDef(5) *LocalAxesDef(8)

*format "%10.4lg %10.4lg %10.4lg"

z'=*LocalAxesDef(3) *LocalAxesDef(6) *LocalAxesDef(9)

*end localaxes

• *LocalAxesDef(EulerAngles). This is as the last command, only with the EulerAngles option. It returns three numbers that are the 3 Euler angles (radians) that define a local axes system  How to calculate X Y Z orthonormal vector axes from three euler angles angles

X= cosC*cosA - sinC*cosB*sinA

X= -sinC*cosA - cosC*cosB*sinA

X= sinB*sinA

Y= cosC*sinA + sinC*cosB*cosA

Y= -sinC*sinA + cosC*cosB*cosA

Y= -sinB*cosA

Z= sinC*sinB

Z= cosC*sinB

Z= cosB

where

cosA=cos(angles)

sinA=sin(angles)

cosB=cos(angles)

sinB=sin(angles)

cosC=cos(angles)

sinC=sin(angles)

How to calculate euler angles angles from X Y Z orthonormal vector axes

if(Z<1.0-EPSILON && Z>-1.0+EPSILON){

double senb=sqrt(1.0-Z*Z);

angles=acos(Z);

angles=acos(Z/senb);

if(Z/senb<0.0) angles=M_2PI-angles;

angles=acos(-Y/senb);

if(X/senb<0.0) angles=M_2PI-angles;

} else {

angles=acos(Z);

angles=0.0;

angles=acos(X);

if(-X<0.0) angles=M_2PI-angles;

}

• *LocalAxesDefCenter. This command returns the origin of coordinates of the local axes as defined by the user. The "Automatic" local axes do not have a center, so the point (0,0,0) is returned. The index of the coordinate (from 1 to 3) can optionally be given to LocalAxesDefCenter to get the x, y or z value.

Example:

*LocalAxesDefCenter

*LocalAxesDefCenter(1) *LocalAxesDefCenter(2) *LocalAxesDefCenter(3)