本文整理汇总了C++中LinearSOE::addA方法的典型用法代码示例。如果您正苦于以下问题:C++ LinearSOE::addA方法的具体用法?C++ LinearSOE::addA怎么用?C++ LinearSOE::addA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinearSOE
的用法示例。
在下文中一共展示了LinearSOE::addA方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: formTangent
int KRAlphaExplicit::formTangent(int statFlag)
{
statusFlag = statFlag;
LinearSOE *theLinSOE = this->getLinearSOE();
AnalysisModel *theModel = this->getAnalysisModel();
if (theLinSOE == 0 || theModel == 0) {
opserr << "WARNING KRAlphaExplicit::formTangent() - ";
opserr << "no LinearSOE or AnalysisModel has been set\n";
return -1;
}
theLinSOE->zeroA();
int size = theLinSOE->getNumEqn();
ID id(size);
for (int i=1; i<size; i++) {
id(i) = id(i-1) + 1;
}
if (theLinSOE->addA(*Mhat, id) < 0) {
opserr << "WARNING KRAlphaExplicit::formTangent() - ";
opserr << "failed to add Mhat to A\n";
return -2;
}
return 0;
}
示例2: while
int
TransientIntegrator::formTangent(int statFlag)
{
int result = 0;
statusFlag = statFlag;
LinearSOE *theLinSOE = this->getLinearSOE();
AnalysisModel *theModel = this->getAnalysisModel();
if (theLinSOE == 0 || theModel == 0) {
opserr << "WARNING TransientIntegrator::formTangent() ";
opserr << "no LinearSOE or AnalysisModel has been set\n";
return -1;
}
// the loops to form and add the tangents are broken into two for
// efficiency when performing parallel computations
theLinSOE->zeroA();
// loop through the DOF_Groups and add the unbalance
DOF_GrpIter &theDOFs = theModel->getDOFs();
DOF_Group *dofPtr;
while ((dofPtr = theDOFs()) != 0) {
if (theLinSOE->addA(dofPtr->getTangent(this),dofPtr->getID()) <0) {
opserr << "TransientIntegrator::formTangent() - failed to addA:dof\n";
result = -1;
}
}
// loop through the FE_Elements getting them to add the tangent
FE_EleIter &theEles2 = theModel->getFEs();
FE_Element *elePtr;
while((elePtr = theEles2()) != 0) {
if (theLinSOE->addA(elePtr->getTangent(this),elePtr->getID()) < 0) {
opserr << "TransientIntegrator::formTangent() - failed to addA:ele\n";
result = -2;
}
}
return result;
}