| 2175 | } |
| 2176 | |
| 2177 | int |
| 2178 | Node::addReactionForce(const Vector &add, double factor){ |
| 2179 | |
| 2180 | // create rection vector if have not done so already |
| 2181 | if (reaction == 0) { |
| 2182 | reaction = new Vector(numberDOF); |
| 2183 | if (reaction == 0) { |
| 2184 | opserr << "WARNING Node::addReactionForce() - out of memory\n"; |
| 2185 | return -1; |
| 2186 | } |
| 2187 | } |
| 2188 | |
| 2189 | // check vector of appropraie size |
| 2190 | if (add.Size() != numberDOF) { |
| 2191 | opserr << "WARNING Node::addReactionForce() - vector not of correct size\n"; |
| 2192 | return -1; |
| 2193 | } |
| 2194 | |
| 2195 | if (factor == 1.0) |
| 2196 | *reaction += add; |
| 2197 | else if (factor == -1.0) |
| 2198 | *reaction -= add; |
| 2199 | else |
| 2200 | *reaction = add * factor; |
| 2201 | |
| 2202 | return 0; |
| 2203 | } |
| 2204 | |
| 2205 | int |
| 2206 | Node::resetReactionForce(int flag){ |
no test coverage detected