| 789 | |
| 790 | |
| 791 | int |
| 792 | ZeroLength::update(void) |
| 793 | { |
| 794 | double strain; |
| 795 | double strainRate; |
| 796 | |
| 797 | // get trial displacements and take difference |
| 798 | const Vector& disp1 = theNodes[0]->getTrialDisp(); |
| 799 | const Vector& disp2 = theNodes[1]->getTrialDisp(); |
| 800 | Vector diff = disp2-disp1; |
| 801 | const Vector& vel1 = theNodes[0]->getTrialVel(); |
| 802 | const Vector& vel2 = theNodes[1]->getTrialVel(); |
| 803 | Vector diffv = vel2-vel1; |
| 804 | |
| 805 | if (d0 != 0) |
| 806 | diff -= *d0; |
| 807 | |
| 808 | if (v0 != 0) |
| 809 | diffv -= *v0; |
| 810 | |
| 811 | // loop over 1d materials |
| 812 | |
| 813 | // Matrix& tran = *t1d; |
| 814 | int ret = 0; |
| 815 | for (int mat=0; mat<numMaterials1d; mat++) { |
| 816 | // compute strain and rate; set as current trial for material |
| 817 | strain = this->computeCurrentStrain1d(mat,diff ); |
| 818 | strainRate = this->computeCurrentStrain1d(mat,diffv); |
| 819 | ret += theMaterial1d[mat]->setTrialStrain(strain,strainRate); |
| 820 | if (useRayleighDamping == 2) { |
| 821 | ret += theMaterial1d[mat+numMaterials1d]->setTrialStrain(strainRate); |
| 822 | } |
| 823 | } |
| 824 | |
| 825 | if (theDamping) |
| 826 | { |
| 827 | Vector q(numMaterials1d); |
| 828 | for (int i = 0; i < numMaterials1d; ++i) |
| 829 | q(i) = theMaterial1d[i]->getStress(); |
| 830 | |
| 831 | theDamping->update(q); |
| 832 | } |
| 833 | |
| 834 | return ret; |
| 835 | } |
| 836 | |
| 837 | const Matrix & |
| 838 | ZeroLength::getTangentStiff(void) |
no test coverage detected