How to check if the analyze is completed?

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
XiaoxuD
Posts: 8
Joined: Wed Feb 15, 2017 1:22 am
Location: csu

How to check if the analyze is completed?

Post by XiaoxuD »

Here is a simple code of the question.

...
analyze 1 0.01;
puts [nodeDisp 5 1]

Do I need to check whether the analyze has been completed before the nodeDisp and nodeReaction are used?
That's to say, if "analyze" and "nodeDisp" are asynchronous and the "analyze" is not completed before the execution of "nodeDisp" command, wrong or old value may be obtained.
If it's not guaranteed that the execution of "nodeDisp" will wait until the "analyze" is completed, how to check whether the "analyze" is completed?
selimgunay
Posts: 916
Joined: Mon Sep 09, 2013 8:50 pm
Location: University of California, Berkeley

Re: How to check if the analyze is completed?

Post by selimgunay »

Best way is to save the data using recorders. You don't have the problem that you described with recorders
XiaoxuD
Posts: 8
Joined: Wed Feb 15, 2017 1:22 am
Location: csu

Re: How to check if the analyze is completed?

Post by XiaoxuD »

If using recorders, I will have to parse the file to get data, which will make the program more trivial.
I wonder whether there is a method/command to get the running state of the "analyze", i.e. running, stopped ....
If the real time running state of the "analyze" can be obtained, the program will be more simple.
Thank you.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: How to check if the analyze is completed?

Post by fmk »

set ok [analyze 1]
puts $ok

will output 0 if it worked, other number if did not.
Post Reply