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

Function OPS_sdfResponse

SRC/analysis/analysis/SDFAnalysis.cpp:26–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include <elementAPI.h>
25
26int OPS_sdfResponse()
27{
28 int numData = 1;
29 double uresidual = 0.0;
30 double umaxprev = 0.0;
31
32 int numOptionalArgs = 0;
33 int numArgs = OPS_GetNumRemainingInputArgs();
34 double t_end = 0.0; bool t_end_specified = false;
35 while (OPS_GetNumRemainingInputArgs() > 0) {
36 std::string type = OPS_GetString();
37 if (type == "-tend") {
38 numOptionalArgs++;
39 if (OPS_GetNumRemainingInputArgs() > 0) {
40 numData = 1;
41 if (OPS_GetDoubleInput(&numData, &t_end) < 0) {
42 opserr << "ERROR sdfResponse - failed to read tend" << endln;
43 return 0;
44 }
45 numOptionalArgs++;
46 t_end_specified = true;
47 }
48 }
49 if (type == "-uresid" || type == "-uresidual") {
50 numOptionalArgs++;
51 if (OPS_GetNumRemainingInputArgs() > 0) {
52 numData = 1;
53 if (OPS_GetDoubleInput(&numData, &uresidual) < 0) {
54 opserr << "ERROR sdfResponse - failed to read uresidual" << endln;
55 return 0;
56 }
57 numOptionalArgs++;
58 }
59 }
60 if (type == "-umaxprev") {
61 numOptionalArgs++;
62 if (OPS_GetNumRemainingInputArgs() > 0) {
63 numData = 1;
64 if (OPS_GetDoubleInput(&numData, &umaxprev) < 0) {
65 opserr << "ERROR sdfResponse - failed to read umaxprev" << endln;
66 return 0;
67 }
68 numOptionalArgs++;
69 }
70 }
71 }
72
73 if (numArgs > 0) {
74 OPS_ResetCurrentInputArg(-numArgs);
75 }
76 numArgs = numArgs - numOptionalArgs;
77
78 if (numArgs < 7 || numArgs > 8) {
79 opserr << "Incorrect number of arguments to sdfResponse --";
80 opserr << "m, zeta, k, Fy, alpha, dtF, filename, dt, <-uresidual, uresid, -umaxprev, umaxp, -tend, tend>" << endln;
81 opserr << "m, zeta, k, Fy, alpha, tsTag, dt, <-uresidual, uresid, -umaxprev, umaxp, -tend, tend>" << endln;
82 return -1;
83 }

Callers 3

Tcl_ops_sdfResponseFunction · 0.85
Py_ops_sdfResponseFunction · 0.85
sdfResponseFunction · 0.85

Calls 10

OPS_getTimeSeriesFunction · 0.85
OPS_GetStringFunction · 0.50
OPS_GetDoubleInputFunction · 0.50
OPS_ResetCurrentInputArgFunction · 0.50
OPS_GetIntInputFunction · 0.50
OPS_SetDoubleOutputFunction · 0.50
getStartTimeMethod · 0.45
getDurationMethod · 0.45
getFactorMethod · 0.45

Tested by

no test coverage detected