| 769 | } |
| 770 | |
| 771 | int OPS_printModelGID() |
| 772 | { |
| 773 | // This function print's a file with node and elements in a format useful for GID |
| 774 | int res = 0; |
| 775 | bool hasLinear = 0; |
| 776 | bool hasTri3 = 0; |
| 777 | bool hasQuad4 = 0; |
| 778 | bool hasQuad8 = 0; |
| 779 | bool hasQuad9 = 0; |
| 780 | bool hasBrick = 0; |
| 781 | int startEle = 1; |
| 782 | int endEle = 1; |
| 783 | int eleRange = 0; |
| 784 | int numdata = 1; |
| 785 | |
| 786 | FileStream outputFile; |
| 787 | // OPS_Stream *output = &opserr; |
| 788 | Domain* theDomain = OPS_GetDomain(); |
| 789 | if (theDomain == 0) return -1; |
| 790 | |
| 791 | if (OPS_GetNumRemainingInputArgs() < 1) { |
| 792 | opserr << "WARNING printGID fileName? - no filename supplied\n"; |
| 793 | return -1; |
| 794 | } |
| 795 | const char* filename = OPS_GetString(); |
| 796 | openMode mode = OVERWRITE; |
| 797 | while (OPS_GetNumRemainingInputArgs() > 0) { |
| 798 | const char* flag = OPS_GetString(); |
| 799 | if (strcmp(flag,"-append") == 0) { |
| 800 | mode = APPEND; |
| 801 | } |
| 802 | if (strcmp(flag,"-eleRange") == 0 && OPS_GetNumRemainingInputArgs()>1) { |
| 803 | //opserr<<"WARNING:commands: eleRange defined"<<endln; |
| 804 | eleRange = 1; |
| 805 | if (OPS_GetIntInput(&numdata, &startEle) < 0) { |
| 806 | opserr << "WARNING print node failed to get integer: " << endln; |
| 807 | return -1; |
| 808 | } |
| 809 | if (OPS_GetIntInput(&numdata, &endEle) < 0) { |
| 810 | opserr << "WARNING print node failed to get integer: " << endln; |
| 811 | return -1; |
| 812 | } |
| 813 | //opserr<<"startEle = "<<startEle<<" endEle = "<<endEle<<endln; |
| 814 | } |
| 815 | } |
| 816 | |
| 817 | if (outputFile.setFile(filename, mode) < 0) { |
| 818 | opserr << "WARNING printGID " << filename << " failed to set the file\n"; |
| 819 | return -1; |
| 820 | } |
| 821 | |
| 822 | // Cycle over Elements to understand what type of elements are there |
| 823 | ElementIter &theElements = theDomain->getElements(); |
| 824 | Element *theElement; |
| 825 | while ((theElement = theElements()) != 0) { |
| 826 | // int tag = theElement->getTag(); |
| 827 | |
| 828 | // Check type of Element with Number of Nodes |
no test coverage detected