| 1001 | } |
| 1002 | |
| 1003 | int |
| 1004 | Node::addUnbalancedLoad(const Vector &add, double fact) |
| 1005 | { |
| 1006 | // check vector arg is of correct size |
| 1007 | if (add.Size() != numberDOF) { |
| 1008 | opserr << "Node::addunbalLoad - load to add of incorrect size "; |
| 1009 | opserr << add.Size() << " should be " << numberDOF << endln; |
| 1010 | return -1; |
| 1011 | } |
| 1012 | |
| 1013 | // if no load yet create it and assign |
| 1014 | if (unbalLoad == 0) { |
| 1015 | unbalLoad = new Vector(add); |
| 1016 | if (unbalLoad == 0) { |
| 1017 | opserr << "FATAL Node::addunbalLoad - ran out of memory\n"; |
| 1018 | exit(-1); |
| 1019 | } |
| 1020 | if (fact != 1.0) |
| 1021 | (*unbalLoad) *= fact; |
| 1022 | return 0; |
| 1023 | } |
| 1024 | |
| 1025 | // add fact*add to the unbalanced load |
| 1026 | unbalLoad->addVector(1.0, add,fact); |
| 1027 | |
| 1028 | return 0; |
| 1029 | } |
| 1030 | |
| 1031 | |
| 1032 |
no test coverage detected