| 1065 | |
| 1066 | |
| 1067 | int |
| 1068 | Node::addInertiaLoadSensitivityToUnbalance(const Vector &accelG, double fact, bool somethingRandomInMotions) |
| 1069 | { |
| 1070 | // simply return if node has no mass or R matrix |
| 1071 | if (mass == 0 || R == 0) |
| 1072 | return 0; |
| 1073 | |
| 1074 | // otherwise we must determine MR accelG |
| 1075 | if (accelG.Size() != R->noCols()) { |
| 1076 | opserr << "Node::addInertiaLoadToUnbalance - accelG not of correct dimension"; |
| 1077 | return -1; |
| 1078 | } |
| 1079 | |
| 1080 | // if no load yet create it and assign |
| 1081 | if (unbalLoad == 0) { |
| 1082 | unbalLoad = new Vector(numberDOF); |
| 1083 | if (unbalLoad == 0 || unbalLoad->Size() != numberDOF) { |
| 1084 | opserr << "FATAL Node::addunbalLoad - ran out of memory\n"; |
| 1085 | exit(-1); |
| 1086 | } |
| 1087 | } |
| 1088 | |
| 1089 | // form - fact * M*R*accelG and add it to the unbalanced load |
| 1090 | //(*unbalLoad) -= ((*mass) * (*R) * accelG)*fact; |
| 1091 | |
| 1092 | |
| 1093 | Matrix massSens(mass->noRows(),mass->noCols()); |
| 1094 | massSens = this->getMassSensitivity(); |
| 1095 | |
| 1096 | Matrix MR(mass->noRows(), R->noCols()); |
| 1097 | |
| 1098 | if (somethingRandomInMotions) { |
| 1099 | MR.addMatrixProduct(0.0, *mass, *R, 1.0); |
| 1100 | } |
| 1101 | else { |
| 1102 | MR.addMatrixProduct(0.0, massSens, *R, 1.0); |
| 1103 | } |
| 1104 | unbalLoad->addMatrixVector(1.0, MR, accelG, -fact); |
| 1105 | |
| 1106 | return 0; |
| 1107 | } |
| 1108 | |
| 1109 | |
| 1110 |
nothing calls this directly
no test coverage detected