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

Function ops_printNode

SRC/interpreter/PythonAnalysisBuilder.cpp:647–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645}
646
647int ops_printNode(OPS_Stream &output, PyObject *args)
648{
649 int flag = 0;
650
651 Domain& theDomain = *(OPS_GetDomain());
652
653 // just print(<filename>, 'node')
654 if(OPS_GetNumRemainingInputArgs() == 0) {
655 NodeIter &theNodes = theDomain.getNodes();
656 Node *theNode;
657 while((theNode = theNodes()) != 0) {
658 theNode->Print(output);
659 }
660 return 0;
661 }
662
663 // if 'print <filename> node flag int <int int ..>' get the flag
664 std::string type = OPS_GetString();
665 if(type=="flag" || type=="-flag") {
666 if(OPS_GetNumRemainingInputArgs() < 1) {
667 opserr << "WARNING printModel(<filename>, 'ele', <'flag', int> no int specified \n";
668 return -1;
669 }
670 int numData = 1;
671 if(OPS_GetIntInput(&numData,&flag) < 0) return -1;
672 } else {
673 int numData = OPS_GetNumRemainingInputArgs();
674 int numArgs = PyTuple_Size(args);
675 OPS_ResetCommandLine(numArgs, numArgs-numData-1, args);
676 }
677
678 // now print the nodes with the specified flag, 0 by default
679 int numNode = OPS_GetNumRemainingInputArgs();
680 if(numNode == 0) {
681 NodeIter &theNodes = theDomain.getNodes();
682 Node *theNode;
683 while ((theNode = theNodes()) != 0) {
684 theNode->Print(output, flag);
685 }
686 return 0;
687 } else {
688
689 // otherwise print out the specified nodes i j k .. with flag
690 ID theNode(numNode);
691 if(OPS_GetIntInput(&numNode, &theNode(0)) < 0) return -1;
692 theDomain.Print(output, &theNode, 0, flag);
693 }
694
695 return 0;
696}
697
698int ops_printAlgo(OPS_Stream &output, PyObject *args)
699{

Callers 1

ops_printModelFunction · 0.85

Calls 7

OPS_ResetCommandLineFunction · 0.85
getNodesMethod · 0.80
OPS_GetDomainFunction · 0.70
OPS_GetStringFunction · 0.70
OPS_GetIntInputFunction · 0.70
PrintMethod · 0.45

Tested by

no test coverage detected