本文整理汇总了C++中FEM_ObjectBroker::getNewGroundMotion方法的典型用法代码示例。如果您正苦于以下问题:C++ FEM_ObjectBroker::getNewGroundMotion方法的具体用法?C++ FEM_ObjectBroker::getNewGroundMotion怎么用?C++ FEM_ObjectBroker::getNewGroundMotion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FEM_ObjectBroker
的用法示例。
在下文中一共展示了FEM_ObjectBroker::getNewGroundMotion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: data
int
UniformExcitation::recvSelf(int commitTag, Channel &theChannel,
FEM_ObjectBroker &theBroker)
{
int dbTag = this->getDbTag();
static Vector data(6);
int res = theChannel.recvVector(dbTag, commitTag, data);
if (res < 0) {
opserr << "UniformExcitation::recvSelf() - channel failed to recv data\n";
return res;
}
this->setTag(data(0));
theDof = data(1);
vel0 = data(2);
fact = data(5);
int motionClassTag = data(3);
int motionDbTag = data(4);
if (theMotion == 0 || theMotion->getClassTag() != motionClassTag) {
if (theMotion != 0)
delete theMotion;
theMotion = theBroker.getNewGroundMotion(motionClassTag);
if (theMotion == 0) {
opserr << "UniformExcitation::recvSelf() - could not create a grond motion\n";
return -3;
}
// have to set the motion in EarthquakePattern base class
if (numMotions == 0)
this->addMotion(*theMotion);
else
theMotions[0] = theMotion;
}
theMotion->setDbTag(motionDbTag);
res = theMotion->recvSelf(commitTag, theChannel, theBroker);
if (res < 0) {
opserr << "UniformExcitation::recvSelf() - motion could not receive itself \n";
return res;
}
return 0;
}
示例2: myData
int
MultiSupportPattern::recvSelf(int commitTag, Channel &theChannel,
FEM_ObjectBroker &theBroker)
{
// get my current database tag
// NOTE - dbTag equals 0 if not sending to a database OR has not yet been sent
int myDbTag = this->getDbTag();
if (this->LoadPattern::recvSelf(commitTag, theChannel, theBroker) < 0) {
opserr << "MultiSupportPattern::recvSelf() - LoadPattern class failed in sendSelf()";
return -1;
}
// clear out the all the components in the current load pattern
if (theMotions != 0) {
for (int i=0; i<numMotions; i++)
if (theMotions[i] != 0)
delete theMotions[i];
delete [] theMotions;
numMotions = 0;
}
//
// now we rebuild the motions
//
static ID myData(3);
if (theChannel.recvID(myDbTag, commitTag, myData) < 0) {
opserr << "MultiSupportPattern::sendSelf - channel failed to send the initial ID\n";
return -1;
}
int numMotions = myData(0);
int dbMotions = myData(1);
if (numMotions != 0) {
ID motionData(numMotions*2);
// now send the ID
if (theChannel.recvID(dbMotions, commitTag, motionData) < 0) {
opserr << "MultiSupportPattern::sendSelf - channel failed to send the NodalLoads ID\n";
return -4;
}
theMotions = new GroundMotion *[numMotions];
if (theMotions == 0) {
opserr << "MultiSupportPattern::recvSelf() - out of memory\n";
return -1;
}
GroundMotion *theMotion;
for (int i=0; i<numMotions; i++) {
theMotion = theBroker.getNewGroundMotion(motionData(i*2));
if (theMotion == 0) {
return -1;
}
theMotion->setDbTag(motionData(i*2+1));
if (theMotion->recvSelf(commitTag, theChannel, theBroker) < 0) {
opserr << "MultiSupportPattern::sendSelf - ground motion failed in sendSelf\n";
return -7;
}
}
}
return 0;
}