当前位置: 首页>>代码示例>>C++>>正文


C++ Domain::getLoadPattern方法代码示例

本文整理汇总了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;
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:65,代码来源:ImposedMotionSP.cpp


注:本文中的Domain::getLoadPattern方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。