Using two editable material property dataset in cmas2d_customlib.gid example

Moderator: GiD Team

Post Reply
waseda
Posts: 13
Joined: Thu Dec 24, 2015 4:31 am
Location: Japan
Contact:

Using two editable material property dataset in cmas2d_customlib.gid example

Post by waseda »

Hi,

Starting from cmas2d_customlib.gid example, I’ve been trying to set up my own problemtype. Here, I revised the preprocess files to accomodate two editable material data sets. In GiD, I can access to and edit the two material data sets but I’m getting some error messages in GiD when moving to Calculate step.

Below is what I changed in the preprocess files.

In the spd file, I put two property sections for the two material data sets. The actual data set is described in separate files (materials.xml and materials_joint.xml).

<!-- solid properties -->
<container n="Properties_solid" pn="Solid properties" icon="darkorange-shellfish-18" help="Define your materials database and apply them to the volumes of your problem">
<condition n="Solids" pn="Solids" ov="volume" ovm="element" ov_element_types="hexahedra" icon="darkorange-shellfish-18" groups_icon="yelowish-group" help="Select your material and the surfaces related to it">
<value n="material" pn="material solid" editable='0' help="Choose a material from the database" values='[Cmas2d::GetMaterialsList %W]' v="Reservoir">
<edit_command n="Edit materials" pn="Edit materials" icon="darkorange-block1.png" proc='Cmas2d::EditDatabaseListDirect %W %DICT %BC'/>
</value>
</condition>
<include path="xml/materials.xml"/>
</container>

<!-- joint properties -->
<container n="Properties_joint" pn="Joint properties" icon="darkorange-shellfish-18" help="Define your materials database and apply them to the volumes of your problem">
<condition n="Joints" pn="Joints" ov="surface" ovm="element" ov_element_types="quadrilateral" icon="darkorange-shellfish-18" groups_icon="yelowish-group" help="Select your material and the surfaces related to it">
<value n="material" pn="material joint" editable='0' help="Choose a material from the database" values='[Cmas2d::GetMaterialsListJoint %W]' v="Joint1">
<edit_command n="Edit materials" pn="Edit materials" icon="darkorange-block1.png" proc='Cmas2d::EditDatabaseListDirectJoint %W %DICT %BC'/>
</value>
</condition>
<include path="xml/materials_joint.xml"/>
</container>
</wFAST_data>

To link to the two datasets, I prepared separate procedures:
Cmas2d::GetMaterialsList and Cmas2d::GetMaterialsListJoint
Cmas2d::EditDatabaseListDirect and Cmas2d::EditDatabaseListDirectJoint.

Attached is a screenshot of the error message. It seems like when writing out the material properties in input file, it encounters an error…
2023-08-20_11-34-31.jpg
2023-08-20_11-34-31.jpg (157.96 KiB) Viewed 3960 times
I’ve also attached the problemtype files I prepared. I would really appreciate if you can give me some advice.

Regards,

Kenji
Attachments
wFAST.gid.zip
(1.33 MiB) Downloaded 92 times
User avatar
fjgarate
Posts: 5
Joined: Wed Nov 18, 2015 8:11 pm

Re: Using two editable material property dataset in cmas2d_customlib.gid example

Post by fjgarate »

Dear waseda

Sorry for the late response.

I've found a bug in the GID code thanks to your query. It will be fixed in the next GiD version

You can fix it in your installed gid so you can keep on working.

In the GiD installation folder, find the file scripts\customlib_extras\customlib_extras.tcl
Find the function customlib::InitMaterials
One of the lines in this function is:

Code: Select all

set xp2 {.//container[@n="materials"]/blockdata[@n="material"]}
Please, repace it with

Code: Select all

set xp2 {.//blockdata[@n="material"]}
I could not test it with real data since I don't have an example.
Please let me know if it worked for you.

Javi Gárate
GiD Team
waseda
Posts: 13
Joined: Thu Dec 24, 2015 4:31 am
Location: Japan
Contact:

Re: Using two editable material property dataset in cmas2d_customlib.gid example

Post by waseda »

Javi,

Thank you for your answering my question. I changed the code in scripts\customlib_extras\customlib_extras.tcl as you suggested. It worked ok after restarting GiD. Again, thanks for you help!!!

Attached are the example and problemtypes used for the test. (I just wanted to share this for others as future reference.)
Attachments
wFAST2.gid.zip
(171.04 KiB) Downloaded 92 times
test.gid.zip
(34.82 KiB) Downloaded 105 times
Post Reply