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

Function OPS_sectionTag

SRC/material/section/SectionForceDeformation.cpp:392–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392int OPS_sectionTag()
393{
394 // make sure at least one other argument to contain type of system
395 if (OPS_GetNumRemainingInputArgs() < 1) {
396 opserr << "WARNING want - sectionTag eleTag? <secNum?> \n";
397 return -1;
398 }
399
400 //opserr << "sectionLocation: ";
401 //for (int i = 0; i < argc; i++)
402 // opserr << argv[i] << ' ' ;
403 //opserr << endln;
404
405 int numdata = 1;
406 int tag;
407 if (OPS_GetIntInput(&numdata, &tag) < 0) {
408 opserr << "WARNING sectionTag eleTag? <secNum?> - could not read int input? \n";
409 return -1;
410 }
411
412 int secNum = 0;
413 if (OPS_GetNumRemainingInputArgs() > 0) {
414 if (OPS_GetIntInput(&numdata, &secNum) < 0) {
415 opserr << "WARNING sectionTag eleTag? <secNum?> - could not read int input? \n";
416 return -1;
417 }
418 }
419
420 Domain* theDomain = OPS_GetDomain();
421 if (theDomain == 0) return -1;
422
423 Element *theElement = theDomain->getElement(tag);
424 if (theElement == 0) {
425 opserr << "WARNING sectionTag - element with tag " << tag << " not found in domain \n";
426 return -1;
427 }
428
429 int argcc = 1;
430 char a[80] = "sectionTags";
431 const char *argvv[1];
432 argvv[0] = a;
433
434 DummyStream dummy;
435
436 Response *theResponse = theElement->setResponse(argvv, argcc, dummy);
437 if (theResponse == 0) {
438 return 0;
439 }
440
441 theResponse->getResponse();
442 Information &info = theResponse->getInformation();
443
444 const ID &theID = *(info.theID);
445 int Np = theID.Size();
446
447 if (secNum > 0 && secNum <= Np) { // One IP
448 int value = theID(secNum-1);
449 numdata = 1;

Callers 2

Py_ops_sectionTagFunction · 0.85
sectionTagFunction · 0.85

Calls 8

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

Tested by

no test coverage detected