| 84 | } |
| 85 | |
| 86 | int |
| 87 | SumElementForcesRecorder::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 | |
| 133 | int |
| 134 | SumElementForcesRecorder::restart(void) |
nothing calls this directly
no test coverage detected