Go to the first, previous, next, last section, table of contents.

# UTILITIES

Within `Utilities` there are included some commands that provide information or allow actions over both the geometry and the mesh. Others can act over the whole project.

## Preferences

Note:There are some pre-definitions or ways of working that can be set in GiD. They can be set in two ways: via the Preferences window or with the `Preferences` command. In the following description, the different Preferences options are shown, giving their associated variables.

The first group of Preferences (general preferences) is used to set different ways of working with GiD:

General preferences

- `Splash window:` If this option is set, when program is open again, a welcome window is displayed. Variable: `SplashWindow`. Values: 1,0. Default is 1 (`Yes`).
- `Create new point:` It alters the way how the points are entered in GiD (see section Point definition). Options are:
  - `Always:` If trying to create a new point in the vicinity of an existing one, the new point is always created.
  - `Ask:` If trying to create a new point in the vicinity of an existing one, GiD asks the user whether to make use of the existing point or create a new one.
  - `Never:` Only allows to select existing points. It can be changed interactively when in creation point mode by setting `No join` until all points are entered.
  Variable: `CreateAlwaysNewPoint`. Respective values: 1,0,-2. Default is 0 (`Ask`).
- `Display coordinates:` If set, GiD shows the coordinates in the graphical window. Variable: `DisplayCoordinates`. Values: 1,0. Default is 1 (`Yes`).
- `Automatic redraw:` If this option is not set, redraws caused by window expositions, or by internal functions are not performed. This avoids spending a lot of time for large models. Variable: `AutomaticRedraw`. Values: 1,0. Default is 1 (`Yes`).
- `Use more windows:` Depending on the selected field, `yes`, `no` or `beginner`, some options are asked to the user inside a new window or with a message in the regular messages window. Variable: `UseMorewindows`. Values: 1,0,2. Default is 1 (`Yes`).
- `Backup file:` If this option is set and a model name is given, model is saved automatically into that model name with the frequency given in the next option. Note: Mesh is not saved into the backup to save time. Variable: `BackUpName`. Default name is `backup.gid` in current or temporal directory.
- `Backup time:` Number of minutes between each backup save. 0 minutes means not to save backup. Variable: `BackUpMinutes`. Default is 20 minutes.
- `Write batchfile:` If this option is set, and a filename is given, all commands used during the current session are saved into this file. It can be executed later by means of a script file with the predefined commands to be run in GiD (see section Batch file). Variable: `BatchFileToWrite`.

The second group of preferences (graphical) are used to set different ways of visualizing the model. They do not change the geometry and the model information. These preferences are:

Graphical preferences

- `Smoothed Elements:` If set and when rendering a mesh (see section Render), the intersection between elements with a small angle between their normals will be illuminated as if it were a continuous solid. If not, illumination is made considering every element as planar. Variable: `LightSmoothedElems`. Values: 1,0. Default is 1 (`Yes`). The angle (in degrees) is the maximum angle between normals of two elements to allow smooth lighting between them. If not, one edge is drawn between them. Variable: `CosSmoothedElems`. Saved as the cosinus of this angle. Default is 0.8.
- `Surface drawing type:` Lets the user choose how to draw the surfaces when in wireframe (normal) mode. Options are:
  - `None:` Surfaces are not drawn.
  - `Boundary lines:` One magenta line is drawn for every contour line. This set of lines have a small offset towards the interior of the surface.
  - `Isoparametric lines:` Two yellow lines are drawn for every NURBS surface. The one for `u=0.5` and the one for `v=0.5`.
  - `Both:` Draws both modes.
- `Change color:` It is possible to change the default color of several things in the program with this option. One possibility is to change the background color of the GiD graphical window. Other possibilities are the color of the entities in normal mode (no render). Variable: `BackgroundColor`. Value: hexadecimal RGB char. And others.
- `Curve precision:` This option gives the precision used to draw curves. The internal definition of curves does not change. In the preferences window, it is possible to dynamically change the drawing of a curve to test the precision. Variable: `CurvePrecision`. Values: 1.0 to 0.0 from best to worst. Default is 0.8
- `Surface precision:` This option gives the precision used to draw surfaces in render mode. The internal definition of surfaces does not change. Variable: `SurfacePrecision`. Values: 1.0 to 0.0 from best to worst. Default is 0.6
- `Fast rotation:` If set, some options are able to be chosen. These options will apply only when rotating. Options are:
  - `points,lines,surfaces,volumes:` To draw or not to draw this type of entity when rotating. Variables: the same. Values: 0,1. Default is 0 (`No`).
  - `Always Geometry:` If set, when viewing the mesh and rotating, the geometry is drawn instead. Variable: `UseAlwaysGeom`. Values: 0,1. Default is 0 (`No`).
  - `Draw graphic objects:` If not set, when rotating the geometry, some graphical and temporal objects like normals or materials or conditions symbols are not drawn. Variable: `DrawGraphicObjects`. Values: 0,1. Default is 1 (`Yes`).
  - `Curve precision:` The same as general item `Curve precision`, but applied only when rotating. Variable: `CurvePrecision`. Values: 1.0 to 0.0 from best to worst. Default is 0.8
  Variable: `FastRotation`. Value: 0,1. Default is 0 (`No`).

The third group of preferences are meshing options:

Meshing preferences

Surface meshers can be:

- `Rfast` The most efficient in speed and reliability. With deformed surfaces can give distorted elements.
- `Rsurf` Meshes are generated directly in the space. Quality is better but it is slower and can fail for distorted surfaces.
- `2dumg` Its use is deprecated.

These generators are based on the advancing front generation mesh technique in order to improve speed and portability.

Note: GiD can internally try another mesher when one of them fails to generate the mesh for one surface.

- `Mesh until End` If this preference is set, the mesh generator will continue until end although there are surfaces or volumes that cannot be meshed.
- `Automatic correct sizes` If this preference is set, just when meshing begins, there is a correction to the meshing sizes assigned to entities so as to improve meshing.

- `Unstructured size transitions:` It controls whether the transitions between different element sizes are slow or fast.
- `Allow automatic structured:` If this preference is set, functions like `Assign sizes by Cordal Error` will define some surfaces as structured with highly distorted elements over them.
- `Smoothing:` Options for smoothing to enhance the mesh after the generation. Options are:
  - `Nomal:` only the standard smooth is performed.
  - `HighAngle:` an additional smooth with angle criteria is performed.
  - `HighGeom:` an additional smooth with cordal error criteria is performed.
- `Mesh always by default:` Changes the default meshing criteria. Entities will always be meshed even if they have higuer entities. Example: If surfaces are checked, when meshing a volume, volume elements and surface elements will be obtained.

The fourth group of preferences are the geometry import and collapse options:

Import preferences

- `Automatic Collapse After Import:` If this option is set, after reading one IGES file, one global collapse is made. If not, every surface and line will be independent from each other. Variable: `AutoCollapseAfterImport`. Default is active (1).
- `Import tolerance:` When importing a file or collapsing, the points closer than this distance are considered to be unique (see section IGES). Lines and surfaces can also be collapsed. Variable: `ImportTolerance`. Default is 0.0001.
- `Collapse`
  - `Ignoring Layers:` entities are collapsed also if they belong to different layers.
  - `Each layer separately:` entities in different layers are not collapsed. (Entities belonging to frozen layers are never considered). Variable: `CollapseIgnoringLayers`. Value is 1.
- `IGES:Ignore invisible entities:` If this option is set, entities with 'invisible' flag in an IGES file are ignored. If it is not set, all these entities are sent to a layer with name: "Invisible". Variable: `IGESIgnoreInvisible`. Value is 1.
- `IGES: Curve on surface from 3D:` If this option is set, the IGES curves on surface entities are created from the direct 3D space definition (recommended); if the option is not set, IGES curves are created form the surface space parameter definition.

The fifth group of preferences are the fonts used inside GiD:

Font preferences

- `Normal font:` This is the font normally used inside GiD.
- `Fixed font:` This font must have the same spacing for every letter. It is used in places where this property is necessary.
- `Big font:` Used in some dialog boxes.
- `Comments font:` Used for comments.

## Renumber

When creating new entities, the label of the new entity will be the lowest number greater than 0 that still does not exist for this entity type. If an entity is deleted, a gap is left in the label's list. This gap would be filled with new entities but it is possible to renumber the geometry to change the former entity labels. There are no problems with materials and conditions applied to entities.

In geometry mode, the renumbered entities are the geometrical ones. In mesh mode, the renumbered entities are the meshed ones. In this case, renumbering not only fills the gaps in the labels list but also changes the node numbers so as to minimize the difference of node numbers within each element. This can be useful when the calculating module uses band or skyline storage methods.

Note: It is usually not necessary to use this command because it is automatically applied when generating the mesh.

## Calculator

Vectorial calculator

This option opens a scalar and vectorial calculator. It has its own help. Try button 2 or 3 over one button.

It's possible to transfer scalar and vector and points and distances from and to the calculator and the main graphical display.

## Id

This command gives the label and coordinates of an existing or new point.

Options are:

- `Line parameter:` Selecting a line and given the line parameter (t) from 0.0 to 1.0, the point belonging to that line and t is returned.
- `Surface parameter:` Selecting a surface and given the surface parameters (u,v) from 0.0 to 1.0, the point belonging to that surface and u,v is returned.

## Signal

With this option, the user can select one entity (point,line surface or volume), and a pair of crossed lines in the graphical window signal the center of the entity.

They must be existing entities, except the especial case of point or nodes, where they can be existing or defined with any of the usual methods.

Option `Superpose Lines` is useful when in render mode. Depending whether it is set or not, lines will be always in front or the object or they can be partially hidden by the model.

## List

List entities window

Command `List` gives information about the selected entities. This information is read only.

If option `Mass` is checked, information about physical properties is given: length of lines, center of masses, area of surfaces, volume of solids. It works either for the geometry or for the mesh.

## Status

Project status window

Option `Status` gives information about useful general data of the project.

## Distance

Command `Distance` gives the distance between two existing or new points.

## Draw line normals

Command `DrawNormals. Lines` draws the sense of the selected lines.

If the line lies on the plane `z=0`, apart from the sense, GiD displays the normal of the line in 2D.

Viewing commands (zoom, rotation, etc.) can be applied and the normals remain on the screen.

It is possible to swap the sense of the lines using the options `All swaped` or `Swap some`.

Options are:

- `Swap some` changes the sense of the selected lines.
- `All swaped` changes the sense of all lines asking confirmation for the change.

## Draw surface normals

Command `DrawNormals. Surfaces` draws the normals of the selected surfaces.

Surfaces belonging to the plane `z=0` will have, by default, its normal oriented towards the z positive. Then, they are defined as anti-clockwise surfaces in 2D.

It is possible to swap the sense of the normals when the corresponding surfaces do not belong to higher entities.

Options are:

- `Swap some:` changes the sense of the normals of the surfaces after selecting them again.
- `All swaped:` changes the sense of all selected surfaces, asking for confirmation for the change.
- `Swap group:` changes normals of all selected surfaces or elements so as all of them have its normal to the same sense that adjacent entities. This sense is arbitrary but common to all adjacent entities.
- `Sel by normal:` user is prompt to enter a vector and selection is reduced to entities that have their normal in the same sense (dot product positive) as the given normal.
- `Color:` With this option set, all surfaces are draw with filled color. Their front side will be drawn with their regular color, and their back face with yellow.

Note: Volumes are correctly oriented by GiD, regardless of their surface orientation.

## Copy

Copy window

`Copy` is a general function that allows the user select a group of entities and copy them with a movement that can be `translation`, `rotation`, `mirror`,`scale` or `offset`. The process is:

Select the type of entities to copy: `point`, `line`, `surface` or `volume`, when being in geometry mode, or option `nodes` or `elements`, when being in mesh mode. All the lower entities that belong to the selected ones will be automatically computed. the type of movement needs to be chosen and the parameters for the movement are defined. Options are:

- rotation: It is necessary to either enter two points in 3D or one point in 2D. These two points define the rotation axis and its orientation. In 2D, the axis goes from the defined point towards z positive. Enter the angle of rotation in degrees. It can be positive or negative. The sense is defined by the right hand rule. In 2D, the sense is counter-clockwise.
- translation: It is defined by two points. Relative movements can be obtained defining the first point as 0,0,0 and considering the second point as the translation vector (see section Point definition).
- mirror: It is defined by three points that cannot be aligned. These points form a plane that is the mirror plane. In 2D, the mirror line is defined by two points.
- scale: It is defined by a center and a point. Every coordinate of the point is the scale factor for every `x,y,z` axis. Scale factor greater than one, increases size, while less than one decreases the size. It may also be negative, changing the sign of the corresponding coordinates.
- offset: It is defined by one positive or negative scalar magnitude. It will move each entity in the sense of its normal, the magnitude given. In 2D, normal is considered to lie in the `z=0` plane. This option works either for lines, surfaces or for mesh elements.
- sweep: This is an option for copying figures along a line (path line). You can just copy the figures (and then specify a number of copies) or extrude them. Both methods have basically the same options.
  The extrusion (and the copy) starts always on the start point of the path line. If you select 'twist mode' to be on, then the relative position of the figure to copy respect to the start of the path line is conserved along the line.
  In a non-planar curve, there is not only curvature, but also torsion. This may cause some unexpected behavior, because the figure has also a rotation along tangent direction of path:
  Next it's used 'XY plane' option, that makes certain initial vector to remain in this plane during extrusion. (In this example, axis is Z).
  Option 'ByDer2' uses the second derivate of the path line as a normal to the plane in which that initial vector have to remain. A rotation along the path line can be forced using 'Angle' parameter (degrees):
  Finally, if path line is a polyline, then the extrusion will be divided in several parts:

Other available options are:

- extrude: This option can be set to either lines or surfaces or volumes. When a movement is selected, the copy is made and lines connecting the old and the new points are created. These lines will be either straight lines or arcs depending on the movement type. If extrude surface is chosen, NURBS surfaces connecting old and new lines will also be created. If `Volumes` is chosen, the volume contained between old and new surfaces is also created. This option is not allowed when copying volumes.
- mcopy: Selecting this option and giving the number of repetitions, the operation selected is performed this number of times. This option is not available for `mirror`.
- create contacts: Creates separated contact volumes (see section Contact creation) for every copied surface. This option is only available when copying surfaces.
- Duplicate entities: If this option is not set, when an entity after the `copy` operation occupies the same position than an existing one that does not belong to a frozen layer, both entities are converted into one.

Mantain layers: If this option is not set the new entities created will be placed in the layer to use; otherwise, the new entities are copied to the same layers as their originals.

Note: Entities belonging to a frozen layer (see section Layers), are not checked when sharing old entities.

## Move

This command works like the command `Copy` but moves the entities instead of copying them. The program checks automatically if some of the entities must be copied instead of moved (for this reason, these entities belong also to non-selected entities of higher level) and performs the corresponding operation.

Options like `Extrude`, `Multiple copy` and `Create contacts` are disabled for movements.

## Repair

This option checks the coherence of the database information. Only use it if there are problems. When used, a window notifies repaired items and may give some warnings about incorrect entities.

## Collapse

The function `Collapse` convert coincident entities or entities that are close each other into one.

The variable `ImportTolerance` (see section Preferences), controls the maximum distance between two adjacents points to be converted into one. With lines and surfaces, a maximum distance between both entities is calculated and when it is less than `ImportTolerance`, they are converted into one.

Select the type of entities: `point`, `line`, `surface` or `volume`, when being in geometry mode. All the lower entities that belong to the selected ones will be automatically computed. After pressing `escape`, collapse is performed.

Option `Model` performs the operation over all the entities of the model.

COLLAPSING MESH:

When a mesh is created the collapse menu changes and it's possible to collapse edges, nodes, elements or the entire mesh.

- Collapse edges joins nodes which are connected by edges shorter than the Import Tolerance value.
- Collapse nodes asks you to select some nodes. The nodes which are closer than the Import Tolerance value, are collapsed.
- Collapse elements asks you to select some elements. Then, the nodes of these elements which are closer than the Import Tolerance value, are collapsed.
- Collapse mesh collapses all the nodes of the mesh.

Note: Entities belonging to a frozen layer (see section Layers), are not checked when collapsing.

## Uncollapse

Function uncollapse permits the user to select either lines or surfaces and duplicate boundary entities.

Typically, if two surfaces share one line as an edge, after applying this function to both surfaces, that line will be duplicated and every line will belong to a different surface.

## Undo

Undo window

This command allows the user undo any previous commands executed since the last time the project was saved or read. To do this, the user must select in the undo window the set of commands that have to be undone.

## Comments

This facility is included to add comments to the pictures obtained through GiD (see section Print to file). Three lines are allowed and with the `Comments` button the user can impose their printing on the screen to foresee mistakes or perform changes before printing.

All the comment lines have their corresponding input button and the literal text, written into the command line between double-quotes, will be the output.

## Graphical

In this menu there are some options to change the windows appearance. They can be inside another window or independent or disappear. Windows are:

- Toolbars: Selecting this option the following window appears:

  Toolbars view and position configuration window

  With this window the position: inside, outside, top left, bottom right, etc. of following item can be configured, or siwtched on and off.

  - Geometry & View bar and Standard bar: icon toolbars used to perform certain operations. Use middle or right button over an icon to get help.
  - Right buttons: These are the buttons that appear usually in the right side of the windows. They can perform most of the actions of the program.
  - Command line: Inferior line where it is possible to write commands.
  - Up menu: Menus located over the graphical window.
  Note: To make the `Up menu` appear again, shortcut `Control-U` or `Control-Shift-u` can be used.

## Coordinates window

This option opens a window used to enter points (see section Point definition). It can be used in any place where it is possible to enter one point.

To accept one point in this window, press `Accept` or press the `Return` key.

Option `Coordinate system` allows the user select between:

- Cartesian: Cartesian coordinate system.
- Cylindrical: User enters the radius in XY plane, the anti-clockwise angle in plane XY from x axe(theta), and the z coordinate.
- Spherical: User enters the radius, the anti-clockwise angle in plane XY from x axe(theta), and the angle with z axe(phi).

Option `Local axes` allows the user choose:

- Global: Global axes.
- Relative center: User defines a center of coordinates. All new points created with this window will be related to this center. In the window where the relative center is entered, user can select with button `Pick` a point from graphical window.
- Relative last: Last point entered is the relative center of coordinates.
- Define new...: It allows the user define a new local axes. Once defined, user can select it.
- Any local axes: All local axes defined with See section Local axes, will be listed here. Points entered will be related to this axes.

`New point` shows the current way of entering points. Button `Change` opens the preferences window (see section Preferences) where it can be changed.

Button `Pick` allows the user select a point from the window and it is inserted in the point fields. Then it can be edited and used.

## Read batch window

A batch file can be read to execute some functions (see section Batch file) or to create an animated view of these operations. This latter case can be performed with the `Read batch window`.

Read batch window

Once selected a file, it is possible to execute it interactively and make it stop in some interesting parts. To allow all the movements (rotations and so on) be executed in the same way that originally, option `Write rotations in batch:` must be set in preferences (see section Preferences), when creating the batch.

There are several ways to stop the running batch. One of them is to include stops in the show file section with the `Mark break` button, and selecting `Internal stop`. This marks can be saved in the batch file with button `Write...`.

Option `Show info` lets the program write all the usual messages in the GiD messages window.

## Clip planes

This window allows to hide the front or the back of the view.

Clip planes is a way not to draw the geometry or mesh that is very close or very far to the viewer.

Moving `Near plane`, hides the geometry that is closer to the viewer. Moving `Far plane`, hides the geometry that is further to the viewer.

To see the changes dynamically, select `Dynamic update`. Option `Fixed distance`, allows a constant distance between both planes.

A new rotation center can be chosen or selected from the window.

Option `Increase boundaries`, increments the ends in the bars of Far plane and Near plane.

Note: All this information is reset when performing a `zoom frame`. (see section Zoom).

## Save configuration file

It is possible to save a window configuration into a file. Then if GiD is open again with option -c (see section INVOKING GiD) and this file, the windows are open in the same place and size.

## Perspective

Perspective window

By default, a model is viewed inside GiD using orthogonal projection.

With this option, it is possible to change to a perspective projection. In this mode, the user can choose a distortion factor for the perspective. This can be updated dynamically.

## Change Light Vector

With this option the user can change the VECTOR of the light direction interactively or just entering the VECTOR components on the command line.

Options are:

- `Default Vector:` with this option the ligth direction vector changes to its default value.
- `Change Z Sign:` here the user tells the program if the light comes from the front of the object, or from behind the object. The mouse cursor are changed arcondingly.

## Macros window

Window that allows the creation and recording of macros

Window 'Macros' permits to create sequences of commands and give a name to them. This group of commands can also be recorded from one execution set inside the program.

It is possible to assign a keyboard shortcut to a given macro.

Note: Macros are considered as a user preference and not related to the active model. So, to transfer a set of macros from one user to another it is necessary to check the files: `gid.ini` or `.gidDefaults`.

## Selection window

In these functions where the user has to select some entities (creation of a surface or a volume, copy of entities ...) it is possible to use the selection window. The selection window lets you take control of the selection process.

Selection window

Note: the option `Sel window` is only avalaible in the mouse menu during the selection process.
The selection window has the following options:

- `Select all`: if this option is chosen all entities are selected. If a filter is selected, the filter is applied to all entities.
- `From, To`: this option lets the user select a range of entities. If a filter is selected, the filter is applied only to that range of entities. To see the id numbers of entities, use the `Label` command (see section Label).
- `Mode`: there are three selection modes:
  - Swap: if you select an entity which is already selected, the entity deselects, and viceversa.
  - Add: in this mode it's impossible to deselect an entity. Only new entities are added to the current selection.
  - Rem: in this mode it's impossible to select an entity. This mode is used to remove entities of the current selection.
- `Filter`: if a filter is selected, only the entities that accomplish with the filter criteria will be selected. This menu changes depending on what type of entity is being selected:
  POINTS
  - Higher entities: given a point, number of lines to which it belongs.
    LINES
  - Higher entities: given a line, number of surfaces to which it belongs.
  - Min. length: selects only the lines which its length is smaller than the given length.
  - Max. length: selects only the lines which its length is biger than the given length.
  - Entity type: type of line
    SURFACES
  - Higher entities: given a surface, number of volumes to which it belongs.
  - Entity type: type of surface.
    VOLUMES
  - Entity type: type of volume.
    ELEMENTS
  - Bad Min Angle: number of minimum degrees accepted (see section Mesh quality).
  - Bad Max Angle: number of maximum degrees accepted (see section Mesh quality).
  - Element type: type of element. (see section Element type)
- `Clear`: Clears the current selection.

## Animate Controls

Animate controls window

This windows allows the creation of animations while using GiD. Any of these format can be selected: MPEG, AVI True Color, AVI 15bpp (reduced number of colors: 32768) and GIF. AVI with MJPEG compression is also supported. After giving a name and a delay time between frames (for 20 frames per second, a delay of 1/20 = 50 ms. should be entered) the process can start just clicking on the start button ( `film roll and arrow` button), the green led will change to red.

The user can add frame by frame the pictures he wants into the animation file just clicking on the `film roll and arrow` button. The option Save redraws tells GiD to save every redraw automatically into the animation file, so no user intervention is needed to store frames.

The animation can be finished at any time just pressing the `closed film roll` button, the red led will change to green.

Note: To avoid problems when trying to view an MPEG format animation in Microsoft Windows, it is strongly recommended to use the Default menu to select a 'standard' size and press the Resize button. The graphical window will change to this 'standard' size. After finishing the animation, just selecting Default on the menu and pressing the Resize button, the previous size will be restored.

Note: The AVI files with MJPEG compression, can be viewed with `xanim` on Linux and unix machines, and with DirectX 8.x installed in Microsoft Windows machines.

## Dimensions

With the `dimensions` option it's possible to add textual information to your model. That information can be changed of layer or deleted.

There are the following options:

- vertex: shows the coordinates of a vertex. Click over an existing point and then click where you want the dimension to be written.
- distance: shows the distance between two points. You'll have to select two points and then click where you want the dimension to be written.
- angle: shows the degrees of an angle. You'll have to select three points and then click where you want the dimension to be written.
- radius: shows the center and radius of an arc. You'll have to select an existing arc and then click where you want the dimension to be written.
- text: shows a text string defined by the user. Enter the text and click where you want the text to be written.

Deletes a "dimension". Select the dimension you want to delete and press ESC.

Select the dimension you want to edit, change the text, and click OK.

This option lets you change the appearence of a "dimension"; a "dimension" can be drawn with or without a box. Choose `ShowBox` on or off, select a "dimension" and press ESC.

Go to the first, previous, next, last section, table of contents.