| 2613 | } |
| 2614 | |
| 2615 | int |
| 2616 | ForceBeamColumn2d::getInitialDeformations(Vector &v0) |
| 2617 | { |
| 2618 | v0.Zero(); |
| 2619 | if (numEleLoads < 1) |
| 2620 | return 0; |
| 2621 | |
| 2622 | double L = crdTransf->getInitialLength(); |
| 2623 | double oneOverL = 1.0/L; |
| 2624 | |
| 2625 | double xi[maxNumSections]; |
| 2626 | beamIntegr->getSectionLocations(numSections, L, xi); |
| 2627 | |
| 2628 | double wt[maxNumSections]; |
| 2629 | beamIntegr->getSectionWeights(numSections, L, wt); |
| 2630 | |
| 2631 | for (int i = 0; i < numSections; i++) { |
| 2632 | |
| 2633 | int order = sections[i]->getOrder(); |
| 2634 | const ID &code = sections[i]->getType(); |
| 2635 | |
| 2636 | double xL = xi[i]; |
| 2637 | double xL1 = xL-1.0; |
| 2638 | double wtL = wt[i]*L; |
| 2639 | |
| 2640 | static Vector sp; |
| 2641 | sp.setData(workArea, order); |
| 2642 | sp.Zero(); |
| 2643 | |
| 2644 | this->computeSectionForces(sp, i); |
| 2645 | |
| 2646 | const Matrix &fse = sections[i]->getInitialFlexibility(); |
| 2647 | |
| 2648 | static Vector e; |
| 2649 | e.setData(&workArea[order], order); |
| 2650 | |
| 2651 | e.addMatrixVector(0.0, fse, sp, 1.0); |
| 2652 | |
| 2653 | double dei, tmp; |
| 2654 | for (int ii = 0; ii < order; ii++) { |
| 2655 | dei = e(ii)*wtL; |
| 2656 | switch(code(ii)) { |
| 2657 | case SECTION_RESPONSE_P: |
| 2658 | v0(0) += dei; |
| 2659 | break; |
| 2660 | case SECTION_RESPONSE_MZ: |
| 2661 | v0(1) += xL1*dei; v0(2) += xL*dei; |
| 2662 | break; |
| 2663 | case SECTION_RESPONSE_VY: |
| 2664 | tmp = oneOverL*dei; |
| 2665 | v0(1) += tmp; v0(2) += tmp; |
| 2666 | break; |
| 2667 | default: |
| 2668 | break; |
| 2669 | } |
| 2670 | } |
| 2671 | } |
| 2672 |
no test coverage detected