| 998 | |
| 999 | |
| 1000 | int |
| 1001 | Node::addInertiaLoadSensitivityToUnbalance(const Vector &accelG, double fact, bool somethingRandomInMotions) |
| 1002 | { |
| 1003 | // simply return if node has no mass or R matrix |
| 1004 | if (mass == 0 || R == 0) |
| 1005 | return 0; |
| 1006 | |
| 1007 | // otherwise we must determine MR accelG |
| 1008 | if (accelG.Size() != R->noCols()) { |
| 1009 | opserr << "Node::addInertiaLoadToUnbalance - accelG not of correct dimension"; |
| 1010 | return -1; |
| 1011 | } |
| 1012 | |
| 1013 | // if no load yet create it and assign |
| 1014 | if (unbalLoad == 0) { |
| 1015 | unbalLoad = new Vector(numberDOF); |
| 1016 | if (unbalLoad == 0 || unbalLoad->Size() != numberDOF) { |
| 1017 | opserr << "FATAL Node::addunbalLoad - ran out of memory\n"; |
| 1018 | exit(-1); |
| 1019 | } |
| 1020 | } |
| 1021 | |
| 1022 | // form - fact * M*R*accelG and add it to the unbalanced load |
| 1023 | //(*unbalLoad) -= ((*mass) * (*R) * accelG)*fact; |
| 1024 | |
| 1025 | |
| 1026 | Matrix massSens(mass->noRows(),mass->noCols()); |
| 1027 | massSens = this->getMassSensitivity(); |
| 1028 | |
| 1029 | Matrix MR(mass->noRows(), R->noCols()); |
| 1030 | |
| 1031 | if (somethingRandomInMotions) { |
| 1032 | MR.addMatrixProduct(0.0, *mass, *R, 1.0); |
| 1033 | } |
| 1034 | else { |
| 1035 | MR.addMatrixProduct(0.0, massSens, *R, 1.0); |
| 1036 | } |
| 1037 | unbalLoad->addMatrixVector(1.0, MR, accelG, -fact); |
| 1038 | |
| 1039 | return 0; |
| 1040 | } |
| 1041 | |
| 1042 | |
| 1043 |
no test coverage detected