| 2543 | } |
| 2544 | |
| 2545 | int |
| 2546 | ForceBeamColumn3d::getInitialDeformations(Vector &v0) |
| 2547 | { |
| 2548 | v0.Zero(); |
| 2549 | if (numEleLoads < 1) |
| 2550 | return 0; |
| 2551 | |
| 2552 | double L = crdTransf->getInitialLength(); |
| 2553 | double oneOverL = 1.0 / L; |
| 2554 | |
| 2555 | double xi[maxNumSections]; |
| 2556 | beamIntegr->getSectionLocations(numSections, L, xi); |
| 2557 | |
| 2558 | double wt[maxNumSections]; |
| 2559 | beamIntegr->getSectionWeights(numSections, L, wt); |
| 2560 | |
| 2561 | for (int i = 0; i < numSections; i++) { |
| 2562 | |
| 2563 | int order = sections[i]->getOrder(); |
| 2564 | const ID &code = sections[i]->getType(); |
| 2565 | |
| 2566 | double xL = xi[i]; |
| 2567 | double xL1 = xL - 1.0; |
| 2568 | double wtL = wt[i] * L; |
| 2569 | |
| 2570 | static Vector sp; |
| 2571 | sp.setData(workArea, order); |
| 2572 | sp.Zero(); |
| 2573 | |
| 2574 | this->computeSectionForces(sp, i); |
| 2575 | |
| 2576 | const Matrix &fse = sections[i]->getInitialFlexibility(); |
| 2577 | |
| 2578 | static Vector e; |
| 2579 | e.setData(&workArea[order], order); |
| 2580 | |
| 2581 | e.addMatrixVector(0.0, fse, sp, 1.0); |
| 2582 | |
| 2583 | double dei, tmp; |
| 2584 | for (int ii = 0; ii < order; ii++) { |
| 2585 | dei = e(ii)*wtL; |
| 2586 | switch (code(ii)) { |
| 2587 | case SECTION_RESPONSE_P: |
| 2588 | v0(0) += dei; |
| 2589 | break; |
| 2590 | case SECTION_RESPONSE_MZ: |
| 2591 | v0(1) += xL1*dei; v0(2) += xL*dei; |
| 2592 | break; |
| 2593 | case SECTION_RESPONSE_VY: |
| 2594 | tmp = oneOverL*dei; |
| 2595 | v0(1) += tmp; v0(2) += tmp; |
| 2596 | break; |
| 2597 | case SECTION_RESPONSE_MY: |
| 2598 | v0(3) += xL1*dei; v0(4) += xL*dei; |
| 2599 | break; |
| 2600 | case SECTION_RESPONSE_VZ: |
| 2601 | tmp = oneOverL*dei; |
| 2602 | v0(3) += tmp; v0(4) += tmp; |
no test coverage detected