Hi all,
First, thanks for the great work with OpenSeesPy - extremely useful with the Python integration of OpenSees.
I'm trying to run the two example scripts that are linked in the original PM4Sand OpenSees documentation with OpenSeesPy (https://opensees.berkeley.edu/wiki/inde ... d_Material). However, it seems that 'setParameter' is not working in the OpenSeesPy version. Specifically, the two tcl commands:
setParameter -value 0 -ele 1 FirstCall 1
setParameter -value 0.3 -ele 1 poissonRatio 1
which I have mirrored to OpenSeesPy as:
ops.setParameter('-val', 0, '-ele', 1, 'FirstCall', 1)
ops.setParameter('-val', 0.3, '-ele', 1, 'poissonRatio', 1)
does not seem to work, i.e., nothing happens when the commands are called and consequently the analysis diverges during the shear loading phase.
Any ideas on how to overcome this? Is my syntax wrong or is there a bug?
PM4Sand setParameter not working?
Moderators: silvia, selimgunay, Moderators
Re: PM4Sand setParameter not working?
I think it's the same issue as with recorders: https://wp.me/pbejzW-Si
Try putting the str around the non-string arguments, e.g., '-val',str(0.3),...
Try putting the str around the non-string arguments, e.g., '-val',str(0.3),...
Re: PM4Sand setParameter not working?
Thanks for the quick reply.
I tried now and wrapping one of the arguments in a string indeed did the trick. However, it was not the value argument, but rather the material number at the end of the command that needed a string, i.e.:
ops.setParameter('-val', 0.3, '-ele', 1, 'poissonRatio', str(1))
Trying to put the value argument in a string, ops.setParameter('-val', str(0.3), '-ele', 1, 'poissonRatio', 1), just caused an error: "WARNING: failed to get paramber value"
I tried now and wrapping one of the arguments in a string indeed did the trick. However, it was not the value argument, but rather the material number at the end of the command that needed a string, i.e.:
ops.setParameter('-val', 0.3, '-ele', 1, 'poissonRatio', str(1))
Trying to put the value argument in a string, ops.setParameter('-val', str(0.3), '-ele', 1, 'poissonRatio', 1), just caused an error: "WARNING: failed to get paramber value"