| 336 | } |
| 337 | |
| 338 | int |
| 339 | PFEMIntegrator::formTangent(int statFlag) |
| 340 | { |
| 341 | int result = 0; |
| 342 | statusFlag = statFlag; |
| 343 | |
| 344 | LinearSOE *theLinSOE = this->getLinearSOE(); |
| 345 | AnalysisModel *theModel = this->getAnalysisModel(); |
| 346 | if (theLinSOE == 0 || theModel == 0) { |
| 347 | opserr << "WARNING TransientIntegrator::formTangent() "; |
| 348 | opserr << "no LinearSOE or AnalysisModel has been set\n"; |
| 349 | return -1; |
| 350 | } |
| 351 | |
| 352 | // the loops to form and add the tangents are broken into two for |
| 353 | // efficiency when performing parallel computations |
| 354 | |
| 355 | theLinSOE->zeroA(); |
| 356 | |
| 357 | // do modal damping |
| 358 | bool inclModalMatrix=theModel->inclModalDampingMatrix(); |
| 359 | if (inclModalMatrix == true) { |
| 360 | const Vector *modalValues = theModel->getModalDampingFactors(); |
| 361 | if (modalValues != 0) { |
| 362 | this->addModalDampingMatrix(modalValues); |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | |
| 367 | // loop through the DOF_Groups and add the unbalance |
| 368 | DOF_GrpIter &theDOFs = theModel->getDOFs(); |
| 369 | DOF_Group *dofPtr; |
| 370 | |
| 371 | while ((dofPtr = theDOFs()) != 0) { |
| 372 | if (theLinSOE->addA(dofPtr->getTangent(this),dofPtr->getID()) <0) { |
| 373 | opserr << "TransientIntegrator::formTangent() - failed to addA:dof\n"; |
| 374 | result = -1; |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | // loop through the FE_Elements getting them to add the tangent |
| 379 | FE_EleIter &theEles2 = theModel->getFEs(); |
| 380 | FE_Element *elePtr; |
| 381 | while((elePtr = theEles2()) != 0) { |
| 382 | if (theLinSOE->addA(elePtr->getTangent(this),elePtr->getID()) < 0) { |
| 383 | opserr << "TransientIntegrator::formTangent() - failed to addA:ele\n"; |
| 384 | result = -2; |
| 385 | } |
| 386 | } |
| 387 | return result; |
| 388 | } |
| 389 | |
| 390 | |
| 391 | int PFEMIntegrator::formEleTangent(FE_Element *theEle) |
no test coverage detected