| 1031 | |
| 1032 | |
| 1033 | int |
| 1034 | Node::addInertiaLoadToUnbalance(const Vector &accelG, double fact) |
| 1035 | { |
| 1036 | // simply return if node has no mass or R matrix |
| 1037 | if (mass == 0 || R == 0) |
| 1038 | return 0; |
| 1039 | |
| 1040 | // otherwise we must determine MR accelG |
| 1041 | if (accelG.Size() != R->noCols()) { |
| 1042 | opserr << "Node::addInertiaLoadToUnbalance - accelG not of correct dimension"; |
| 1043 | return -1; |
| 1044 | } |
| 1045 | |
| 1046 | // if no load yet create it and assign |
| 1047 | if (unbalLoad == 0) { |
| 1048 | unbalLoad = new Vector(numberDOF); |
| 1049 | if (unbalLoad == 0 || unbalLoad->Size() != numberDOF) { |
| 1050 | opserr << "FATAL Node::addunbalLoad - ran out of memory\n"; |
| 1051 | exit(-1); |
| 1052 | } |
| 1053 | } |
| 1054 | |
| 1055 | // form - fact * M*R*accelG and add it to the unbalanced load |
| 1056 | //(*unbalLoad) -= ((*mass) * (*R) * accelG)*fact; |
| 1057 | |
| 1058 | Matrix MR(mass->noRows(), R->noCols()); |
| 1059 | MR.addMatrixProduct(0.0, *mass, *R, 1.0); |
| 1060 | unbalLoad->addMatrixVector(1.0, MR, accelG, -fact); |
| 1061 | |
| 1062 | return 0; |
| 1063 | } |
| 1064 | |
| 1065 | |
| 1066 |
nothing calls this directly
no test coverage detected