Page 1 of 1

Easier way to modify material with TCL?

Posted: Sun May 28, 2017 10:44 am
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?

Re: Easier way to modify material with TCL?

Posted: Mon May 29, 2017 6:59 pm
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

Re: Easier way to modify material with TCL?

Posted: Mon Jun 12, 2017 12:58 pm
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?

Re: Easier way to modify material with TCL?

Posted: Mon Jun 12, 2017 5:25 pm
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.