| 645 | } |
| 646 | |
| 647 | int 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 | |
| 698 | int ops_printAlgo(OPS_Stream &output, PyObject *args) |
| 699 | { |
no test coverage detected