| 782 | } |
| 783 | |
| 784 | int OPS_MeshRegion() |
| 785 | { |
| 786 | int tag; |
| 787 | double alphaM = 0.0; |
| 788 | double betaK = 0.0; |
| 789 | double betaK0 = 0.0; |
| 790 | double betaKc = 0.0; |
| 791 | Damping *theDamping = 0; |
| 792 | |
| 793 | ID *theNodes = 0; |
| 794 | ID *theElements = 0; |
| 795 | int numNodes = 0; |
| 796 | int numElements = 0; |
| 797 | |
| 798 | Domain* theDomain = OPS_GetDomain(); |
| 799 | if (theDomain == 0) return -1; |
| 800 | |
| 801 | // first get tag for region |
| 802 | if (OPS_GetNumRemainingInputArgs() < 1) { |
| 803 | opserr << "WARNING region tag? - no tag specified\n"; |
| 804 | return -1; |
| 805 | } |
| 806 | |
| 807 | int numdata = 1; |
| 808 | if (OPS_GetIntInput(&numdata, &tag) < 0) { |
| 809 | opserr << "WARNING region tag? .. - invalid tag " << endln; |
| 810 | return -1; |
| 811 | } |
| 812 | |
| 813 | // now continue until end of command |
| 814 | bool only = false; |
| 815 | while (OPS_GetNumRemainingInputArgs() > 0) { |
| 816 | |
| 817 | const char* flag = OPS_GetString(); |
| 818 | |
| 819 | if (strcmp(flag,"-ele") == 0 || strcmp(flag,"-eleOnly") == 0) { |
| 820 | |
| 821 | // ensure no segmentation fault if user messes up |
| 822 | if (OPS_GetNumRemainingInputArgs() < 1) { |
| 823 | opserr << "WARNING region tag? .. -ele tag1? .. - no ele tags specified\n"; |
| 824 | return -1; |
| 825 | } |
| 826 | |
| 827 | // |
| 828 | // read in a list of ele until end of command or other flag |
| 829 | // |
| 830 | if (theElements == 0) { |
| 831 | theElements = new ID(0, 64); |
| 832 | } |
| 833 | int eleTag; |
| 834 | while (OPS_GetNumRemainingInputArgs() > 0) { |
| 835 | if (OPS_GetIntInput(&numdata, &eleTag) < 0) { |
| 836 | // back one arg |
| 837 | OPS_ResetCurrentInputArg(-1); |
| 838 | break; |
| 839 | } |
| 840 | |
| 841 | (*theElements)[numElements++] = eleTag; |
no test coverage detected