| 28 | #include <ID.h> |
| 29 | |
| 30 | int |
| 31 | TclCommand_addMeshRegion(ClientData clientData, Tcl_Interp *interp, Tcl_Size argc, |
| 32 | TCL_Char ** const argv) |
| 33 | { |
| 34 | Domain& theDomain = *static_cast<Domain*>(clientData); |
| 35 | |
| 36 | int loc = 1; |
| 37 | int tag; |
| 38 | double alphaM = 0.0; |
| 39 | double betaK = 0.0; |
| 40 | double betaK0 = 0.0; |
| 41 | double betaKc = 0.0; |
| 42 | |
| 43 | ID *theNodes = nullptr; |
| 44 | ID *theElements = nullptr; |
| 45 | int numNodes = 0; |
| 46 | int numElements = 0; |
| 47 | |
| 48 | bool eleOnly = false; |
| 49 | bool nodeOnly = false; |
| 50 | |
| 51 | // first get tag for region |
| 52 | if (argc < 2) { |
| 53 | opserr << "WARNING region tag? - no tag specified\n"; |
| 54 | return TCL_ERROR; |
| 55 | } |
| 56 | |
| 57 | if (Tcl_GetInt(interp, argv[loc], &tag) != TCL_OK) { |
| 58 | opserr << "WARNING region tag? .. - invalid tag " << argv[loc] << "\n"; |
| 59 | return TCL_ERROR; |
| 60 | } |
| 61 | |
| 62 | loc++; |
| 63 | |
| 64 | // now continue until end of command |
| 65 | while (loc < argc) { |
| 66 | |
| 67 | if (strcmp(argv[loc], "-ele") == 0 || |
| 68 | strcmp(argv[loc], "-eleOnly") == 0) { |
| 69 | |
| 70 | if (strcmp(argv[loc], "-eleOnly") == 0) |
| 71 | eleOnly = true; |
| 72 | |
| 73 | // ensure no segmentation fault if user messes up |
| 74 | if (argc < loc + 2) { |
| 75 | opserr |
| 76 | << "WARNING region tag? .. -ele tag1? .. - no ele tags specified\n"; |
| 77 | return TCL_ERROR; |
| 78 | } |
| 79 | |
| 80 | // |
| 81 | // read in a list of ele until end of command or other flag |
| 82 | // |
| 83 | loc++; |
| 84 | |
| 85 | if (theElements == nullptr) |
| 86 | theElements = new ID(0, 64); |
| 87 |
nothing calls this directly
no test coverage detected