PM4Sand setParameter not working?

Forum for asking and answering questions related to use of the OpenSeesPy module

Moderators: silvia, selimgunay, Moderators

Post Reply
arnkjell
Posts: 2
Joined: Thu Aug 27, 2015 8:34 am
Location: University of California, Berkeley

PM4Sand setParameter not working?

Post by arnkjell »

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?
mhscott
Posts: 880
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: PM4Sand setParameter not working?

Post by mhscott »

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),...
arnkjell
Posts: 2
Joined: Thu Aug 27, 2015 8:34 am
Location: University of California, Berkeley

Re: PM4Sand setParameter not working?

Post by arnkjell »

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"
Post Reply