| 30 | #include <UniaxialMaterial.h> |
| 31 | |
| 32 | void *OPS_NewElement(void) { |
| 33 | |
| 34 | // |
| 35 | // create 2 arrays; one each for integer and double command line arguments |
| 36 | // |
| 37 | |
| 38 | int iData[1]; // integer args on command line of size 1, change to suit |
| 39 | double dData[1]; // double args on command line of size 1, change to suit |
| 40 | |
| 41 | // |
| 42 | // read values from command line of script |
| 43 | // |
| 44 | |
| 45 | int numArgs = OPS_GetNumRemainingInputArgs(); |
| 46 | if (numArgs != 1) { |
| 47 | opserr << "WARNING incorrect # args, want: element NewElement $id" << endln; |
| 48 | return 0; |
| 49 | } |
| 50 | |
| 51 | int numData = 1; // num integer args |
| 52 | if ((numData > 0) && (OPS_GetIntInput(&numData, &iData[0]) < 0)) { |
| 53 | opserr << "WARNING failed to read integers, command element NewElement" << endln; |
| 54 | return 0; |
| 55 | } |
| 56 | |
| 57 | numData = 0; // reset to num double args |
| 58 | if ((numData > 0) && (OPS_GetDoubleInput(&numData, &dData[0]) < 0)) { |
| 59 | opserr << "WARNING failed to read doubles, command element NewElement" << endln; |
| 60 | return 0; |
| 61 | } |
| 62 | |
| 63 | // |
| 64 | // get a pointer to a uniaxial material already defined |
| 65 | // |
| 66 | |
| 67 | // int matTag = iData[??] |
| 68 | // UniaxialMaterial *theMat = OPS_getUnixialMaterial(matTag); |
| 69 | |
| 70 | // |
| 71 | // return pointer to new element |
| 72 | // |
| 73 | |
| 74 | |
| 75 | return new NewElement(iData[0]); |
| 76 | } |
nothing calls this directly
no test coverage detected