本文整理汇总了C++中FE_Element::addMtoTang方法的典型用法代码示例。如果您正苦于以下问题:C++ FE_Element::addMtoTang方法的具体用法?C++ FE_Element::addMtoTang怎么用?C++ FE_Element::addMtoTang使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FE_Element
的用法示例。
在下文中一共展示了FE_Element::addMtoTang方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: theEigenvalues
int
DirectIntegrationAnalysis::eigen(int numMode, bool generalized)
{
if (theAnalysisModel == 0 || theEigenSOE == 0) {
opserr << "WARNING DirectIntegrationAnalysis::eigen() - no EigenSOE has been set\n";
return -1;
}
int result = 0;
Domain *the_Domain = this->getDomainPtr();
result = theAnalysisModel->eigenAnalysis(numMode, generalized);
int stamp = the_Domain->hasDomainChanged();
if (stamp != domainStamp) {
domainStamp = stamp;
result = this->domainChanged();
if (result < 0) {
opserr << "DirectIntegrationAnalysis::eigen() - domainChanged failed";
return -1;
}
}
//
// zero A and M
//
theEigenSOE->zeroA();
theEigenSOE->zeroM();
//
// form K
//
FE_EleIter &theEles = theAnalysisModel->getFEs();
FE_Element *elePtr;
while((elePtr = theEles()) != 0) {
elePtr->zeroTangent();
elePtr->addKtToTang(1.0);
if (theEigenSOE->addA(elePtr->getTangent(0), elePtr->getID()) < 0) {
opserr << "WARNING DirectIntegrationAnalysis::eigen() -";
opserr << " failed in addA for ID " << elePtr->getID();
result = -2;
}
}
//
// if generalized is true, form M
//
if (generalized == true) {
int result = 0;
FE_EleIter &theEles2 = theAnalysisModel->getFEs();
while((elePtr = theEles2()) != 0) {
elePtr->zeroTangent();
elePtr->addMtoTang(1.0);
if (theEigenSOE->addM(elePtr->getTangent(0), elePtr->getID()) < 0) {
opserr << "WARNING DirectIntegrationAnalysis::eigen() -";
opserr << " failed in addA for ID " << elePtr->getID();
result = -2;
}
}
DOF_Group *dofPtr;
DOF_GrpIter &theDofs = theAnalysisModel->getDOFs();
while((dofPtr = theDofs()) != 0) {
dofPtr->zeroTangent();
dofPtr->addMtoTang(1.0);
if (theEigenSOE->addM(dofPtr->getTangent(0),dofPtr->getID()) < 0) {
opserr << "WARNING DirectIntegrationAnalysis::eigen() -";
opserr << " failed in addM for ID " << dofPtr->getID();
result = -3;
}
}
}
//
// solve for the eigen values & vectors
//
if (theEigenSOE->solve(numMode, generalized) < 0) {
opserr << "WARNING DirectIntegrationAnalysis::eigen() - EigenSOE failed in solve()\n";
return -4;
}
//
// now set the eigenvalues and eigenvectors in the model
//
theAnalysisModel->setNumEigenvectors(numMode);
Vector theEigenvalues(numMode);
for (int i = 1; i <= numMode; i++) {
theEigenvalues[i-1] = theEigenSOE->getEigenvalue(i);
theAnalysisModel->setEigenvector(i, theEigenSOE->getEigenvector(i));
}
theAnalysisModel->setEigenvalues(theEigenvalues);
//.........这里部分代码省略.........