| 70 | } |
| 71 | |
| 72 | int OPS_CrdTransf() |
| 73 | { |
| 74 | if (OPS_GetNumRemainingInputArgs() < 2) { |
| 75 | opserr<<"WARNING too few arguments: geomTransf type? tag? ...\n"; |
| 76 | return -1; |
| 77 | } |
| 78 | |
| 79 | const char* type = OPS_GetString(); |
| 80 | |
| 81 | // create it |
| 82 | CrdTransf* transf = 0; |
| 83 | if (strcmp(type, "Linear") == 0) { |
| 84 | transf = (CrdTransf*)OPS_LinearCrdTransf(); |
| 85 | } else if(strcmp(type, "PDelta") == 0) { |
| 86 | transf = (CrdTransf*)OPS_PDeltaCrdTransf(); |
| 87 | } else if(strcmp(type, "Corotational") == 0) { |
| 88 | transf = (CrdTransf*)OPS_CorotCrdTransf(); |
| 89 | } else { |
| 90 | opserr << "WARNING geomTransf type "<< type <<" is unknown\n"; |
| 91 | return -1; |
| 92 | } |
| 93 | |
| 94 | // check |
| 95 | if (transf == 0) { |
| 96 | opserr << "WARNING failed to create geomTransf object\n"; |
| 97 | return -1; |
| 98 | } |
| 99 | |
| 100 | // add it |
| 101 | if (OPS_addCrdTransf(transf) == false) { |
| 102 | opserr << "WARNING failed to add CrdTransf\n"; |
| 103 | delete transf; |
| 104 | return -1; |
| 105 | } |
| 106 | |
| 107 | return 0; |
| 108 | } |
no test coverage detected