| 835 | } |
| 836 | |
| 837 | int MixedBeamColumn2d::update() { |
| 838 | |
| 839 | // If things haven't be initialized, then do so |
| 840 | if (initialFlag == 0) { |
| 841 | this->revertToStart(); |
| 842 | } |
| 843 | |
| 844 | int i,j,k; // integers for loops |
| 845 | |
| 846 | // Update iteration counter |
| 847 | // says how many times update has been called since the last commit state |
| 848 | itr++; |
| 849 | |
| 850 | // Update Coordinate Transformation |
| 851 | crdTransf->update(); |
| 852 | |
| 853 | // Current Length |
| 854 | double currentLength; |
| 855 | if (geomLinear) { |
| 856 | currentLength = initialLength; |
| 857 | } else { |
| 858 | currentLength = crdTransf->getDeformedLength(); |
| 859 | } |
| 860 | |
| 861 | // Compute the natural displacements |
| 862 | naturalDisp.Zero(); |
| 863 | naturalDisp = crdTransf->getBasicTrialDisp(); |
| 864 | |
| 865 | naturalIncrDeltaDisp.Zero(); |
| 866 | naturalIncrDeltaDisp = naturalDisp - lastNaturalDisp; |
| 867 | lastNaturalDisp = naturalDisp; |
| 868 | |
| 869 | // Get the numerical integration weights |
| 870 | double wt[MAX_NUM_SECTIONS]; // weights of sections or gauss points of integration points |
| 871 | beamIntegr->getSectionWeights(numSections, initialLength, wt); |
| 872 | |
| 873 | // Compute shape functions and their transposes |
| 874 | for ( i = 0; i < numSections; i++ ){ |
| 875 | nldhat[i] = this->getNld_hat(i, naturalDisp, currentLength, geomLinear); |
| 876 | sectionDefShapeFcn[i] = this->getd_hat(i, naturalDisp, currentLength, geomLinear); |
| 877 | nd1[i] = this->getNd1(i, naturalDisp, currentLength, geomLinear); |
| 878 | if (geomLinear) { |
| 879 | nd2[i].Zero(); |
| 880 | } else { |
| 881 | nd2[i] = this->getNd2(i, internalForce(0), currentLength); |
| 882 | } |
| 883 | |
| 884 | for( j = 0; j < NDM_SECTION; j++ ){ |
| 885 | for( k = 0; k < NDM_NATURAL; k++ ){ |
| 886 | nd1T[i](k,j) = nd1[i](j,k); |
| 887 | nd2T[i](k,j) = nd2[i](j,k); |
| 888 | } |
| 889 | } |
| 890 | } |
| 891 | |
| 892 | // Update natural force |
| 893 | if (geomLinear) { |
| 894 | naturalForce = naturalForce + Hinv * ( GMH * naturalIncrDeltaDisp + V ); |
no test coverage detected