Updating the material name

Hello,

I am developing a problem type with customlib. It is based on the ‘cmas2d_customlib’ example and inherited a problem with updating the material name.
For example, in the ‘cmas2d_customlib’ problem type:

  • When applying a ‘Shells’ condition, you need to choose a material in the list and apply it to a group:
    001.png
  • The resulting data tree is the following:
    002.png
  • But, if you change the name of the material after that, the ‘Shells’ condition does not automatically update:
    003.png
  • To update the material name in the ‘Shells’ condition, it is necessary to open ‘Shells’ and select the material again in the list:
    004.png
  • And only after that, the data tree is correct again:
    005.png

The same issue is found in the Kratos problem type, with the ‘Parts’ condition and the materials, but in this case, it is worse because the parameters are not updated too.
There is a more elegant way to update the ‘Shells’ condition automatically with the changes made in the materials?
There is a way to adapt the *.spd file (maybe with some help of TCL) to avoid this behavior?

Regards,
Francisco Dias

Probably this better behaviour could be implemented in the problemtype with some dependency…

But it is not so common to rename an existing material that has been assigned.
e.g.
if you assign as ‘concrete’ an entity, and this ‘concrete’ is renamed to ‘steel’ and its properties are changed to steel values,
probably the user don’t wanted this entity being like steel.

The common way is to create a new material, copying another (click the rigth-button-mouse over the material and select copy)
and then set the name an properties you want, and assign it to entities.

but I agree that renaming something the ‘pointing’ uses must be updated, if possible.