After solving a model in an API, I need to use Zienkiewicz-Zhu Von Mises stress, but if the variable is not in the solution tree, the command
solution.node_value("zzvonmises", n)
return something with no type.
If I manually add Zienkiewicz-Zhu Von Mises stress to the solution tree it works fine, buy I don't want to do this manually.
Is there an API command to add an allready calculated variable (like Zienkiewicz-Zhu Von Mises stress) in the solution tree? or to make it possible to use with a command like
solution.node_value("zzvonmises", n)
Comments
Is there a command to delete unused nodes in an API?
You can add the Zienkiewicz-Zhu von Mises stress item to the outline tree with wrong values using
solution.set_variable("zzvonmises", solution.all_nodes())
then next time you solve, it'll put the correct values in.
There also isn't currently a command to delete unused nodes. You could do it by iterating over the elements and storing the nodes that are used, then deleting the others. That wouldn't be exactly the same since it'd delete node-surface coupling reference nodes that aren't on elements.
I think it could do the job if you add the script attached before solving...