Return Code in Exit Command
Moderators: silvia, selimgunay, Moderators
Return Code in Exit Command
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
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
-
- Posts: 26
- Joined: Fri Sep 05, 2008 11:00 am
- Location: University of Illinois at Urbana-Champaign
Re: Return Code in Exit Command
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
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
复件 (39) 16
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
Re: Return Code in Exit Command
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
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
Re: Return Code in Exit Command
thank you very much