Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set-parameter commands don't work anymore!!! #1107

Open
amnp95 opened this issue Jan 10, 2023 · 4 comments
Open

set-parameter commands don't work anymore!!! #1107

amnp95 opened this issue Jan 10, 2023 · 4 comments

Comments

@amnp95
Copy link
Contributor

amnp95 commented Jan 10, 2023

Hello.
I just tested the codes we used before and it was right but now all the setparameter commands give an error regarding to the "tag of parameters is already exist in the model". For example if you want to update the possion ratio for an ND Material like this:

op.setParameter('-val', 0.3, '-ele',1, 'poissonRatio', '1')
or
setParameter -value 0.3 -ele 1 poissonRatio

I don't know if somthing changed in the command with new commits or it is a bug.

@amnp95 amnp95 changed the title all the setparameters commnads doesn't work!!!! all the setparameters commnads don't work!!!! Jan 10, 2023
@amnp95 amnp95 changed the title all the setparameters commnads don't work!!!! set-parameter commands don't work anymore!!! Jan 10, 2023
@mhscott
Copy link
Member

mhscott commented Jan 11, 2023

Sorry, this was something I changed. @MassimoPetracca has a good work around until OpenSeesPy is updated.

@mhscott
Copy link
Member

mhscott commented Jan 11, 2023

Sorry to call you out @MassimoPetracca, but I think this is the same problem someone posted about in the OpenSees Facebook group and you had a good solution.

@MassimoPetracca
Copy link
Contributor

@amnp95 This was solved in PR #1078
As @mhscott said, until OpenSeesPy is updated, you can follow a workaround discussed here link

Basically, you can manually do what setParameter does behind the scenes:

replace
setParameter -value 0.3 -ele 1 poissonRatio

with a combination of
set dummy_param_id -12345; #just use a dummy Tag not used in any other parameter in your model
parameter $dummy_param_id
addToParameter $dummy_param_id element 1 poissonRatio
updateParameter $dummy_param_id 0.3
remove parameter $dummy_param_id

If you don't want to replace all your calls to setParameter, you can create a Tcl procedure (or a Python function) that shadows the original implementation until the next version will be released

@mhscott mhscott pinned this issue Feb 23, 2023
@mhscott mhscott unpinned this issue May 12, 2023
@zhongdigood
Copy link

@amnp95 This was solved in PR #1078 As @mhscott said, until OpenSeesPy is updated, you can follow a workaround discussed here link

Basically, you can manually do what setParameter does behind the scenes:

replace setParameter -value 0.3 -ele 1 poissonRatio

with a combination of set dummy_param_id -12345; #just use a dummy Tag not used in any other parameter in your model parameter $dummy_param_id addToParameter $dummy_param_id element 1 poissonRatio updateParameter $dummy_param_id 0.3 remove parameter $dummy_param_id

If you don't want to replace all your calls to setParameter, you can create a Tcl procedure (or a Python function) that shadows the original implementation until the next version will be released

Hello! I did not find setparameter and updateparameter in the source nDMaterial.cpp. Can you tell me how to implement updateParameter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants