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

Method getResponse

SRC/element/twoNodeLink/LinearElasticSpring.cpp:972–1026  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

970
971
972int LinearElasticSpring::getResponse(int responseID, Information &eleInfo)
973{
974 Vector defoAndForce(numDIR*2);
975 Vector &theVec = *(eleInfo.theVector);
976
977 switch (responseID) {
978 case 1: // global forces
979 return eleInfo.setVector(this->getResistingForce());
980
981 case 2: // local forces
982 theVector->Zero();
983 // determine resisting forces in local system
984 theVector->addMatrixTransposeVector(0.0, Tlb, qb, 1.0);
985 // add P-Delta effects to local forces
986 if (Mratio.Size() == 4)
987 this->addPDeltaForces(*theVector, qb);
988
989 return eleInfo.setVector(*theVector);
990
991 case 3: // basic forces
992 return eleInfo.setVector(qb);
993
994 case 4: // local displacements
995 return eleInfo.setVector(ul);
996
997 case 5: // basic displacements
998 return eleInfo.setVector(ub);
999
1000 case 6: // basic deformations and basic forces
1001 defoAndForce.Zero();
1002 defoAndForce.Assemble(ub,0);
1003 defoAndForce.Assemble(qb,numDIR);
1004
1005 return eleInfo.setVector(defoAndForce);
1006
1007 case 20:
1008 theVec(0) = trans(0,0);
1009 theVec(1) = trans(0,1);
1010 theVec(2) = trans(0,2);
1011 return 0;
1012 case 21:
1013 theVec(0) = trans(1,0);
1014 theVec(1) = trans(1,1);
1015 theVec(2) = trans(1,2);
1016 return 0;
1017 case 22:
1018 theVec(0) = trans(2,0);
1019 theVec(1) = trans(2,1);
1020 theVec(2) = trans(2,2);
1021 return 0;
1022
1023 default:
1024 return -1;
1025 }
1026}
1027
1028
1029// set up the transformation matrix for orientation

Callers

nothing calls this directly

Calls 7

addPDeltaForcesMethod · 0.95
getResistingForceMethod · 0.80
setVectorMethod · 0.45
ZeroMethod · 0.45
SizeMethod · 0.45
AssembleMethod · 0.45

Tested by

no test coverage detected