| 717 | } |
| 718 | |
| 719 | int |
| 720 | Node::setTrialDisp(double value, int dof) |
| 721 | { |
| 722 | // check vector arg is of correct size |
| 723 | if (dof < 0 || dof >= numberDOF) { |
| 724 | opserr << "WARNING Node::setTrialDisp() - incompatible sizes\n"; |
| 725 | opserr << "node: " << this->getTag() << endln; |
| 726 | return -2; |
| 727 | } |
| 728 | |
| 729 | // construct memory and Vectors for trial and committed |
| 730 | // accel on first call to this method, getTrialDisp(), |
| 731 | // getDisp(), or incrTrialDisp() |
| 732 | if (trialDisp == 0) { |
| 733 | if (this->createDisp() < 0) { |
| 734 | opserr << "FATAL Node::setTrialDisp() - ran out of memory\n"; |
| 735 | exit(-1); |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | // perform the assignment .. we don't go through Vector interface |
| 740 | // as we are sure of size and this way is quicker |
| 741 | double tDisp = value; |
| 742 | disp[dof+2*numberDOF] = tDisp - disp[dof+numberDOF]; |
| 743 | disp[dof+3*numberDOF] = tDisp - disp[dof]; |
| 744 | disp[dof] = tDisp; |
| 745 | |
| 746 | return 0; |
| 747 | } |
| 748 | |
| 749 | int |
| 750 | Node::setTrialDisp(const Vector &newTrialDisp) |