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

Function OPS_sectionFlexibility

SRC/interpreter/OpenSeesOutputCommands.cpp:2855–2939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2853}
2854
2855int OPS_sectionFlexibility()
2856{
2857 // make sure at least one other argument to contain type of system
2858 if (OPS_GetNumRemainingInputArgs() < 2) {
2859 opserr << "WARNING want - sectionFlexibility eleTag? secNum? \n";
2860 return -1;
2861 }
2862
2863 //opserr << "sectionFlexibility: ";
2864 //for (int i = 0; i < argc; i++)
2865 // opserr << argv[i] << ' ' ;
2866 //opserr << endln;
2867
2868 int numdata = 2;
2869 int data[2];
2870
2871 if (OPS_GetIntInput(&numdata, data) < 0) {
2872 opserr << "WARNING sectionFlexibility eleTag? secNum? - could not read int input? \n";
2873 return -1;
2874 }
2875
2876 int tag = data[0];
2877 int secNum = data[1];
2878
2879 Domain* theDomain = OPS_GetDomain();
2880 if (theDomain == 0) return -1;
2881
2882 Element *theElement = theDomain->getElement(tag);
2883 if (theElement == 0) {
2884 opserr << "WARNING sectionFlexibility element with tag " << tag << " not found in domain \n";
2885 return -1;
2886 }
2887
2888 int argcc = 3;
2889 char a[80] = "section";
2890 char b[80];
2891 sprintf(b, "%d", secNum);
2892 char c[80] = "flexibility";
2893 const char *argvv[3];
2894 argvv[0] = a;
2895 argvv[1] = b;
2896 argvv[2] = c;
2897
2898 DummyStream dummy;
2899
2900 Response *theResponse = theElement->setResponse(argvv, argcc, dummy);
2901 if (theResponse == 0) {
2902 return 0;
2903 }
2904
2905 theResponse->getResponse();
2906 Information &info = theResponse->getInformation();
2907
2908 const Matrix &theMat = *(info.theMatrix);
2909 int nsdof = theMat.noCols();
2910 int size = nsdof*nsdof;
2911 if (size == 0) {
2912 if (OPS_SetDoubleOutput(&size, 0, false) < 0) {

Callers 2

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