本文整理汇总了C++中FEM_ObjectBroker::getNewSP方法的典型用法代码示例。如果您正苦于以下问题:C++ FEM_ObjectBroker::getNewSP方法的具体用法?C++ FEM_ObjectBroker::getNewSP怎么用?C++ FEM_ObjectBroker::getNewSP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FEM_ObjectBroker
的用法示例。
在下文中一共展示了FEM_ObjectBroker::getNewSP方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lpData
//.........这里部分代码省略.........
theEle->setDbTag(dbTag);
if (theEle->recvSelf(cTag, theChannel, theBroker) < 0) {
opserr << "LoadPattern::recvSelf - Ele with dbTag " << dbTag << " failed in recvSelf\n";
return -2;
}
if (this->addElementalLoad(theEle) == false) {
opserr << "LoadPattern::recvSelf - could not add Ele with tag " << theEle->getTag() << " into LP!\n";
return -3;
}
loc+=2;
}
}
//
// now we rebuild the SP_Constraints .. same as nodes above .. see above if can't understand!!
//
if (numSPs != 0) {
ID spData(2*numSPs);
if (theChannel.recvID(dbSPs, currentGeoTag, spData) < 0) {
opserr << "LoadPattern::recvSelf - channel failed to recv the SP_Constraints ID\n";
return -2;
}
int loc = 0;
for (int i=0; i<numSPs; i++) {
int classTag = spData(loc);
int dbTag = spData(loc+1);
SP_Constraint *theSP = theBroker.getNewSP(classTag);
if (theSP == 0) {
opserr << "LoadPattern::recv - cannot create SP_Constraint with classTag " << classTag << endln;
return -2;
}
theSP->setDbTag(dbTag);
if (theSP->recvSelf(cTag, theChannel, theBroker) < 0) {
opserr << "LoadPattern::recvSelf - SP_Constraint with dbTag " << dbTag << " failed in recvSelf\n";
return -2;
}
if (this->addSP_Constraint(theSP) == false) {
opserr << "LoadPattern::recvSelf - could not add SP_Constraint with tag " << theSP->getTag()
<< " into LP!\n";
return -3;
}
loc+=2;
}
}
// now set the load pattern db count
currentGeoTag = lpData(0);
lastGeoSendTag = currentGeoTag;
} else {
if (theSeries != 0)
if (theSeries->recvSelf(cTag, theChannel, theBroker) < 0) {
opserr << "LoadPattern::recvSelf - the TimeSeries failed to recv\n";
return -3;
}
NodalLoad *theNode;
NodalLoadIter &theNodes = this->getNodalLoads();
while ((theNode = theNodes()) != 0) {
if (theNode->recvSelf(cTag, theChannel, theBroker) < 0) {
opserr << "LoadPattern::recvSelf - node with tag " << theNode->getTag() << " failed in recvSelf\n";
return -7;
}
}
ElementalLoad *theEle;
ElementalLoadIter &theElements = this->getElementalLoads();
while ((theEle = theElements()) != 0) {
if (theEle->recvSelf(cTag, theChannel, theBroker) < 0) {
opserr << "LoadPattern::recvSelf - element with tag " << theEle->getTag() << " failed in recvSelf\n";
return -8;
}
}
SP_Constraint *theSP;
SP_ConstraintIter &theSPs = this->getSPs();
while ((theSP = theSPs()) != 0) {
if (theSP->recvSelf(cTag, theChannel, theBroker) < 0) {
opserr << "LoadPattern::recvSelf - SP_Constraint tagged " << theSP->getTag() << " failed recvSelf\n";
return -9;
}
}
}
// if we get here we are successfull
return 0;
}