as an example this should do what your after if added to the beginning of
your .bas file
*if(strcmp(GenData(units),"mm")==0)
*set var scale=0.001
*elseif(strcmp(GenData(units),"cm")==0)
*set var scale=0.01
*elseif(strcmp(GenData(units),"m")==0)
*set var scale=1.00
*else *set var scale=1.00
*endif
MESH dimension 3 ElemType Triangle Nnode 3
Coordinates
*set elems(Triangle)
*loop *nodes
*format "%5i%14.5e%14.5e%14.5e"
*NodesNum *operation(scale*NodesCoord(1,real))
*operation(scale*NodesCoord(2,real)) *operation(scale*NodesCoord(3,real))
*end nodes
end coordinates
etc and of course you need something like the following in your .prb file
QUESTION: Units#CB#(m,cm,mm)
VALUE: mm
HELP: Choose the units for the model
HTH
regards
mark
-----Original Message-----
From: Philippe Bouchilloux [mailto:pb at magsoft-flux.com]
Sent: 04 November 2003 22:24
To: gidlist at gatxan.cimne.upc.es
Subject: Re: [GiDlist] Units conversion
Hi Rama:
Just add a field (such as a list of units "m", "cm", "mm", etc.) in the
*.prb file of your problemtype to let the user select the unit associated
with the model. Then, in the *.bas file, use this information to assign a
scaling factor (1, 0.01, 0.001, etc. assuming that the solver will
understand 1 as 1m) for the desired unit conversion. Then, directly
multiply the node coordinates by your scaling factor as you are generating
the *.dat file, or export the scaling factor if your solver can deal with
it.
Philippe
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.
Magsoft Corporation
Tel: 518-271-1352
Cell: 518-365-0421 (direct)
www.magsoft-flux.com
_______________________________________________
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.
[GiDlist] Units conversion
Moderator: GiD Team