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

Function OPS_sectionWeight

SRC/material/section/SectionForceDeformation.cpp:183–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183int OPS_sectionWeight()
184{
185 // make sure at least one other argument to contain type of system
186 if (OPS_GetNumRemainingInputArgs() < 1) {
187 opserr << "WARNING want - sectionWeight eleTag? <secNum?> \n";
188 return -1;
189 }
190
191 //opserr << "sectionWeight: ";
192 //for (int i = 0; i < argc; i++)
193 // opserr << argv[i] << ' ' ;
194 //opserr << endln;
195
196 int numdata = 1;
197 int tag;
198 if (OPS_GetIntInput(&numdata, &tag) < 0) {
199 opserr << "WARNING sectionWeight eleTag? <secNum?> - could not read int input? \n";
200 return -1;
201 }
202
203 int secNum = 0;
204 if (OPS_GetNumRemainingInputArgs() > 0) {
205 if (OPS_GetIntInput(&numdata, &secNum) < 0) {
206 opserr << "WARNING sectionWeight eleTag? <secNum?> - could not read int input? \n";
207 return -1;
208 }
209 }
210
211 Domain* theDomain = OPS_GetDomain();
212 if (theDomain == 0) return -1;
213
214 Element *theElement = theDomain->getElement(tag);
215 if (theElement == 0) {
216 opserr << "WARNING sectionWeight element with tag " << tag << " not found in domain \n";
217 return -1;
218 }
219
220 int argcc = 1;
221 char a[80] = "integrationWeights";
222 const char *argvv[1];
223 argvv[0] = a;
224
225 DummyStream dummy;
226
227 Response *theResponse = theElement->setResponse(argvv, argcc, dummy);
228 if (theResponse == 0) {
229 return 0;
230 }
231
232 theResponse->getResponse();
233 Information &info = theResponse->getInformation();
234
235 const Vector &theVec = *(info.theVector);
236 int Np = theVec.Size();
237
238 if (secNum > 0 && secNum <= Np) { // One IP
239 double value = theVec(secNum-1);
240 numdata = 1;

Callers 3

Tcl_ops_sectionWeightFunction · 0.85
Py_ops_sectionWeightFunction · 0.85
sectionWeightFunction · 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