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


C++ UniaxialMaterial::getStress方法代码示例

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


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

示例1:

int
FiberSection3dThermal::revertToLastCommit(void)
{
  int err = 0;

  // Last committed section deformations
  e = eCommit;


  kData[0] = 0.0; kData[1] = 0.0; kData[2] = 0.0; kData[3] = 0.0;
  kData[4] = 0.0; kData[5] = 0.0; kData[6] = 0.0; kData[7] = 0.0;
  kData[8] = 0.0; 
  sData[0] = 0.0; sData[1] = 0.0;  sData[2] = 0.0; 

  int loc = 0;

  for (int i = 0; i < numFibers; i++) {
    UniaxialMaterial *theMat = theMaterials[i];
    double y = matData[loc++] - yBar;
    double z = matData[loc++] - zBar;
    double A = matData[loc++];

    // invoke revertToLast on the material
    err += theMat->revertToLastCommit();

    double tangent = theMat->getTangent();
    double stress = theMat->getStress();

    double value = tangent * A;
    double vas1 = y*value;
    double vas2 = z*value;
    double vas1as2 = vas1*z;

    kData[0] += value;
    kData[1] += vas1;
    kData[2] += vas2;
    
    kData[4] += vas1 * y;
    kData[5] += vas1as2;
    
    kData[8] += vas2 * z; 

    double fs0 = stress * A;
    sData[0] += fs0;
    sData[1] += fs0 * y;
    sData[2] += fs0 * z;
  }

  kData[3] = kData[1];
  kData[6] = kData[2];
  kData[7] = kData[5];

  return err;
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:54,代码来源:FiberSection3dThermal.cpp

示例2:

int
FiberSection2d::revertToLastCommit(void)
{
  int err = 0;

  // Last committed section deformations
  e = eCommit;


  kData[0] = 0.0; kData[1] = 0.0; kData[2] = 0.0; kData[3] = 0.0;
  sData[0] = 0.0; sData[1] = 0.0;
  
  static double fiberLocs[10000];
  static double fiberArea[10000];

  if (sectionIntegr != 0) {
    sectionIntegr->getFiberLocations(numFibers, fiberLocs);
    sectionIntegr->getFiberWeights(numFibers, fiberArea);
  }  
  else {
    for (int i = 0; i < numFibers; i++) {
      fiberLocs[i] = matData[2*i];
      fiberArea[i] = matData[2*i+1];
    }
  }

  for (int i = 0; i < numFibers; i++) {
    UniaxialMaterial *theMat = theMaterials[i];
    double y = fiberLocs[i] - yBar;
    double A = fiberArea[i];

    // invoke revertToLast on the material
    err += theMat->revertToLastCommit();

    // get material stress & tangent for this strain and determine ks and fs
    double tangent = theMat->getTangent();
    double stress = theMat->getStress();
    double ks0 = tangent * A;
    double ks1 = ks0 * -y;
    kData[0] += ks0;
    kData[1] += ks1;
    kData[3] += ks1 * -y;

    double fs0 = stress * A;
    sData[0] = fs0;
    sData[1] = fs0 * -y;
  }

  kData[2] = kData[1];

  return err;
}
开发者ID:lge88,项目名称:OpenSees,代码行数:52,代码来源:FiberSection2d.cpp

示例3: OPS_getStress

int OPS_getStress()
{
    UniaxialMaterial* material = theTestingUniaxialMaterial;
    if (material == 0) {
	opserr<<"getStrain WARNING no active UniaxialMaterial - use testUniaxialMaterial command.\n";
	return -1;
    }

    double stress = material->getStress();

    int numData = 1;

    if (OPS_SetDoubleOutput(&numData, &stress) < 0) {
	opserr<<"failed to set stress\n";
	return -1;
    }

    return 0;
}
开发者ID:fmckenna,项目名称:OpenSees,代码行数:19,代码来源:OpenSeesUniaxialMaterialCommands.cpp

示例4:

int
RCFTSTLFiberSection3D::revertToStart(void)
{
  // revert the fibers to start    
  int err = 0;

  kData[0] = 0.0; kData[1] = 0.0; kData[2] = 0.0;
  kData[3] = 0.0; kData[4] = 0.0; kData[5] = 0.0;
  kData[6] = 0.0; kData[7] = 0.0; kData[8] = 0.0;
  kData[9] = 0.0; kData[10] = 0.0; kData[11] = 0.0;
  kData[12] = 0.0; kData[13] = 0.0; kData[14] = 0.0;
  kData[15] = 0.0;

  sData[0] = 0.0; sData[1] = 0.0; sData[2] = 0.0; 

  int loc = 0;

  for (int i = 0; i < numFibers; i++) {
    UniaxialMaterial *theMat = theMaterials[i];
    double y = matData[loc++] - yBar;
    double z = matData[loc++] - zBar;
    double A = matData[loc++];

    // invoke revertToStart on the material
    err += theMat->revertToStart();

    double tangent = theMat->getTangent();
    double stress = theMat->getStress();

    double value = tangent * A;
    double vas1 = y*value;
    double vas2 = z*value;
    double vas1as2 = vas1*z;
    double vas2as2 = vas2*z;
    double vas1as1 = vas1*y;

    kData[0] += value;
    kData[1] -= vas1;
    kData[1]  = 0.0;
    kData[2] -= vas2;
    kData[2]  = 0.0;
    kData[3]  = 0.0;
    kData[4] -= vas1;
    kData[4]  = 0.0;
    kData[5] += vas1as1;
    kData[6] += vas1as2;
    kData[6]  = 0.0;
    kData[7]  = 0.0;
    kData[8] -= vas2;
    kData[8]  = 0.0;
    kData[9] += vas1as2;
    kData[9]  = 0.0;
    kData[10]+= vas2as2;
    kData[11] = 0.0;
    kData[12] = 0.0;
    kData[13] = 0.0;
    kData[14] = 0.0;
    kData[15] = GJ;

    double fs0 = stress * A;
    sData[0] += fs0;
    sData[1] += fs0 * y;
    sData[2] += fs0 * z;
  }

  return err;
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:67,代码来源:RCFTSTLFiberSection3D.cpp

示例5: ks

int
RCFTSTLFiberSection3D::revertToLastCommit(void)
{
  int err = 0;

  // Last committed section deformations
  e = eCommit;

  kData[0] = 0.0; kData[1] = 0.0; kData[2] = 0.0;
  kData[3] = 0.0; kData[4] = 0.0; kData[5] = 0.0;
  kData[6] = 0.0; kData[7] = 0.0; kData[8] = 0.0;
  kData[9] = 0.0; kData[10] = 0.0; kData[11] = 0.0;
  kData[12] = 0.0; kData[13] = 0.0; kData[14] = 0.0;
  kData[15] = 0.0;

  sData[0] = 0.0; sData[1] = 0.0; sData[2] = 0.0; 

  int loc = 0;

  for (int i = 0; i < numFibers; i++) {
    UniaxialMaterial *theMat = theMaterials[i];
    double y = matData[loc++] - yBar;
    double z = matData[loc++] - zBar;
    double A = matData[loc++];

    // invoke revertToLast on the material
    err += theMat->revertToLastCommit();

    double tangent = theMat->getTangent();
    double stress = theMat->getStress();

    double value = tangent * A;
    double vas1 = y*value;
    double vas2 = z*value;
    double vas1as2 = vas1*z;
    double vas2as2 = vas2*z;
    double vas1as1 = vas1*y;

    kData[0] += value;
    kData[1] -= vas1;
    kData[2] -= vas2;
    kData[3]  = 0.0;
    kData[4] -= vas1;
    kData[5] += vas1as1;
    kData[6] += vas1as2;
    kData[7]  = 0.0;
    kData[8] -= vas2;
    kData[9] += vas1as2;
    kData[10]+= vas2as2;
    kData[11] = 0.0;
    kData[12] = 0.0;
    kData[13] = 0.0;
    kData[14] = 0.0;
    kData[15] = GJ;

    double fs0 = stress * A;
    sData[0] += fs0;
    sData[1] -= fs0 * y;
    sData[2] -= fs0 * z;
  }

  ks(0,0) = kData[0];
  ks(0,1) = ks(1,0) = kData[1];
  ks(0,2) = ks(2,0) = kData[2];
  ks(1,1) = kData[5];
  ks(1,2) = ks(2,1) = kData[6];
  ks(2,2) = kData[10];
  ks(3,3) = GJ;

  return err;
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:71,代码来源:RCFTSTLFiberSection3D.cpp

示例6:

int
FiberSection3d::revertToStart(void)
{
  // revert the fibers to start    
  int err = 0;


  kData[0] = 0.0; kData[1] = 0.0; kData[2] = 0.0; kData[3] = 0.0;
  kData[4] = 0.0; kData[5] = 0.0; kData[6] = 0.0; kData[7] = 0.0;
  kData[8] = 0.0; 
  sData[0] = 0.0; sData[1] = 0.0;  sData[2] = 0.0; 

  static double yLocs[10000];
  static double zLocs[10000];
  static double fiberArea[10000];

  if (sectionIntegr != 0) {
    sectionIntegr->getFiberLocations(numFibers, yLocs, zLocs);
    sectionIntegr->getFiberWeights(numFibers, fiberArea);
  }  
  else {
    for (int i = 0; i < numFibers; i++) {
      yLocs[i] = matData[3*i];
      zLocs[i] = matData[3*i+1];
      fiberArea[i] = matData[3*i+2];
    }
  }

  for (int i = 0; i < numFibers; i++) {
    UniaxialMaterial *theMat = theMaterials[i];
    double y = yLocs[i] - yBar;
    double z = zLocs[i] - zBar;
    double A = fiberArea[i];

    // invoke revertToStart on the material
    err += theMat->revertToStart();

    double tangent = theMat->getTangent();
    double stress = theMat->getStress();

    double value = tangent * A;
    double vas1 = -y*value;
    double vas2 = z*value;
    double vas1as2 = vas1*z;

    kData[0] += value;
    kData[1] += vas1;
    kData[2] += vas2;
    
    kData[4] += vas1 * -y;
    kData[5] += vas1as2;
    
    kData[8] += vas2 * z; 

    double fs0 = stress * A;
    sData[0] += fs0;
    sData[1] += fs0 * -y;
    sData[2] += fs0 * z;
  }

  kData[3] = kData[1];
  kData[6] = kData[2];
  kData[7] = kData[5];

  return err;
}
开发者ID:DBorello,项目名称:OpenSeesDev,代码行数:66,代码来源:FiberSection3d.cpp


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