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

Function OPS_sectionStiffness

SRC/interpreter/OpenSeesOutputCommands.cpp:2769–2853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2767}
2768
2769int OPS_sectionStiffness()
2770{
2771 // make sure at least one other argument to contain type of system
2772 if (OPS_GetNumRemainingInputArgs() < 2) {
2773 opserr << "WARNING want - sectionStiffness eleTag? secNum? \n";
2774 return -1;
2775 }
2776
2777 //opserr << "sectionStiffness: ";
2778 //for (int i = 0; i < argc; i++)
2779 // opserr << argv[i] << ' ' ;
2780 //opserr << endln;
2781
2782 int numdata = 2;
2783 int data[2];
2784
2785 if (OPS_GetIntInput(&numdata, data) < 0) {
2786 opserr << "WARNING sectionStiffness eleTag? secNum? - could not read int input? \n";
2787 return -1;
2788 }
2789
2790 int tag = data[0];
2791 int secNum = data[1];
2792
2793 Domain* theDomain = OPS_GetDomain();
2794 if (theDomain == 0) return -1;
2795
2796 Element *theElement = theDomain->getElement(tag);
2797 if (theElement == 0) {
2798 opserr << "WARNING sectionStiffness element with tag " << tag << " not found in domain \n";
2799 return -1;
2800 }
2801
2802 int argcc = 3;
2803 char a[80] = "section";
2804 char b[80];
2805 sprintf(b, "%d", secNum);
2806 char c[80] = "stiffness";
2807 const char *argvv[3];
2808 argvv[0] = a;
2809 argvv[1] = b;
2810 argvv[2] = c;
2811
2812 DummyStream dummy;
2813
2814 Response *theResponse = theElement->setResponse(argvv, argcc, dummy);
2815 if (theResponse == 0) {
2816 return 0;
2817 }
2818
2819 theResponse->getResponse();
2820 Information &info = theResponse->getInformation();
2821
2822 const Matrix &theMat = *(info.theMatrix);
2823 int nsdof = theMat.noCols();
2824 int size = nsdof*nsdof;
2825 if (size == 0) {
2826 if (OPS_SetDoubleOutput(&size, 0, false) < 0) {

Callers 2

Tcl_ops_sectionStiffnessFunction · 0.85
Py_ops_sectionStiffnessFunction · 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
noColsMethod · 0.45

Tested by

no test coverage detected