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

Method computeSensitivities

SRC/analysis/integrator/DisplacementControl.cpp:1049–1133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1047
1048
1049 int
1050DisplacementControl::computeSensitivities(void)
1051{
1052 LinearSOE *theSOE = this->getLinearSOE();
1053
1054 // Zero out the old right-hand side of the SOE
1055 theSOE->zeroB();
1056
1057 // Form the part of the RHS which are independent of parameter
1058 this->formIndependentSensitivityRHS();
1059
1060 AnalysisModel *theModel = this->getAnalysisModel();
1061 Domain *theDomain=theModel->getDomainPtr();//Abbas
1062 ParameterIter &paramIter = theDomain->getParameters();
1063 Parameter *theParam;
1064
1065 // De-activate all parameters
1066 while ((theParam = paramIter()) != 0)
1067 theParam->activate(false);
1068
1069 // Now, compute sensitivity wrt each parameter
1070 int numGrads = theDomain->getNumParameters();
1071 paramIter = theDomain->getParameters();
1072
1073
1074 while ((theParam = paramIter()) != 0) {
1075 // Activate this parameter
1076 theParam->activate(true);
1077
1078 // Zero the RHS vector
1079 theSOE->zeroB();
1080
1081 // Get the grad index for this parameter
1082 int gradIndex = theParam->getGradIndex();
1083
1084 // this->formResidualDispSensitivity( dUIJdh, gradIndex);//./.
1085
1086 // Form the RHS
1087
1088 // this->formTangDispSensitivity(dUhatdh,gradIndex);
1089 this->formSensitivityRHS(gradIndex);
1090
1091 this->formTangent(tangFlag);
1092 theSOE->solve();
1093 *dUIJdh=theSOE->getX();// sensitivity of the residual displacement
1094
1095 // opserr<<"computeSensitivities: dUfRdh is "<<*dUIJdh<<endln;//
1096 // opserr<<"deltaUbar is "<<*deltaUbar<<endln;
1097 this->formTangDispSensitivity(dUhatdh,gradIndex);
1098 double dlamdh = this->getLambdaSensitivity(gradIndex);
1099
1100 // To obtain the response sensitivity
1101 theSOE->setB(*Residual);
1102 theSOE->solve();
1103 //theSOE->getX();
1104
1105 //Vector *x=new Vector(size);
1106 //(*x)=theSOE->getX();

Callers

nothing calls this directly

Calls 15

formSensitivityRHSMethod · 0.95
getLambdaSensitivityMethod · 0.95
saveSensitivityMethod · 0.95
saveLambdaSensitivityMethod · 0.95
commitSensitivityMethod · 0.95
getParametersMethod · 0.80
getLinearSOEMethod · 0.45
zeroBMethod · 0.45
getAnalysisModelMethod · 0.45
getDomainPtrMethod · 0.45

Tested by

no test coverage detected