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

Method record

DEVELOPER/recorder/SumElementForcesRecorder.cpp:86–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86int
87SumElementForcesRecorder::record(int commitTag, double timeStamp)
88{
89 // check for initialization
90 if (data == 0) {
91 opserr << "SumElementForcesRecorder::record() - setDomain() has not been called\n";
92 return -1;
93 }
94
95 // zero the data vector
96 data->Zero();
97
98 int forceSize = data->Size();
99 int startLoc = 0;
100
101
102 // write the time if echTimeFlag set
103 if (echoTimeFlag == true) {
104 (*data)(0) = timeStamp;
105 forceSize -= 1;
106 startLoc = 1;
107 }
108
109 //
110 // for each element that has been added to theElements add force contribution
111 //
112
113 for (int i=0; i< numEle; i++) {
114 if (theElements[i] != 0) {
115 int loc = startLoc;
116 const Vector &force = theElements[i]->getResistingForce();
117 int forceSize = force.Size();
118 for (int j=0; j<forceSize; j++, loc++)
119 (*data)(loc) += force(j);
120 }
121 }
122
123 //
124 // send the response vector to the output handler for o/p
125 //
126
127 theOutput->write(*data);
128
129 // successful completion - return 0
130 return 0;
131}
132
133int
134SumElementForcesRecorder::restart(void)

Callers

nothing calls this directly

Calls 4

getResistingForceMethod · 0.80
ZeroMethod · 0.45
SizeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected