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

Method getElementResponse

DEVELOPER/core/Domain.cpp:1605–1644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1603static Vector responseData(0);
1604
1605const Vector *
1606Domain::getElementResponse(int eleTag, const char **argv, int argc)
1607{
1608 Element *theEle = this->getElement(eleTag);
1609 if (theEle == 0)
1610 return NULL;
1611 else {
1612
1613 if (argc == 1) {
1614 if (strcmp(argv[0],"forces") == 0) {
1615 return &(theEle->getResistingForce());
1616 } else if (strcmp(argv[0],"nodeTags") == 0) {
1617 const ID&theNodes = theEle->getExternalNodes();
1618 int size = theNodes.Size();
1619 if (responseData.Size() != size)
1620 responseData.resize(size);
1621 for (int i=0; i<size; i++)
1622 responseData(i) = theNodes(i);
1623 return &responseData;
1624 }
1625 }
1626
1627 DummyStream dummy;
1628 Response *theResponse = theEle->setResponse(argv, argc, dummy);
1629 if (theResponse == 0) {
1630 return 0;
1631 }
1632
1633 if (theResponse->getResponse() < 0) {
1634 delete theResponse;
1635 return 0;
1636 }
1637
1638 Information &eleInfo = theResponse->getInformation();
1639 //const Vector *data = &(eleInfo.getData());
1640 responseData = eleInfo.getData();
1641 delete theResponse;
1642 return &responseData;
1643 }
1644}
1645
1646
1647Graph &

Callers

nothing calls this directly

Calls 7

getElementMethod · 0.95
getResistingForceMethod · 0.80
SizeMethod · 0.45
resizeMethod · 0.45
setResponseMethod · 0.45
getResponseMethod · 0.45
getDataMethod · 0.45

Tested by

no test coverage detected