When GiD is installed, the file units.gid is copied within the GiD directory. In this file a table of magnitudes is defined. For each magnitude there is a set of units and a conversion factor between the unit and the reference unit. The units systems are also defined. A unit system is a set of mangnitudes and the corresponding unit.

BEGIN TABLE

LENGTH : m, 100 cm, 1e+3 mm

...

STRENGTH : kg*m/s^2, N, 1.0e-1 kp

END

BEGIN SYSTEM(INTERNATIONAL)

LENGTH : m

MASS : kg

STRENGTH : N

...

TEMPERATURE : Cel

END

The syntax of the unit file (problem_type_name.uni) within the problem type is similar. It can include the line:

USER DEFINED: ENABLED

(or DISABLED)

meaning that the user is able (or not able) to define his own system unit within the project. If the line does not appear in the file the value is assumed to be ENABLED.

It is possible to ignore all units systems defined by default inside the file units.gid:

USE BASE SYSTEMS: DISABLED

(or ENABLED)

With the command HIDDEN: 'magnitude', 'magnitude' certain magnitudes will not be displyed in the Problem units window.

HIDDEN: strength, pressure

If the problem type uses a property which has a unit, then GiD creates the file project_name.uni in the project directory. This file includes the information related to the unit used in the geometric model and the unit system used. The structure of this file is:

MODEL: km

PROBLEM: USER DEFINED

BEGIN SYSTEM

LENGTH: m

PRESSURE: Pa

MASS: kg

STRENGTH: N

END

In this file, MODEL refers to the unit of the geometric and mesh model of preprecess and PROBLEM is the name of the units system used by GiD to convert all the data properties in the output to the solver. If this name is USER DEFINED, then the system is the one defined within the file. The block

BEGIN SYSTEM

...

END

corresponds to the user-defined system.

Unit system: It is possible to define more than one 'unit sytem'. When the user select a unit sytem it mean than when writting to the calculation file the fields with units (material properties, conditions, general data, model length) they will be written converted to the reference unit of this magnitude for the selected unit system.

Hide some units depending on unit system:

The tcl procedure Units::SetUnitsDisallowed allow to specify a list of units to be disallowed (not used in graphical windows)

proc Units::SetUnitsDisallowed { basic_units_to_disallow }

example

proc GiD_Event_InitProblemtype { dir } {

My_On_AfterChangeModelUnitSystem [GiD_Units get system]

}

proc GiD_Event_AfterChangeModelUnitSystem { old_unit_system new_unit_system } {

My_On_AfterChangeModelUnitSystem $new_unit_system

}

proc My_On_AfterChangeModelUnitSystem { new_unit_system } {

if { $new_unit_system == "IMPERIAL" } {

Units::SetUnitsDisallowed {m cm mm Mm km kg ton kton N kp kN MN Nm kNm MNm Pa kPa MPa GPa}

} elseif { [string range $new_unit_system 0 8] == "INTERNATIONAL" } {

Units::SetUnitsDisallowed {in Mi miles ft lb lbf kip lbfft lbfin psi ksi Gal}

} else {

W "unexpected unit system $new_unit_system"

}

}