| 153 | } |
| 154 | |
| 155 | int |
| 156 | IncrementalIntegrator::getLastResponse(Vector &result, const ID &id) |
| 157 | { |
| 158 | |
| 159 | if (theSOE == 0) { |
| 160 | opserr << "WARNING IncrementalIntegrator::getLastResponse() -"; |
| 161 | opserr << "no LineaerSOE object associated with this object\n"; |
| 162 | return -1; |
| 163 | } |
| 164 | |
| 165 | int res = 0; |
| 166 | int size = theSOE->getNumEqn() -1; |
| 167 | const Vector &X = theSOE->getX(); |
| 168 | for (int i=0; i<id.Size(); i++) { |
| 169 | int loc = id(i); |
| 170 | if (loc < 0 ) |
| 171 | result(i) = 0.0; |
| 172 | else if (loc <= size) { |
| 173 | result(i) = X(loc); |
| 174 | } |
| 175 | else { |
| 176 | opserr << "WARNING IncrementalIntegrator::getLastResponse() -"; |
| 177 | opserr << "location " << loc << "in ID outside bounds "; |
| 178 | opserr << size << "\n"; |
| 179 | res = -2; |
| 180 | } |
| 181 | } |
| 182 | return res; |
| 183 | } |
| 184 | |
| 185 | |
| 186 | int |
no test coverage detected