Easier way to modify material with TCL?

Moderator: GiD Team

Post Reply
awa5114
Posts: 43
Joined: Thu Jan 26, 2017 5:10 pm

Easier way to modify material with TCL?

Post by awa5114 »

Currently in order to modify a material I have to do the following:

Code: Select all

GiD_Process Mescape Data Materials NewMaterial default_material LinearElastic 1_phase_solid 201 SOLID 0.0 2038.76 1 0.0 0.0 0.0 Linear_Elasticity 101 UMAT_LinearElasticity.dll  0.0 5E4 0.3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -5.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 LIQUID 0.0 0.0 0.0 GAS 0.0 0.0 0.0
This seems really excessive and an overkill. Also it is difficult to track which parameters are where. Is there a more intuitive way to simply modify a material on tcl?
User avatar
escolano
Posts: 1922
Joined: Sun Sep 05, 1982 10:51 pm

Re: Easier way to modify material with TCL?

Post by escolano »

There are other Tcl commands (without enter in the process loop):

See GiD Help on TCL AND TK EXTENSION>Special Tcl commands>Data

GiD_CreateData
GiD_ModifyData
GiD_AccessValue
...

e.g. to modify only a field of an existent material something like this:
GiD_AccessValue set material $material_name $question $new_value
awa5114
Posts: 43
Joined: Thu Jan 26, 2017 5:10 pm

Re: Easier way to modify material with TCL?

Post by awa5114 »

I have a question that goes along the same lines. What if I need to generate a TCL list containing the names of all the materials that currently exist in my model? The reason is that I would like to loop through each material, assign it to the same volume, regenerate the mesh and output calc files. But this is for maybe 10 different materials?
User avatar
escolano
Posts: 1922
Joined: Sun Sep 05, 1982 10:51 pm

Re: Easier way to modify material with TCL?

Post by escolano »

to have the list of all defined materials the command is simply
GiD_Info materials

If do you want the same mesh, and change only the values of some fields of the material (e.g. all your 10 materials having the same question fields), then is is cheaper to simply modify for each loop the value of the current used material, without the need of assign a new material and re-mesh.
Post Reply