[GiDlist] Re: GiD units

Moderator: GiD Team

Post Reply
Enrique Escolano

[GiDlist] Re: GiD units

Post by Enrique Escolano »

Hello Mark and gidlist users.
I send this answer to the gidlist, because this topic is very little explained in the current documentation,
and it can be of interest for other users. I attach also a small problemtype to show the "GiD units" use.

To create a problemtype with GiD units, can create a file named problemetype.uni
For example, in a previous mail, Rama Karve want to obtain the output lengths in centimeters.
Then can define a system, named user-1 with the desired output units (cm, kp/cm^2) for your magnitudes (length, pressure, etc)

This is a sample of problemetype.uni

USER DEFINED: DISABLED
USE BASE SYSTEMS: DISABLED

BEGIN TABLE
length : m { basic }, 100 cm , 1.0e+3 mm
strength : N { basic }, kg*m/s^2 ,1.0e-1 kp
pressure : Pa { basic }, N/m^2 ,1.0e-5 kp/cm^2
weight : N/m^3 { basic }, 1.0e-4 ton/m^3 , 1.0e-1 kp/m^3 , 1.0e-7 kp/cm^3
END

begin system(user-1)
length : cm
strength : kp
pressure : kp/cm^2
weight : kp/cm^3
end


And this is your explanation:
USER DEFINED: DISABLED
This disable the user option to change the system units at run time (from the Data-Units window)

USE BASE SYSTEMS: DISABLED
Is to ignore the default (international, or others ) GiD unit systems (defined inside /scripts/uni.gid.),
and only show the problemtype defined "user-1" system

BEGIN TABLE
length : m , 100 cm , 1.0e+3 mm
strength : N , kg*m/s^2 ,1.0e-1 kp
pressure : Pa , N/m^2 ,1.0e-5 kp/cm^2
weight : N/m^3 , 1.0e-4 ton/m^3 , 1.0e-1 kp/m^3 , 1.0e-7 kp/cm^3
END
This is the scale factor between the first basic unit, and other units for a magnitud.
For example 1m=100 cm=1e3 mm, ...
In fact, it's not necessary this definition if the desired units also exists in /scripts/uni.gid
(currently uni.gid has a small number of units, but it can be completed for next versions)

begin system(user-1)
length : cm
strength : kp
pressure : kp/cm^2
weight : kp/cm^3
end

Defines the system units used as *.bas output for node coodinates (length) or other material/contition fields with units.
It's possible to define several systems, and the user can select at run-time the desired one.

This is a problemtype.mat material file, with a material

NUMBER: 1 MATERIAL: Steel
QUESTION: YOUNG:#UNITS#
VALUE: 2.1e11kp/cm^2
IMAGE: young.gif
HELP: Elastic modulus
QUESTION: POISSON
VALUE: 0.3
HELP: Poisson modulus
QUESTION: WEIGHT#UNITS#
VALUE: 78000kp/cm^3
HELP: Only used if self-weight in general data is enabled
QUESTION: THICKNESS#UNITS#
VALUE: 1.0m
HELP: Only used for plane stress (1.0 for plane strain)
END MATERIAL

Note that some fields have #UNITS# after the question name (YOUNG:#UNITS#),
and the default value has the also the unit symbol (2.1e11kp/cm^2), whitout spaces between value and unit.



The field can be filled whit the more "user-friendly" unit (see the drop-down menu for the thickness field) and
after the output in the calculation file is always in the expected system unit.



Inside the problemtype.bas ,it exists some commands related to units.

SYSTEM OUTPUT UNITS
LENGTH: *Units(LENGTH)
PRESSURE: *Units(PRESSURE)
Conversion factors:
1 *Units(LENGTH) is equal to *FactorUnit(LENGTH) *BasicUnit(LENGTH)
1 *Units(PRESSURE) is equal to *FactorUnit(PRESSURE) *BasicUnit(PRESSURE)
NODES
*loop nodes
*nodesnum *NodesCoord
*end
...
MATERIALS
*loop materials
*matprop(YOUNG,real) *matprop(POISSON,real) *matprop(WEIGHT,real) *matprop(THICKNESS,real)
*end materials
...

The user must declare the model length unit, from the Data-Unit window. (m, cm or mm in this sample)
The *NodesCoord command writes the coordinates always in cm (the selected user-1 system length unit)

*matprop(YOUNG,real) write this field always in kp/cm2 (the pressure system unit).

Other related commands are for example:
1 *Units(LENGTH) is equal to *FactorUnit(LENGTH) *BasicUnit(LENGTH)

*Units(LENGTH) : return the current system unit (the output unit obtained in the bas file for the "LENGTH" magnitude)
*BasicUnit(LENGTH) : return the basic unit (the first list item in BEGIN TABLE for the this magnitude)
*FactorUnit(LENGTH) : Is the factor to multiply by BasicUnit to convert a magnitude to the system Unit.

Note: The units are a concept now "under develop", the last GiD versions have a bug when the user change the model unit,
the length factor is cached to speed the output, and because this bug it's not updated.
This bug is corrected for the next 7.4.5b beta version.

For next versions it's also planned to allow units in result files, and show/select this units in postprocess.

Regards

Enrique Escolano

----- Original Message -----
From: "Mark Smith" mark.smith at linx.co.uk
To: escolano at cimne.upc.es
Sent: Thursday, November 06, 2003 10:44 AM
Subject: RE: GiD units



Dear Enrique
I'm confused? I thought both Philippe & myself were talking about the same
method I just gave an example of how it would be done?
If there is a better way please let me know.
Regards
Mark
-----Original Message-----
From: Enrique Escolano [mailto:escolano at cimne.upc.es]
Sent: 05 November 2003 20:51
To: gidlist at gatxan.cimne.upc.es
Subject: Re: [GiDlist] Units conversion


The "Mark Smith" answer is a mode to solve the problem without use the "GiD
concept of units", the problemtype defines a general data to declare the
current unit, and the bas file check this value and aply the apropiate
factor to the coordinates.
In this case, GiD internally unknown the significate of the general data
unit field.

The "Philippe" approach instead uses the GiD unit concept: Then the user
declare for GiD the model unit from the Data-Unit menu, and GiD write the
coordinates in the bas file in the reference unit.

Not only the model can have unit, also a condition or material field can
have your unit, and GiD automatically translate the input values in the more
user-friendly unit (selected from a listbox) to the reference unit.
See help on Customization-Configuration Files-Unit System file

Enrique Escolano
----- Original Message -----
From: "Rama Karve" rkarve at emagtechnologies.com
To: gidlist at gatxan.cimne.upc.es
Sent: Tuesday, November 04, 2003 11:08 PM
Subject: [GiDlist] Units conversion


Hi,

The problem I have is this - My solver assumes that the geometry has been
defined in centimeters. However, I want to allow the user to define the
geometry in some other unit if they want to, and then in some way convert
the units before feeding the file to the solver.

For example, if the user wants to define his geometry in mm, and defines a
line between points (-5, 0, 0) to (5, 0, 0) the coordinates I want to
write
to the input file are (-0.5, 0, 0) and (0.5, 0, 0).

Is there a quick way to do this in GiD?

Thanks,
Rama Karve

_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist


_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.528 / Virus Database: 324 - Release Date: 16/10/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.528 / Virus Database: 324 - Release Date: 16/10/2003



The information contained in this e-mail message (and any attachment
transmitted herewith) is privileged and confidential and is intended for the
exclusive use of the addressee(s). If you are not an addressee, any
disclosure, reproduction, distribution or other dissemination or use of this
communication is strictly prohibited. If you have received this
communication in error, please contact us immediately so that we can correct
the error.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20031106/a2acd641/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 10113 bytes
Desc: not available
Url : http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20031106/a2acd641/attachment.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SampleUnits.gid.zip
Type: application/x-zip-compressed
Size: 3741 bytes
Desc: not available
Url : http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20031106/a2acd641/attachment.bin
Post Reply