customlib::InitMaterials issue with multiple material databases still present in GiD 17 and 18

Hello GiD development team,

I would like to report again an issue related to customlib::InitMaterials when a Problem Type uses more than one material database.

We previously discussed this issue in the following GiD Forum thread:

Using two editable material property datasets in CMAS2D/customlib GiD example

At that time, it was confirmed that there was a bug in the GiD code, and the following modification to customlib::InitMaterials was suggested.

Current/original code:

set xp2 {.//container[@n="materials"]/blockdata[@n="material"]}

Modified code:

set xp2 {.//blockdata[@n="material"]}

The modified version works correctly.

However, I have recently tested our code again with GiD 17 and GiD 18, and it appears that the same issue is still present.

Could you please check whether this fix has been incorporated into the current CustomLib distributed with GiD 17 and GiD 18?

If not, could you consider applying this modification in a future GiD update?

Our code relies on separate material databases for solid and joint elements, so this issue currently requires users to manually modify the GiD CustomLib file before joint-element analyses can be performed.

Thank you very much for your support.

Kenji

Waseda University

Dear Kenji,

You are absolutely right. I myself have been strugled in that problem more than once.

I am going to apply this change in GiD 18 and, if nothing breaks, it will be delivered in future GiD versions.

However, you can apply the patch without touching the GiD Customlib tcl files.
Just write the function in your tcl code.
Copy all the proc customlib::InitMaterials into your main tcl file and modify it.
Since your code is loaded after the libraries, the function will be overwritten and your code will be executed instead of the original one.

Thanks for your words!

Javi Gárate
GiD Team