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

Function OPS_sectionForce

SRC/interpreter/OpenSeesOutputCommands.cpp:2581–2673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2579}
2580
2581int OPS_sectionForce()
2582{
2583 // make sure at least one other argument to contain type of system
2584 if (OPS_GetNumRemainingInputArgs() < 2) {
2585 opserr << "WARNING want - sectionForce eleTag? secNum? <dof?> \n";
2586 return -1;
2587 }
2588
2589 //opserr << "sectionForce: ";
2590 //for (int i = 0; i < argc; i++)
2591 // opserr << argv[i] << ' ' ;
2592 //opserr << endln;
2593
2594 int numdata = 2;
2595 int data[3];
2596
2597 if (OPS_GetIntInput(&numdata, data) < 0) {
2598 opserr << "WARNING sectionForce eleTag? secNum? <dof?> - could not read int input? \n";
2599 return -1;
2600 }
2601
2602 int tag = data[0];
2603 int secNum = data[1];
2604 int dof = -1;
2605
2606 Domain* theDomain = OPS_GetDomain();
2607 if (theDomain == 0) return -1;
2608
2609 Element *theElement = theDomain->getElement(tag);
2610 if (theElement == 0) {
2611 opserr << "WARNING sectionForce element with tag " << tag << " not found in domain \n";
2612 return -1;
2613 }
2614
2615 int argcc = 3;
2616 char a[80] = "section";
2617 char b[80];
2618 sprintf(b, "%d", secNum);
2619 char c[80] = "force";
2620 const char *argvv[3];
2621 argvv[0] = a;
2622 argvv[1] = b;
2623 argvv[2] = c;
2624
2625 DummyStream dummy;
2626
2627 Response *theResponse = theElement->setResponse(argvv, argcc, dummy);
2628 if (theResponse == 0) {
2629 return 0;
2630 }
2631
2632 theResponse->getResponse();
2633 Information &info = theResponse->getInformation();
2634 const Vector &theVec = *(info.theVector);
2635
2636 if (OPS_GetNumRemainingInputArgs() > 0) {
2637 numdata = 1;
2638 if (OPS_GetIntInput(&numdata, &dof) < 0) {

Callers 2

Tcl_ops_sectionForceFunction · 0.85
Py_ops_sectionForceFunction · 0.85

Calls 9

push_backMethod · 0.80
OPS_GetIntInputFunction · 0.70
OPS_GetDomainFunction · 0.70
OPS_SetDoubleOutputFunction · 0.70
getElementMethod · 0.45
setResponseMethod · 0.45
getResponseMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected