| 2135 | } |
| 2136 | |
| 2137 | int |
| 2138 | Node::addReactionForce(const Vector &add, double factor){ |
| 2139 | |
| 2140 | // create rection vector if have not done so already |
| 2141 | if (reaction == 0) { |
| 2142 | reaction = new Vector(numberDOF); |
| 2143 | if (reaction == 0) { |
| 2144 | opserr << "WARNING Node::addReactionForce() - out of memory\n"; |
| 2145 | return -1; |
| 2146 | } |
| 2147 | } |
| 2148 | |
| 2149 | // check vector of appropraie size |
| 2150 | if (add.Size() != numberDOF) { |
| 2151 | opserr << "WARNING Node::addReactionForce() - vector not of correct size\n"; |
| 2152 | return -1; |
| 2153 | } |
| 2154 | |
| 2155 | if (factor == 1.0) |
| 2156 | *reaction += add; |
| 2157 | else if (factor == -1.0) |
| 2158 | *reaction -= add; |
| 2159 | else |
| 2160 | //*reaction = add * factor; |
| 2161 | reaction->addVector(1.0,add,factor); |
| 2162 | |
| 2163 | return 0; |
| 2164 | } |
| 2165 | |
| 2166 | int |
| 2167 | Node::resetReactionForce(int flag){ |
no test coverage detected