本文整理汇总了C++中UniaxialMaterial::getDbTag方法的典型用法代码示例。如果您正苦于以下问题:C++ UniaxialMaterial::getDbTag方法的具体用法?C++ UniaxialMaterial::getDbTag怎么用?C++ UniaxialMaterial::getDbTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniaxialMaterial
的用法示例。
在下文中一共展示了UniaxialMaterial::getDbTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: data
int
FiberSection2d::sendSelf(int commitTag, Channel &theChannel)
{
int res = 0;
// create an id to send objects tag and numFibers,
// size 3 so no conflict with matData below if just 1 fiber
static ID data(3);
data(0) = this->getTag();
data(1) = numFibers;
int dbTag = this->getDbTag();
res += theChannel.sendID(dbTag, commitTag, data);
if (res < 0) {
opserr << "FiberSection2d::sendSelf - failed to send ID data\n";
return res;
}
if (numFibers != 0) {
// create an id containingg classTag and dbTag for each material & send it
ID materialData(2*numFibers);
for (int i=0; i<numFibers; i++) {
UniaxialMaterial *theMat = theMaterials[i];
materialData(2*i) = theMat->getClassTag();
int matDbTag = theMat->getDbTag();
if (matDbTag == 0) {
matDbTag = theChannel.getDbTag();
if (matDbTag != 0)
theMat->setDbTag(matDbTag);
}
materialData(2*i+1) = matDbTag;
}
res += theChannel.sendID(dbTag, commitTag, materialData);
if (res < 0) {
opserr << "FiberSection2d::sendSelf - failed to send material data\n";
return res;
}
// send the fiber data, i.e. area and loc
Vector fiberData(matData, 2*numFibers);
res += theChannel.sendVector(dbTag, commitTag, fiberData);
if (res < 0) {
opserr << "FiberSection2d::sendSelf - failed to send material data\n";
return res;
}
// now invoke send(0 on all the materials
for (int j=0; j<numFibers; j++)
theMaterials[j]->sendSelf(commitTag, theChannel);
}
return res;
}