MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / newStep

Method newStep

SRC/analysis/integrator/KRAlphaExplicit.cpp:137–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135
136
137int KRAlphaExplicit::newStep(double _deltaT)
138{
139 updateCount = 0;
140
141 if (beta == 0 || gamma == 0 ) {
142 opserr << "WARNING KRAlphaExplicit::newStep() - error in variable\n";
143 opserr << "gamma = " << gamma << " beta = " << beta << endln;
144 return -1;
145 }
146
147 // get a pointer to the AnalysisModel
148 AnalysisModel *theModel = this->getAnalysisModel();
149 if (theModel == 0) {
150 opserr << "WARNING KRAlphaExplicit::newStep() - no AnalysisModel set\n";
151 return -2;
152 }
153
154 // initialize the integration matrices
155 if (_deltaT != deltaT) {
156 // update time step increment
157 deltaT = _deltaT;
158 initAlphaMatrices = 1;
159 }
160 if (initAlphaMatrices) {
161 if (deltaT <= 0.0) {
162 opserr << "WARNING KRAlphaExplicit::newStep() - error in variable\n";
163 opserr << "dT = " << deltaT << endln;
164 return -3;
165 }
166
167 // get the LinearSOE and the ConvergenceTest so we can switch back later
168 LinearSOE *theLinSOE = this->getLinearSOE();
169 ConvergenceTest *theTest = this->getConvergenceTest();
170
171 // set up the FullLinearSOE (needed to compute the alpha matrices)
172 int size = theLinSOE->getNumEqn();
173 FullGenLinSolver *theFullLinSolver = new FullGenLinLapackSolver();
174 LinearSOE *theFullLinSOE = new FullGenLinSOE(size, *theFullLinSolver);
175 if (theFullLinSOE == 0) {
176 opserr << "WARNING KRAlphaExplicit::newStep() - failed to create FullLinearSOE\n";
177 return -4;
178 }
179 theFullLinSOE->setLinks(*theModel);
180
181 // now switch the SOE to the FullLinearSOE
182 this->IncrementalIntegrator::setLinks(*theModel, *theFullLinSOE, theTest);
183
184 // get a pointer to the A matrix of the FullLinearSOE
185 const Matrix *tmp = theFullLinSOE->getA();
186 if (tmp == 0) {
187 opserr << "WARNING KRAlphaExplicit::newStep() - ";
188 opserr << "failed to get A matrix of FullGeneral LinearSOE\n";
189 return -5;
190 }
191
192 // calculate the integration parameter matrices
193 c1 = beta*deltaT*deltaT;
194 c2 = gamma*deltaT;

Callers

nothing calls this directly

Calls 14

getAnalysisModelMethod · 0.45
getLinearSOEMethod · 0.45
getConvergenceTestMethod · 0.45
getNumEqnMethod · 0.45
setLinksMethod · 0.45
getAMethod · 0.45
SolveMethod · 0.45
addMatrixMethod · 0.45
addMatrixProductMethod · 0.45
addMatrixVectorMethod · 0.45
addVectorMethod · 0.45
setResponseMethod · 0.45

Tested by

no test coverage detected