| 892 | } |
| 893 | |
| 894 | int Pipe::getResponse(int responseID, Information &info) { |
| 895 | if (theCoordTransf == 0) { |
| 896 | return 0; |
| 897 | } |
| 898 | |
| 899 | // update section data |
| 900 | double A, Jx, Iy, Iz, rho, alphaV; |
| 901 | if (updateSectionData(A, Jx, Iy, Iz, rho, alphaV) < 0) { |
| 902 | opserr << "Pipe::getResistingForce failed to update section " |
| 903 | "data\n"; |
| 904 | return -1; |
| 905 | } |
| 906 | |
| 907 | // update material data |
| 908 | double E, nu, G, alp; |
| 909 | if (updateMaterialData(E, nu, G, alp) < 0) { |
| 910 | opserr << "Pipe::getResistingForce failed to update material " |
| 911 | "data\n"; |
| 912 | return -1; |
| 913 | } |
| 914 | |
| 915 | double L = theCoordTransf->getInitialLength(); |
| 916 | double oneOverL = 1.0 / L; |
| 917 | |
| 918 | switch (responseID) { |
| 919 | case 1: |
| 920 | // stiffness |
| 921 | return info.setMatrix(this->getTangentStiff()); |
| 922 | case 2: |
| 923 | // global forces |
| 924 | return info.setVector(this->getResistingForce()); |
| 925 | case 3: |
| 926 | // local forces |
| 927 | P(0) = -q(0) + p0[0]; // -pb1+plw1 |
| 928 | P(1) = |
| 929 | (q(1) + q(2)) * oneOverL + p0[1]; // (pb2+pb3)/L+plw2 |
| 930 | P(2) = -(q(3) + q(4)) * oneOverL + |
| 931 | p0[3]; // -(pb4+pb5)/L+plw3 |
| 932 | P(3) = -q(5); // -pb6 |
| 933 | P(4) = q(3); // pb4 |
| 934 | P(5) = q(1); // pb2 |
| 935 | P(6) = q(0); // pb1 |
| 936 | P(7) = -(q(1) + q(2)) * oneOverL + |
| 937 | p0[2]; // -(pb2+pb3)/L+plw8 |
| 938 | P(8) = |
| 939 | (q(3) + q(4)) * oneOverL + p0[4]; // (pb4+pb5)/L+plw9 |
| 940 | P(9) = q(5); // pb6 |
| 941 | P(10) = q(4); // pb5 |
| 942 | P(11) = q(2); // pb3 |
| 943 | return info.setVector(P); |
| 944 | case 4: |
| 945 | // basic forces |
| 946 | return info.setVector(q); |
| 947 | case 5: |
| 948 | // basic deformations |
| 949 | return info.setVector( |
| 950 | theCoordTransf->getBasicTrialDisp()); |
| 951 | case 6: { |
nothing calls this directly
no test coverage detected