本文整理汇总了C++中AnalysisModel::setEigenvector方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisModel::setEigenvector方法的具体用法?C++ AnalysisModel::setEigenvector怎么用?C++ AnalysisModel::setEigenvector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisModel
的用法示例。
在下文中一共展示了AnalysisModel::setEigenvector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: theEigenvalues
int
StandardEigenAlgo::solveCurrentStep(int numModes)
{
AnalysisModel *theModel = this->getAnalysisModelPtr();
EigenSOE *theSOE = this->getEigenSOEptr();
EigenIntegrator *theIntegrator = this->getEigenIntegratorPtr();
if ((theModel == 0) || (theIntegrator == 0) || (theSOE == 0)) {
opserr << "StandardEigenAlgo::solverCurrentStep() -- setLinks() has not been called\n";
return -1;
}
if (theIntegrator->formK() < 0) {
opserr << "StandardEigenAlgo::solverCurrentStep() -- the Integrator failed in formK()\n";
return -2;
}
if (theSOE->solve(numModes, false) < 0) {
opserr << "StandardEigenAlgo::solverCurrentStep() -- the EigenSOE failed in solve()\n";
return -4;
}
// now set the eigenvalues and eigenvectors in the model
theModel->setNumEigenvectors(numModes);
Vector theEigenvalues(numModes);
for (int i = 1; i <= numModes; i++) {
theEigenvalues[i-1] = theSOE->getEigenvalue(i);
theModel->setEigenvector(i, theSOE->getEigenvector(i));
}
theModel->setEigenvalues(theEigenvalues);
return 0;
}