本文整理汇总了C++中Domain::getLoadPattern方法的典型用法代码示例。如果您正苦于以下问题:C++ Domain::getLoadPattern方法的具体用法?C++ Domain::getLoadPattern怎么用?C++ Domain::getLoadPattern使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain::getLoadPattern方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Vector
int
ImposedMotionSP::applyConstraint(double time)
{
// on first
if (theGroundMotion == 0 || theNode == 0 || theNodeResponse == 0) {
Domain *theDomain = this->getDomain();
theNode = theDomain->getNode(nodeTag);
if (theNode == 0) {
opserr << "ImposedMotionSP::applyConstraint() - node " << nodeTag << " does not exist\n";
return -1;
}
int numNodeDOF = theNode->getNumberDOF();
if (dofNumber < 0 || numNodeDOF <= dofNumber) {
opserr << "ImposedMotionSP::applyConstraint() - dof number " << dofNumber++ << " at node " << nodeTag << " not valid\n";
return -2;
}
theNodeResponse = new Vector(numNodeDOF);
if (theNodeResponse == 0) {
opserr << "ImposedMotionSP::applyConstraint() - out of memory\n";
return -2;
}
LoadPattern *theLoadPattern = theDomain->getLoadPattern(patternTag);
if (theLoadPattern == 0)
return -3;
theGroundMotion = theLoadPattern->getMotion(groundMotionTag);
if (theGroundMotion == 0)
return -4;
}
if (theNodeResponse == 0)
return -1;
// now get the response from the ground motion
theGroundMotionResponse = theGroundMotion->getDispVelAccel(time);
//
// now set the responses at the node
//
/* ***********************************************************
* disp response the responsibility of constraint handler
*theNodeResponse = theNode->getTrialDisp();
(*theNodeResponse)(dofNumber) = theGroundMotionResponse(0);
theNode->setTrialDisp(*theNodeResponse);
*************************************************************/
*theNodeResponse = theNode->getTrialVel();
(*theNodeResponse)(dofNumber) = theGroundMotionResponse(1);
theNode->setTrialVel(*theNodeResponse);
*theNodeResponse = theNode->getTrialAccel();
(*theNodeResponse)(dofNumber) = theGroundMotionResponse(2);
theNode->setTrialAccel(*theNodeResponse);
return 0;
}