MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / addInertiaLoadToUnbalance

Method addInertiaLoadToUnbalance

SRC/domain/node/Node.cpp:966–996  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

964
965
966int
967Node::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

Callers 1

applyLoadMethod · 0.45

Calls 6

exitFunction · 0.85
SizeMethod · 0.45
noColsMethod · 0.45
noRowsMethod · 0.45
addMatrixProductMethod · 0.45
addMatrixVectorMethod · 0.45

Tested by

no test coverage detected