| 238 | |
| 239 | |
| 240 | int |
| 241 | StaticDomainDecompositionAnalysis::eigen(int numMode, bool generalized, bool findSmallest) |
| 242 | { |
| 243 | int result = 0; |
| 244 | Domain *the_Domain = this->getDomainPtr(); |
| 245 | |
| 246 | if (theEigenSOE == 0) { |
| 247 | opserr << "StaticDomainDecompositionAnalysis::eigen() - no eigen solver has been set\n"; |
| 248 | return -1; |
| 249 | } |
| 250 | |
| 251 | // check for change in Domain since last step. As a change can |
| 252 | // occur in a commit() in a domaindecomp with load balancing |
| 253 | // this must now be inside the loop |
| 254 | |
| 255 | int stamp = the_Domain->hasDomainChanged(); |
| 256 | if (stamp != domainStamp) { |
| 257 | domainStamp = stamp; |
| 258 | result = this->domainChanged(); |
| 259 | if (result < 0) { |
| 260 | opserr << "StaticDomainDecompositionAnalysis::eigen() - domainChanged failed"; |
| 261 | return -1; |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | // |
| 266 | // zero A and M |
| 267 | // |
| 268 | |
| 269 | theEigenSOE->zeroA(); |
| 270 | theEigenSOE->zeroM(); |
| 271 | |
| 272 | // |
| 273 | // form K |
| 274 | // |
| 275 | |
| 276 | FE_EleIter &theEles = theAnalysisModel->getFEs(); |
| 277 | FE_Element *elePtr; |
| 278 | |
| 279 | while((elePtr = theEles()) != 0) { |
| 280 | elePtr->zeroTangent(); |
| 281 | elePtr->addKtToTang(1.0); |
| 282 | if (theEigenSOE->addA(elePtr->getTangent(0), elePtr->getID()) < 0) { |
| 283 | opserr << "WARNING StaticAnalysis::eigen() -"; |
| 284 | opserr << " failed in addA for ID " << elePtr->getID(); |
| 285 | result = -2; |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | // |
| 290 | // if generalized is true, form M |
| 291 | // |
| 292 | |
| 293 | if (generalized == true) { |
| 294 | int result = 0; |
| 295 | FE_EleIter &theEles2 = theAnalysisModel->getFEs(); |
| 296 | while((elePtr = theEles2()) != 0) { |
| 297 | elePtr->zeroTangent(); |
no test coverage detected