Return Code in Exit Command

A forum dedicated to feature requests and the future direction of OpenSees, i.e. what would you like, what do you need, what should we explore

Moderators: silvia, selimgunay, Moderators

Post Reply
denavit
Posts: 15
Joined: Mon Nov 13, 2006 1:33 pm
Location: University of Tennessee, Knoxville

Return Code in Exit Command

Post by denavit » Thu Mar 10, 2011 9:11 am

I would like the OpenSees exit command to have the option for a return code the same as the Tcl exit command (http://www.tcl.tk/man/tcl/TclCmd/exit.htm)

The following code in OpenSeesExit within command.cpp should do the trick:

At the beginning:
int returnCode = 0;
if (argc > 1) {
if (Tcl_GetInt(interp, argv[1], &returnCode) != TCL_OK) {
opserr << "WARNING OpenSeesExit -- could not read returnCode \n";
return TCL_ERROR;
}
}

At the end:
Tcl_Exit(returnCode);

Thanks,
Mark

dborello
Posts: 26
Joined: Fri Sep 05, 2008 11:00 am
Location: University of Illinois at Urbana-Champaign

Re: Return Code in Exit Command

Post by dborello » Thu Mar 10, 2011 9:27 am

I would like to second this request.

It is common to "wrap" another program like MATLAB around OpenSees (i.e., generate input, run OpenSees, analyze output). It would be useful to pass errors (such as convergence issues) and state information back upstream without having to analyze the console text.

Dan

oujing999
Posts: 2
Joined: Wed Aug 24, 2011 7:11 pm
Contact:

复件 (39) 16

Post by oujing999 » Thu Aug 25, 2011 12:11 am

Thanks for the information Akash. I foresee that i'm goin to learn alot from here and from you
nike chaussure, nike chaussure homme, nike chaussure femme, chaussure nike air max

yassavoli
Posts: 2
Joined: Mon Jul 22, 2013 6:45 am

Re: Return Code in Exit Command

Post by yassavoli » Tue Jul 23, 2013 12:08 pm

hello everyone,

I'm new in opensees . I want to exit from " for loop command "
please help me ,is the example below true ?
only "EXIT COMMAND "in below is true?

for { set i 3 } { $i <= 10 } {incr i 1 } {;
pattern Plain $i Linear {;
load 52 $h152 $h252 0. 0. 0. $h352
load 53 $h153 $h253 0. 0. 0. $h353
load 54 $h154 $h254 0. 0. 0. $h354
}

analyze $i
set DispCMfile [open Data/DCM.txt r ];

set DCM [read $DispCMfile];

set DCM1 [lindex $D54 2 1];


if {$DCM1 > 0.05 } {;

exit
}
} #end for

fmk
Site Admin
Posts: 5883
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Return Code in Exit Command

Post by fmk » Tue Jul 23, 2013 4:22 pm

you want to use the break command

http://wiki.tcl.tk/1033

yassavoli
Posts: 2
Joined: Mon Jul 22, 2013 6:45 am

Re: Return Code in Exit Command

Post by yassavoli » Wed Jul 24, 2013 5:49 am

thank you very much

Post Reply