| 347 | |
| 348 | |
| 349 | int |
| 350 | LoadControl::computeSensitivities(void) |
| 351 | { |
| 352 | // opserr<<" computeSensitivity::start"<<endln; |
| 353 | LinearSOE *theSOE = this->getLinearSOE(); |
| 354 | |
| 355 | /* |
| 356 | if (theAlgorithm == 0) { |
| 357 | opserr << "ERROR the FE algorithm must be defined before "; |
| 358 | opserr << "the sensitivity algorithm\n"; |
| 359 | return -1; |
| 360 | } |
| 361 | */ |
| 362 | /* |
| 363 | // Get pointer to the system of equations (SOE) |
| 364 | LinearSOE *theSOE = theAlgorithm->getLinearSOEptr(); |
| 365 | if (theSOE == 0) { |
| 366 | opserr << "ERROR the FE linearSOE must be defined before "; |
| 367 | opserr << "the sensitivity algorithm\n"; |
| 368 | return -1; |
| 369 | } |
| 370 | |
| 371 | // Get pointer to incremental integrator |
| 372 | IncrementalIntegrator *theIncInt = theAlgorithm->getIncrementalIntegratorPtr(); |
| 373 | // IncrementalIntegrator *theIncIntSens=theAlgorithm->getIncrementalIntegratorPtr();//Abbas |
| 374 | if (theIncInt == 0 ) { |
| 375 | opserr << "ERROR the FE integrator must be defined before "; |
| 376 | opserr << "the sensitivity algorithm\n"; |
| 377 | return -1; |
| 378 | } |
| 379 | |
| 380 | // Form current tangent at converged state |
| 381 | // (would be nice with an if-statement here in case |
| 382 | // the current tangent is already formed) |
| 383 | if (this->formTangent(CURRENT_TANGENT) < 0){ |
| 384 | opserr << "WARNING SensitivityAlgorithm::computeGradients() -"; |
| 385 | opserr << "the Integrator failed in formTangent()\n"; |
| 386 | return -1; |
| 387 | } |
| 388 | */ |
| 389 | // Zero out the old right-hand side of the SOE |
| 390 | theSOE->zeroB(); |
| 391 | |
| 392 | // Form the part of the RHS which are independent of parameter |
| 393 | this->formIndependentSensitivityRHS(); |
| 394 | AnalysisModel *theModel = this->getAnalysisModel(); |
| 395 | Domain *theDomain=theModel->getDomainPtr(); |
| 396 | ParameterIter ¶mIter = theDomain->getParameters(); |
| 397 | |
| 398 | Parameter *theParam; |
| 399 | // De-activate all parameters |
| 400 | while ((theParam = paramIter()) != 0) |
| 401 | theParam->activate(false); |
| 402 | |
| 403 | // Now, compute sensitivity wrt each parameter |
| 404 | int numGrads = theDomain->getNumParameters(); |
| 405 | paramIter = theDomain->getParameters(); |
| 406 |
nothing calls this directly
no test coverage detected