| 428 | } |
| 429 | |
| 430 | int |
| 431 | PFEMIntegrator::formEleResidual(FE_Element *theEle) |
| 432 | { |
| 433 | if (sensitivityFlag == 0) { // NO SENSITIVITY ANALYSIS |
| 434 | |
| 435 | this->TransientIntegrator::formEleResidual(theEle); |
| 436 | |
| 437 | } |
| 438 | else { // (ASSEMBLE ALL TERMS) |
| 439 | |
| 440 | theEle->zeroResidual(); |
| 441 | |
| 442 | // Compute the time-stepping parameters on the form |
| 443 | // udotdot = 1/dt*vn+1 - 1/dt*vn |
| 444 | // u = un + dt*vn+1 |
| 445 | |
| 446 | |
| 447 | // Obtain sensitivity vectors from previous step |
| 448 | // dVn.resize(U->Size()); dVn.Zero(); |
| 449 | // Vector dUn(U->Size()); |
| 450 | |
| 451 | // AnalysisModel *myModel = this->getAnalysisModel(); |
| 452 | // DOF_GrpIter &theDOFs = myModel->getDOFs(); |
| 453 | // DOF_Group *dofPtr = 0; |
| 454 | // while ((dofPtr = theDOFs()) != 0) { |
| 455 | |
| 456 | // const ID &id = dofPtr->getID(); |
| 457 | // int idSize = id.Size(); |
| 458 | |
| 459 | // //const Vector &dispSens = dofPtr->getDispSensitivity(gradNumber); |
| 460 | // for (int i=0; i < idSize; i++) { |
| 461 | // int loc = id(i); |
| 462 | // if (loc >= 0) { |
| 463 | // //dUn(loc) = dispSens(i); |
| 464 | // dUn(loc) = 0; |
| 465 | // } |
| 466 | // } |
| 467 | |
| 468 | // //const Vector &velSens = dofPtr->getVelSensitivity(gradNumber); |
| 469 | // for (int i=0; i < idSize; i++) { |
| 470 | // int loc = id(i); |
| 471 | // if (loc >= 0) { |
| 472 | // //dVn(loc) = velSens(i); |
| 473 | // dVn(loc) = 0; |
| 474 | // } |
| 475 | // } |
| 476 | // } |
| 477 | |
| 478 | // Now we're ready to make calls to the FE Element: |
| 479 | |
| 480 | // The term -dPint/dh|u fixed |
| 481 | theEle->addResistingForceSensitivity(gradNumber); |
| 482 | |
| 483 | // The term -dM/dh*acc |
| 484 | theEle->addM_ForceSensitivity(gradNumber, *Udotdot, -1.0); |
| 485 | |
| 486 | // The term -M*(-1/dt*dvn) |
| 487 | theEle->addM_Force(dVn, c3); |
nothing calls this directly
no test coverage detected