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


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

本文整理汇总了C++中Domain::getElement方法的典型用法代码示例。如果您正苦于以下问题:C++ Domain::getElement方法的具体用法?C++ Domain::getElement怎么用?C++ Domain::getElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Domain的用法示例。


在下文中一共展示了Domain::getElement方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void
Pressure_Constraint::connect(int eleId, bool fluid)
{
    Domain* theDomain = this->getDomain();
    if(theDomain == 0) {
        opserr<<"WARNING: domain has not been set";
        opserr<<" -- Pressure_Constraint::connect\n";
        return;
    }

    Element* theEle = theDomain->getElement(eleId);
    if(theEle == 0) {
        opserr<<"WARNING: element "<<eleId<<" does not exist ";
        opserr<<"-- Pressure_Constraint::connect\n";
        return;
    }

    if(fluid) {
        fluidEleTags.insert(eleId);
    } else {
        bool isfluid = false;
        for(int i=0; i<fluidEleTags.Size(); i++) {
            if(fluidEleTags(i) == eleId) {
                isfluid = true;
                break;
            }
        }
        if(!isfluid) {
            otherEleTags.insert(eleId);
        }
    }
}
开发者ID:fmckenna,项目名称:OpenSees,代码行数:32,代码来源:Pressure_Constraint.cpp

示例2:

int
MeshRegion::setRayleighDampingFactors(double alpham, double betak, double betak0, double betakc)
{
  alphaM = alpham;
  betaK  = betak;
  betaK0 = betak0;
  betaKc = betakc;

  // now set the damping factors at the nodes & elements
  Domain *theDomain = this->getDomain();
  if (theDomain == 0) {
    opserr << "MeshRegion::setRayleighDampingFactors() - no domain yet set\n";
    return -1;
  }
  if (theElements != 0) {
    for (int i=0; i<theElements->Size(); i++) {
      int eleTag = (*theElements)(i);
      Element *theEle = theDomain->getElement(eleTag);
      if (theEle != 0)
	theEle->setRayleighDampingFactors(alphaM, betaK, betaK0, betaKc);
    }
  }

  if (theNodes != 0) {
    for (int i=0; i<theNodes->Size(); i++) {
      int nodTag = (*theNodes)(i);
      Node *theNode = theDomain->getNode(nodTag);
      if (theNode != 0)
	theNode->setRayleighDampingFactor(alphaM);
    }
  }

  return 0;
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:34,代码来源:MeshRegion.cpp

示例3: release

void Receiver::release(PointwiseRecorder &recorderPW, const Domain &domain, 
    int elemTag, const RDMatPP &interpFact) {
    Element *myElem = domain.getElement(elemTag);
    if (mDumpStrain || mDumpCurl) {
        myElem->forceTIso();
    }
    recorderPW.addReceiver(mName, mNetwork, mPhi, interpFact, myElem, mTheta, mBackAzimuth,
        mLat, mLon, mDepth, mDumpStrain, mDumpCurl);
}
开发者ID:kuangdai,项目名称:AxiSEM3D,代码行数:9,代码来源:Receiver.cpp

示例4: ID

int 
MeshRegion::setElements(const ID &theEles)
{
  // destroy the old lists
  if (theNodes != 0)
    delete theNodes;
  if (theElements != 0)
    delete theElements;

  // create new element & node lists

  int numEle = theEles.Size();

  theElements = new ID(0, numEle); // don't copy yet .. make sure ele in domain
  theNodes = new ID(0, numEle); // initial guess at size of ID
  if (theElements == 0 || theNodes == 0) {
    opserr << "MeshRegion::setElements() - ran out of memory\n";
    return -1;
  }

  // now loop over the elements in ele ID passed in to create the node & ele list
  // NOTE - only add those elements to the list that are in the domain
  // NOTE - node added to region if any element has it as an external node
  int locEle = 0;
  int locNode = 0;


  Domain *theDomain = this->getDomain();
  if (theDomain == 0) {
    opserr << "MeshRegion::setElements() - no domain yet set\n";
    return -1;
  }

  Element *theEle;
  for (int i=0; i<numEle; i++) {
    int eleTag = theEles(i);
    theEle = theDomain->getElement(eleTag);
    if (theEle != 0) {

      if (theElements->getLocation(eleTag) < 0)
	  (*theElements)[locEle++] = eleTag;

      const ID &theEleNodes = theEle->getExternalNodes();

      for (int i=0; i<theEleNodes.Size(); i++) {
	int nodeTag = theEleNodes(i);
	// add the node tag if not already there
	if (theNodes->getLocation(nodeTag) < 0)
	  (*theNodes)[locNode++] = nodeTag;
      }
    }
  }

  return 0;
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:55,代码来源:MeshRegion.cpp

示例5: nodeTag


//.........这里部分代码省略.........
    }
  } else
    secTags[0] = 0;
  
  if (slaveTags[0] != 0 || slaveTags.Size() != 1) {
    slaveFlag = true;
    for (int l=0 ; l<slaveTags.Size() ; l++) {
      slaveEleTags(l) = slaveTags(l);
#ifdef MMTDEBUG
      opserr<<"storing slaveEleID = "<<slaveTags[l]<<endln;
#endif
    }
  } else
    slaveEleTags[0] = 0;


  if (thefileNameinf != 0)  { 
    int fileNameLength2 = strlen(thefileNameinf) + 1;
    //   fileName = new char[fileNameLength + 8];
    fileNameinf = new char[fileNameLength2];
    strcpy(fileNameinf, thefileNameinf);
  }
  
  Element *theEle = 0;
  const char **argv = new const char *[1];
  if (fileNameinf == 0)
    argv[0] = "getRemCriteria1";
  else
    argv[0] = "getRemCriteria2";


  // Get the element	
  for (int j= 0; j<numEles; j++) {
    Element *theEle = theDomainPtr.getElement(eleTags[j]);
    if ( theEle == NULL ) {
      opserr << "WARNING RemoveRecorder::RemoveRecorder() - no element with tag: "
	     << eleTags[j] << " exists in Domain\n";
      eleResponses[j] = 0;
    } else {

      // set up the element responses
      eleResponses[j] = theEle->setResponse(argv, 1, s);
      if (eleResponses[j] == 0) {
	opserr << "WARNING :: getRemCriteria - not a response quantity of element\n";
      } else {
	if (fileNameinf != 0) {
	  Information &eleInfo = eleResponses[j]->getInformation();
	  eleInfo.setString(fileNameinf);
	}
      }  
    }
  }

  delete [] argv;


  if (slaveEleTags[0] != 0) {
    for (int k= 0; k<slaveTags.Size(); k++) {
      theEle = theDomainPtr.getElement(slaveTags[k]);
      if ( theEle == NULL ) {
	opserr << "WARNING RemoveRecorder::RemoveRecorder() - no element with tag: "
	       << slaveTags[k] << " exists in Domain\n";
	exit(-1);
      }
    }
  }
开发者ID:aceskpark,项目名称:osfeo,代码行数:67,代码来源:RemoveRecorder.cpp

示例6: RotationShearCurve

void *
OPS_RotationShearCurve(void)
{
  if (shearCurveCount == 0) {
    opserr << "RotationShearCurve limit curve - Written by MRL UT Austin Copyright 2012 -  Use at your Own Peril \n";
    shearCurveCount++;
  }

  int argc = OPS_GetNumRemainingInputArgs();

  if (!(argc == 9 || argc == 23)) { 
    opserr << "WARNING RotationShearCurve -- insufficient arguments\n";
    opserr << "For direct input of shear curve parameters and degrading slope want:\n\n";
    opserr << "limitCurve RotationShearCurve crvTag? eleTag? \n";
    opserr << "ndI? ndJ? rotAxis? Vn? Vr? Kdeg? rotLim? \n" << endln;
    
    opserr << "OR for calibrated shear curve and degrading slope want:\n\n";
    opserr << "limitCurve RotationShearCurve crvTag? eleTag?\n";
    opserr << "ndI? ndJ? rotAxis? Vn? Vr? Kdeg? defType?\n";
    opserr << "b? d? h? L? st? As? Acc? ld? db? rhot? f'c?\n";
    opserr << "fy? fyt? delta?\n" << endln;
    
    return 0;
  }

  int iTagData[2];	  
  int iNodeData[3];	  
  double dKdegData[3];  
  double dRotLimData[1];
  int iTypeData[1];	  
  double dPropData[14]; 
  
  int numData;
  numData = 2;
  if (OPS_GetIntInput(&numData, iTagData) != 0) {
    opserr << "WARNING RotationShearCurve -- invalid crvTag? eleTag?\n" << endln;
    return 0;
  }
  int eleTag = iTagData[1];
  Domain *theDomain = 0;
  theDomain = OPS_GetDomain();
  if (theDomain == 0) {
    opserr << "WARNING RotationShearCurve -- Pointer to Domain was not returned\n" << endln;
    return 0;
  }
  Element *theElement = 0;
  theElement = theDomain->getElement(eleTag);
  if (theElement == 0) {
    opserr << "WARNING RotationShearCurve -- Element with tag " << iTagData[1] << " does not exist for shear curve tag " << iTagData[0] << endln << endln;
    return 0;
  }
  numData = 3;
  if (OPS_GetIntInput(&numData, iNodeData) != 0) {
    opserr << "WARNING RotationShearCurve -- invalid ndI? ndJ? rotAxis?\n" << endln;
    return 0;
  }
  Node *theNodeI = 0;
  theNodeI = theDomain->getNode(iNodeData[0]);
  if (theNodeI == 0) {
    opserr << "WARNING RotationShearCurve -- Node with tag " << iNodeData[0] << " does not exist for shear curve tag " << iTagData[0] << endln << endln;
    return 0;
  }	
  Node *theNodeJ = 0;
  theNodeJ = theDomain->getNode(iNodeData[1]);
  if (theNodeJ == 0) {
    opserr << "WARNING RotationShearCurve -- Node with tag " << iNodeData[1] << " does not exist for shear curve tag " << iTagData[0] << endln << endln;
    return 0;
  }	
  if (iNodeData[2] < 3 || iNodeData[2] > 6) {
    opserr << "WARNING RotationShearCurve -- rotAxis is invalid\n";
    opserr << "rotAxis = 3 -- Rotation about z-axis - 2D\n";
    opserr << "rotAxis = 4 -- Rotation about x-axis - 3D\n";
    opserr << "rotAxis = 5 -- Rotation about y-axis - 3D\n";
    opserr << "rotAxis = 6 -- Rotation about z-axis - 3D\n" << endln;
    return 0;
  }
  if (argc == 9) {
    numData = 3;
    if (OPS_GetDoubleInput(&numData, dKdegData) != 0) {
      opserr << "WARNING RotationShearCurve -- invalid Vn? Vr? Kdeg?\n" << endln;
      return 0;
    }
    if (dKdegData[0] != -1 && !(dKdegData[0] > 0)) {
      opserr << "WARNING RotationShearCurve --  Vn input is invalid\n";
      opserr << "Vn = -1 -- Shear critical limit is not used\n";
      opserr << "Vn > 0 -- Shear critical limit is the input value\n" << endln;
      return 0;
    }
    if (dKdegData[1] < -1) {
      opserr << "WARNING RotationShearCurve -- Vr input is invalid\n";
      opserr << "Vr = -1 -- Residual shear strength = 0.2*(maximum shear at failure)\n";
      opserr << "-1 < Vr < 0 -- Residual shear strength = Vr*(maximum shear at failure)\n";
      opserr << "Vr >= 0 -- Residual shear strength is the input value\n" << endln;
      return 0;
    }
    if (dKdegData[2] >= 0) {
      opserr << "WARNING RotationShearCurve -- Kdeg input is invalid\n";
      opserr << "The degrading slope must be less than zero\n" << endln;
      return 0;
    }
//.........这里部分代码省略.........
开发者ID:aceskpark,项目名称:osfeo,代码行数:101,代码来源:RotationShearCurve.cpp


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