| 964 | |
| 965 | |
| 966 | int |
| 967 | Node::addInertiaLoadToUnbalance(const Vector &accelG, double fact) |
| 968 | { |
| 969 | // simply return if node has no mass or R matrix |
| 970 | if (mass == 0 || R == 0) |
| 971 | return 0; |
| 972 | |
| 973 | // otherwise we must determine MR accelG |
| 974 | if (accelG.Size() != R->noCols()) { |
| 975 | opserr << "Node::addInertiaLoadToUnbalance - accelG not of correct dimension"; |
| 976 | return -1; |
| 977 | } |
| 978 | |
| 979 | // if no load yet create it and assign |
| 980 | if (unbalLoad == 0) { |
| 981 | unbalLoad = new Vector(numberDOF); |
| 982 | if (unbalLoad == 0 || unbalLoad->Size() != numberDOF) { |
| 983 | opserr << "FATAL Node::addunbalLoad - ran out of memory\n"; |
| 984 | exit(-1); |
| 985 | } |
| 986 | } |
| 987 | |
| 988 | // form - fact * M*R*accelG and add it to the unbalanced load |
| 989 | //(*unbalLoad) -= ((*mass) * (*R) * accelG)*fact; |
| 990 | |
| 991 | Matrix MR(mass->noRows(), R->noCols()); |
| 992 | MR.addMatrixProduct(0.0, *mass, *R, 1.0); |
| 993 | unbalLoad->addMatrixVector(1.0, MR, accelG, -fact); |
| 994 | |
| 995 | return 0; |
| 996 | } |
| 997 | |
| 998 | |
| 999 |
no test coverage detected