[GiDlist] Field name in a .BAS file.

Moderator: GiD Team

Post Reply
Christophe Louis

[GiDlist] Field name in a .BAS file.

Post by Christophe Louis »

Hello,

I am writing a .bas file and I would like to ask you whether it is possible to get the name of a field inside a loop over materials. I have written in the .mat file something like :

QUESTION : ELASTIC_MODULUS
VALUE : 205000

and I would like to write in the .dat file :

Material.put(ELASTIC_MODULUS, 205000)

can I get the name of the filed ("ELASTIC_MODULUS") by a command like *MatProp(0) for the material's name, or sould I write for each field :

*loop materials
*MatProp(0).put(ELASTIC_MODULUS, *MatProp(1))
*MatProp(0).put(POISSON_RATIO,*MatProp(2))
....
*end

Thanks,

Christophe Louis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020925/9eb10413/attachment.htm
Enrique Escolano

[GiDlist] Field name in a .BAS file.

Post by Enrique Escolano »

It is not available directly in the bas file to recover the name of a field,
and it is recommended to use *Matprod(ELASTIC_MODULUS) instead *MatProp(1) ,
is more human readable, and easy to mantain (if you add or remove fields is not necessary to renumber)

For advanced users, it is possible to obtain the fields and values of a material from tcl, with a info command

.central.s info materials
return a list with all the material names

.central.s info material "material_name"
return a list with the fields and values of this material

It is possible to create a procedure inside the file "problemtypename".tcl, and call this procedure from the bas file
with the order *tcl(tclcommand)
The returned string is printed directly to the output file.

For more info, download the "advanced course documentation" at
http://gid.cimne.com/2002/material_courses.subst

Enrique Escolano
----- Original Message -----
From: Christophe Louis
To: Gid
Sent: Wednesday, September 25, 2002 4:31 PM
Subject: [GiDlist] Field name in a .BAS file.


Hello,

I am writing a .bas file and I would like to ask you whether it is possible to get the name of a field inside a loop over materials. I have written in the .mat file something like :

QUESTION : ELASTIC_MODULUS
VALUE : 205000

and I would like to write in the .dat file :

Material.put(ELASTIC_MODULUS, 205000)

can I get the name of the filed ("ELASTIC_MODULUS") by a command like *MatProp(0) for the material's name, or sould I write for each field :

*loop materials
*MatProp(0).put(ELASTIC_MODULUS, *MatProp(1))
*MatProp(0).put(POISSON_RATIO,*MatProp(2))
....
*end

Thanks,

Christophe Louis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020925/8bfa4c4a/attachment.htm
Post Reply