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

Method addInertiaLoadToUnbalance

DEVELOPER/core/Node.cpp:1033–1063  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1031
1032
1033int
1034Node::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

Callers

nothing calls this directly

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