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

Function OPS_sectionLocation

SRC/material/section/SectionForceDeformation.cpp:103–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103int OPS_sectionLocation()
104{
105 // make sure at least one other argument to contain type of system
106 if (OPS_GetNumRemainingInputArgs() < 1) {
107 opserr << "WARNING want - sectionLocation eleTag? <secNum?> \n";
108 return -1;
109 }
110
111 //opserr << "sectionLocation: ";
112 //for (int i = 0; i < argc; i++)
113 // opserr << argv[i] << ' ' ;
114 //opserr << endln;
115
116 int numdata = 1;
117 int tag;
118 if (OPS_GetIntInput(&numdata, &tag) < 0) {
119 opserr << "WARNING sectionLocation eleTag? <secNum?> - could not read int input? \n";
120 return -1;
121 }
122
123 int secNum = 0;
124 if (OPS_GetNumRemainingInputArgs() > 0) {
125 if (OPS_GetIntInput(&numdata, &secNum) < 0) {
126 opserr << "WARNING sectionLocation eleTag? <secNum?> - could not read int input? \n";
127 return -1;
128 }
129 }
130
131 Domain* theDomain = OPS_GetDomain();
132 if (theDomain == 0) return -1;
133
134 Element *theElement = theDomain->getElement(tag);
135 if (theElement == 0) {
136 opserr << "WARNING sectionLocation element with tag " << tag << " not found in domain \n";
137 return -1;
138 }
139
140 int argcc = 1;
141 char a[80] = "integrationPoints";
142 const char *argvv[1];
143 argvv[0] = a;
144
145 DummyStream dummy;
146
147 Response *theResponse = theElement->setResponse(argvv, argcc, dummy);
148 if (theResponse == 0) {
149 return 0;
150 }
151
152 theResponse->getResponse();
153 Information &info = theResponse->getInformation();
154
155 const Vector &theVec = *(info.theVector);
156 int Np = theVec.Size();
157
158 if (secNum > 0 && secNum <= Np) { // One IP
159 double value = theVec(secNum-1);
160 numdata = 1;

Callers 3

Tcl_ops_sectionLocationFunction · 0.85
Py_ops_sectionLocationFunction · 0.85
sectionLocationFunction · 0.85

Calls 8

OPS_GetIntInputFunction · 0.50
OPS_GetDomainFunction · 0.50
OPS_SetDoubleOutputFunction · 0.50
getElementMethod · 0.45
setResponseMethod · 0.45
getResponseMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected