| 50 | ID FiberSection3d::code(4); |
| 51 | |
| 52 | void* OPS_FiberSection3d() |
| 53 | { |
| 54 | int numData = OPS_GetNumRemainingInputArgs(); |
| 55 | if(numData < 1) { |
| 56 | opserr<<"insufficient arguments for FiberSection3d\n"; |
| 57 | return 0; |
| 58 | } |
| 59 | |
| 60 | numData = 1; |
| 61 | int tag; |
| 62 | if (OPS_GetIntInput(&numData, &tag) < 0) return 0; |
| 63 | |
| 64 | if (OPS_GetNumRemainingInputArgs() < 2) { |
| 65 | opserr << "WARNING torsion not specified for FiberSection\n"; |
| 66 | opserr << "Use either -GJ $GJ or -torsion $matTag\n"; |
| 67 | opserr << "\nFiberSection3d section: " << tag << endln; |
| 68 | return 0; |
| 69 | } |
| 70 | |
| 71 | UniaxialMaterial *torsion = 0; |
| 72 | bool deleteTorsion = false; |
| 73 | bool computeCentroid = true; |
| 74 | while (OPS_GetNumRemainingInputArgs() > 0) { |
| 75 | const char* opt = OPS_GetString(); |
| 76 | if (strcmp(opt,"-noCentroid") == 0) { |
| 77 | computeCentroid = false; |
| 78 | } |
| 79 | if (strcmp(opt, "-GJ") == 0 && OPS_GetNumRemainingInputArgs() > 0) { |
| 80 | numData = 1; |
| 81 | double GJ; |
| 82 | if (OPS_GetDoubleInput(&numData, &GJ) < 0) { |
| 83 | opserr << "WARNING: failed to read GJ\n"; |
| 84 | return 0; |
| 85 | } |
| 86 | torsion = new ElasticMaterial(0,GJ); |
| 87 | deleteTorsion = true; |
| 88 | } |
| 89 | if (strcmp(opt, "-torsion") == 0 && OPS_GetNumRemainingInputArgs() > 0) { |
| 90 | numData = 1; |
| 91 | int torsionTag; |
| 92 | if (OPS_GetIntInput(&numData, &torsionTag) < 0) { |
| 93 | opserr << "WARNING: failed to read torsion\n"; |
| 94 | return 0; |
| 95 | } |
| 96 | torsion = OPS_getUniaxialMaterial(torsionTag); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | if (torsion == 0) { |
| 101 | opserr << "WARNING torsion not specified for FiberSection\n"; |
| 102 | opserr << "\nFiberSection3d section: " << tag << endln; |
| 103 | return 0; |
| 104 | } |
| 105 | |
| 106 | int num = 30; |
| 107 | SectionForceDeformation *section = new FiberSection3d(tag, num, *torsion, computeCentroid); |
| 108 | if (deleteTorsion) |
| 109 | delete torsion; |
no test coverage detected