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?
Try putting the str around the non-string arguments, e.g., '-val',str(0.3),...
OpenSees courses: https://courses.silviasbrainery.com/
OpenSees 1-on-1 sessions: https://www.silviasbrainery.com/one-on-one-training
OpenSees blog: www.portwooddigital.com
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"