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

Method setMass

SRC/domain/node/Node.cpp:1268–1291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1266
1267
1268int
1269Node::setMass(const Matrix &newMass)
1270{
1271 // check right size
1272 if (newMass.noRows() != numberDOF || newMass.noCols() != numberDOF) {
1273 opserr << "Node::setMass - incompatible matrices\n";
1274 return -1;
1275 }
1276
1277 // create a matrix if no mass yet set
1278 if (mass == 0) {
1279 mass = new Matrix(newMass);
1280 if (mass == 0 || mass->noRows() != numberDOF) {
1281 opserr << "FATAL Node::setMass - ran out of memory\n";
1282 return -1;
1283 }
1284 return 0;
1285 }
1286
1287 // assign if mass has already been created
1288 (*mass) = newMass;
1289
1290 return 0;
1291}
1292
1293
1294

Callers 12

discretizeMethod · 0.45
discretizeMethod · 0.45
discretizeMethod · 0.45
OPS_addNodalMassFunction · 0.45
ops_addNodalMassFunction · 0.45
TclCommand_addNodeFunction · 0.45
TclCommand_addNodalMassFunction · 0.45
OPS_NodeFunction · 0.45
mainFunction · 0.45
updateNodalMassesMethod · 0.45
TclCommand_addNodeFunction · 0.45
TclCommand_addNodalMassFunction · 0.45

Calls 2

noRowsMethod · 0.45
noColsMethod · 0.45

Tested by 1

mainFunction · 0.36