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

Function OPS_RectangularSeries

SRC/domain/pattern/RectangularSeries.cpp:42–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40#include <elementAPI.h>
41
42void *
43OPS_RectangularSeries(void)
44{
45 // Pointer to a uniaxial material that will be returned
46 TimeSeries *theSeries = 0;
47
48 int numRemainingArgs = OPS_GetNumRemainingInputArgs();
49
50 if (numRemainingArgs < 2) {
51 opserr << " Rectangular <tag?> tStart tFinish <-factor cFactor>\n";
52 return 0;
53 }
54
55 int tag = 0; // default tag = 0
56 double dData[3];
57 dData[2] = 1.0; // default cFactor = 1.0
58 int numData = 0;
59
60 // get tag if provided
61 if (numRemainingArgs == 3 || numRemainingArgs == 5) {
62 numData = 1;
63 if (OPS_GetIntInput(&numData, &tag) != 0) {
64 opserr << "WARNING invalid series tag in Rectangular tag? tStart tFinish <-factor cFactor>\n";
65 return 0;
66 }
67 numRemainingArgs -= 1;
68 }
69
70 numData = 2;
71 if (OPS_GetDouble(&numData, dData) != 0) {
72 opserr << "WARNING invalid double data for RectangularSeries with tag: " << tag << endln;
73 return 0;
74 }
75 numRemainingArgs -= 2;
76
77 while (numRemainingArgs > 1) {
78 const char *argvS = OPS_GetString();
79
80 if (strcmp(argvS,"-factor") == 0) {
81 numData = 1;
82 if (OPS_GetDouble(&numData, &dData[2]) != 0) {
83 opserr << "WARNING invalid shift in Trig Series with tag?" << tag << endln;
84 return 0;
85 }
86 } else {
87 opserr << "WARNING unknown option: " << argvS << " in Rectangular Series with tag?" << tag << endln;
88 return 0;
89 }
90 numRemainingArgs -= 2;
91 }
92
93 theSeries = new RectangularSeries(tag, dData[0], dData[1], dData[2]);
94
95 if (theSeries == 0) {
96 opserr << "WARNING ran out of memory creating RectangularSeries with tag: " << tag << "\n";
97 return 0;
98 }
99

Callers 1

Calls 3

OPS_GetIntInputFunction · 0.50
OPS_GetStringFunction · 0.50

Tested by

no test coverage detected