| 703 | |
| 704 | |
| 705 | int |
| 706 | Element::storePreviousK(int numK) { |
| 707 | |
| 708 | // |
| 709 | // set up pointer to matrices and create matrices |
| 710 | // copy old |
| 711 | // |
| 712 | |
| 713 | if (numPreviousK < numK) { |
| 714 | Matrix **theKMatrices = new Matrix *[numK]; |
| 715 | |
| 716 | if (theKMatrices == 0) |
| 717 | return -1; |
| 718 | |
| 719 | int numEleDOF = this->getNumDOF(); |
| 720 | for (int i=0; i<numPreviousK; i++) |
| 721 | theKMatrices[i] = previousK[i]; |
| 722 | |
| 723 | for (int i=numPreviousK; i<numK; i++) { |
| 724 | theKMatrices[i] = new Matrix(numEleDOF, numEleDOF); |
| 725 | |
| 726 | if (theKMatrices[i] == 0) |
| 727 | return -1; |
| 728 | } |
| 729 | |
| 730 | if (previousK != 0) |
| 731 | delete [] previousK; |
| 732 | previousK = theKMatrices; |
| 733 | |
| 734 | numPreviousK = numK; |
| 735 | } |
| 736 | |
| 737 | // now copy the matrices |
| 738 | for (int i=numPreviousK-1; i>0; i--) |
| 739 | *(previousK[i]) = *(previousK[i-1]); |
| 740 | |
| 741 | *(previousK[0]) = this->getTangentStiff(); |
| 742 | |
| 743 | return 0; |
| 744 | } |
| 745 | |
| 746 | const Matrix * |
| 747 | Element::getPreviousK(int num) { |
nothing calls this directly
no test coverage detected