| 121 | |
| 122 | |
| 123 | int KRAlphaExplicit_TP::newStep(double _deltaT) |
| 124 | { |
| 125 | updateCount = 0; |
| 126 | |
| 127 | if (beta == 0 || gamma == 0 ) { |
| 128 | opserr << "WARNING KRAlphaExplicit_TP::newStep() - error in variable\n"; |
| 129 | opserr << "gamma = " << gamma << " beta = " << beta << endln; |
| 130 | return -1; |
| 131 | } |
| 132 | |
| 133 | // get a pointer to the LinearSOE and the AnalysisModel |
| 134 | LinearSOE *theLinSOE = this->getLinearSOE(); |
| 135 | AnalysisModel *theModel = this->getAnalysisModel(); |
| 136 | if (theLinSOE == 0 || theModel == 0) { |
| 137 | opserr << "WARNING KRAlphaExplicit_TP::newStep() - "; |
| 138 | opserr << "no LinearSOE or AnalysisModel has been set\n"; |
| 139 | return -2; |
| 140 | } |
| 141 | |
| 142 | // initialize the integration matrices |
| 143 | if (_deltaT != deltaT) { |
| 144 | // update time step increment |
| 145 | deltaT = _deltaT; |
| 146 | initAlphaMatrices = 1; |
| 147 | } |
| 148 | if (initAlphaMatrices) { |
| 149 | if (deltaT <= 0.0) { |
| 150 | opserr << "WARNING KRAlphaExplicit_TP::newStep() - error in variable\n"; |
| 151 | opserr << "dT = " << deltaT << endln; |
| 152 | return -3; |
| 153 | } |
| 154 | |
| 155 | // get the ConvergenceTest so we can switch back later |
| 156 | ConvergenceTest *theTest = this->getConvergenceTest(); |
| 157 | |
| 158 | // set up the FullLinearSOE (needed to compute the alpha matrices) |
| 159 | int size = theLinSOE->getNumEqn(); |
| 160 | FullGenLinSolver *theFullLinSolver = new FullGenLinLapackSolver(); |
| 161 | LinearSOE *theFullLinSOE = new FullGenLinSOE(size, *theFullLinSolver); |
| 162 | if (theFullLinSOE == 0) { |
| 163 | opserr << "WARNING KRAlphaExplicit_TP::newStep() - failed to create FullLinearSOE\n"; |
| 164 | return -4; |
| 165 | } |
| 166 | theFullLinSOE->setLinks(*theModel); |
| 167 | |
| 168 | // now switch the SOE to the FullLinearSOE |
| 169 | this->IncrementalIntegrator::setLinks(*theModel, *theFullLinSOE, theTest); |
| 170 | |
| 171 | // get a pointer to the A matrix of the FullLinearSOE |
| 172 | const Matrix *tmp = theFullLinSOE->getA(); |
| 173 | if (tmp == 0) { |
| 174 | opserr << "WARNING KRAlphaExplicit_TP::newStep() - "; |
| 175 | opserr << "failed to get A matrix of FullGeneral LinearSOE\n"; |
| 176 | return -5; |
| 177 | } |
| 178 | |
| 179 | // calculate the integration parameter matrices |
| 180 | c1 = beta*deltaT*deltaT; |
nothing calls this directly
no test coverage detected