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

Function ops_printEle

SRC/interpreter/PythonAnalysisBuilder.cpp:596–645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

594}
595
596int ops_printEle(OPS_Stream &output, PyObject *args)
597{
598 int flag = 0;
599
600 Domain& theDomain = *(OPS_GetDomain());
601
602 // just print(<filename>, 'ele')
603 if(OPS_GetNumRemainingInputArgs() == 0) {
604 ElementIter &theElements = theDomain.getElements();
605 Element *theElement;
606 while ((theElement = theElements()) != 0) {
607 theElement->Print(output);
608 }
609 return 0;
610 }
611
612 // if 'print <filename> Element flag int <int int ..>' get the flag
613 std::string type = OPS_GetString();
614 if(type=="flag" || type=="-flag") {
615 if(OPS_GetNumRemainingInputArgs() < 1) {
616 opserr << "WARNING printModel(<filename>, 'ele', <'flag', int> no int specified \n";
617 return -1;
618 }
619 int numData = 1;
620 if(OPS_GetIntInput(&numData,&flag) < 0) return -1;
621 } else {
622 int numData = OPS_GetNumRemainingInputArgs();
623 int numArgs = PyTuple_Size(args);
624 OPS_ResetCommandLine(numArgs, numArgs-numData-1, args);
625 }
626
627 // now print the Elements with the specified flag, 0 by default
628 int numEle = OPS_GetNumRemainingInputArgs();
629 if(numEle == 0) {
630 ElementIter &theElements = theDomain.getElements();
631 Element *theElement;
632 while ((theElement = theElements()) != 0) {
633 theElement->Print(output, flag);
634 }
635 return 0;
636 } else {
637
638 // otherwise print out the specified nodes i j k .. with flag
639 ID theEle(numEle);
640 if(OPS_GetIntInput(&numEle, &theEle(0)) < 0) return -1;
641 theDomain.Print(output, 0, &theEle, flag);
642 }
643
644 return 0;
645}
646
647int ops_printNode(OPS_Stream &output, PyObject *args)
648{

Callers 1

ops_printModelFunction · 0.85

Calls 7

OPS_ResetCommandLineFunction · 0.85
OPS_GetDomainFunction · 0.70
OPS_GetStringFunction · 0.70
OPS_GetIntInputFunction · 0.70
getElementsMethod · 0.45
PrintMethod · 0.45

Tested by

no test coverage detected