MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / OPS_save

Function OPS_save

SRC/interpreter/OpenSeesCommands.cpp:3032–3061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3030}
3031
3032int OPS_save()
3033{
3034 if (cmds == 0) return 0;
3035 // make sure at least one other argument to contain type of system
3036 if (OPS_GetNumRemainingInputArgs() < 1) {
3037 opserr << "WARNING save no commit tag - want save commitTag?";
3038 return -1;
3039 }
3040
3041 // check argv[1] for commitTag
3042 int commitTag;
3043 int numdata = 1;
3044 if (OPS_GetIntInput(&numdata, &commitTag) < 0) {
3045 opserr << "WARNING - save could not read commitTag " << endln;
3046 return -1;
3047 }
3048
3049 FE_Datastore* theDatabase = cmds->getDatabase();
3050 if (theDatabase == 0) {
3051 opserr << "WARNING: save - no database has been constructed\n";
3052 return -1;
3053 }
3054
3055 if (theDatabase->commitState(commitTag) < 0) {
3056 opserr << "WARNING - database failed to commitState \n";
3057 return -1;
3058 }
3059
3060 return 0;
3061}
3062
3063int OPS_restore()
3064{

Callers 2

Tcl_ops_saveFunction · 0.85
Py_ops_saveFunction · 0.85

Calls 4

getDatabaseMethod · 0.80
OPS_GetIntInputFunction · 0.70
commitStateMethod · 0.45

Tested by

no test coverage detected