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


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

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


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

示例1: kInitial

const Matrix&
FiberSection3d::getInitialTangent(void)
{
  static double kInitialData[9];
  static Matrix kInitial(kInitialData, 3, 3);
  
  kInitialData[0] = 0.0; kInitialData[1] = 0.0; 
  kInitialData[2] = 0.0; kInitialData[3] = 0.0;
  kInitialData[4] = 0.0; kInitialData[5] = 0.0; 
  kInitialData[6] = 0.0; kInitialData[7] = 0.0;
  kInitialData[8] = 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];

    double tangent = theMat->getInitialTangent();

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

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

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

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

示例2: kInitial

const Matrix&
FiberSection3dThermal::getInitialTangent(void)
{
  static double kInitialData[9];
  static Matrix kInitial(kInitialData, 3, 3);
  
  kInitialData[0] = 0.0; kInitialData[1] = 0.0; 
  kInitialData[2] = 0.0; kInitialData[3] = 0.0;
  kInitialData[4] = 0.0; kInitialData[5] = 0.0; 
  kInitialData[6] = 0.0; kInitialData[7] = 0.0;
  kInitialData[8] = 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++];

    double tangent = theMat->getInitialTangent();

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

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

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

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

示例3: kInitialMatrix

const Matrix&
FiberSection2d::getInitialTangent(void)
{
  static double kInitial[4];
  static Matrix kInitialMatrix(kInitial, 2, 2);
  kInitial[0] = 0.0; kInitial[1] = 0.0; kInitial[2] = 0.0; kInitial[3] = 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];

    double tangent = theMat->getInitialTangent();

    double ks0 = tangent * A;
    double ks1 = ks0 * -y;
    kInitial[0] += ks0;
    kInitial[1] += ks1;
    kInitial[3] += ks1 * -y;
  }

  kInitial[2] = kInitial[1];

  return kInitialMatrix;
}
开发者ID:DBorello,项目名称:OpenSeesDev,代码行数:39,代码来源:FiberSection2d.cpp

示例4: SectionForceDeformation

// constructors:
RCFTSTLFiberSection3D::RCFTSTLFiberSection3D(int tag, int num, Fiber **fibers, double gj): 
  SectionForceDeformation(tag, SEC_TAG_RCFTSTLFiberSection3D),
  numFibers(num), theMaterials(0), matData(0),
  yBar(0.0), zBar(0.0), e(4), eCommit(4), GJ(gj)
{
  ofstream stlfib;
  stlfib.open("stlfib.dat",ios::app);
  double EA = 0.0;
  double EQz = 0.0;
  double EQy = 0.0;
  double EIz = 0.0;
  double EIy = 0.0;
  double EIyz = 0.0;
  
  double Es = 0.0;    
  if (numFibers != 0) {
    theMaterials = new UniaxialMaterial *[numFibers];

    if (theMaterials == 0) {
      opserr << "RCFTSTLFiberSection3D::RCFTSTLFiberSection3D -- failed to allocate Material pointers\n";
      exit(-1);
    }

    matData = new double [numFibers*3];

    if (matData == 0) {
      opserr << "RCFTSTLFiberSection3D::RCFTSTLFiberSection3D -- failed to allocate double array for material data\n";
      exit(-1);
    }
    double Qz = 0.0;
    double Qy = 0.0;
    double A  = 0.0;
   
    for (int i = 0; i < numFibers; i++) {
      Fiber *theFiber = fibers[i];
      double yLoc, zLoc, Area;
      theFiber->getFiberLocation(yLoc, zLoc);
      Area = theFiber->getArea();
      UniaxialMaterial *theMat = theFiber->getMaterial();
      
      stlfib<<i<<"  "<<yLoc<<"  "<<zLoc<<"  "<<Area<<endl;
      Es = theMat->getInitialTangent();
      Qz += yLoc*Area;
      Qy += zLoc*Area;
      A  += Area;
      EQz += yLoc*Area*Es;
      EQy += zLoc*Area*Es;
      EA  += Area*Es;
      EIz += yLoc*yLoc*Area*Es;
      EIy += zLoc*zLoc*Area*Es;
      EIyz += yLoc*zLoc*Area*Es;
      
      matData[i*3] = -yLoc;
      matData[i*3+1] = zLoc;
      matData[i*3+2] = Area;
      theMaterials[i] = theMat->getCopy();

      if (theMaterials[i] == 0) {
	opserr << "RCFTSTLFiberSection3D::RCFTFiberSection3D -- failed to get copy of a Material\n";
	exit(-1);
      }
    }

    yBar = -Qz/A;
    zBar = Qy/A;
  }

  ks.Zero();

  ks(0,0) = EA;
  ks(0,1) = ks(1,0) = -EQz;
  ks(0,2) = ks(2,0) = -EQy;
  ks(1,1) = EIz;
  ks(2,2) = EIy;
  ks(2,1) = ks(1,2) = EIyz;
  ks(3,3) = GJ;

  //ks(0,0) = 449602.6;
  //ks(0,1) = ks(1,0) = 0.0;
  //ks(0,2) = ks(2,0) = 0.0;
  //ks(1,1) = 6968845.86;
  //ks(2,2) = 6968845.86;
  //ks(2,1) = ks(1,2) = 0.0;
  //ks(3,3) = GJ;

  //ks(0,0) = 1000.0;
  //ks(0,1) = ks(1,0) = 0.0;
  //ks(0,2) = ks(2,0) = 0.0;
  //ks(1,1) = 1.0;
  //ks(2,2) = 1.0;
  //ks(2,1) = ks(1,2) = 0.0;
  //ks(3,3) = GJ;

  //ks(0,0) = 300000.0;
  //ks(0,1) = ks(1,0) = 0.0;
  //ks(0,2) = ks(2,0) = 0.0;
  //ks(1,1) = 3000000.0;
  //ks(2,2) = 3000000.0;
  //ks(2,1) = ks(1,2) = 0.0;
//.........这里部分代码省略.........
开发者ID:aceskpark,项目名称:osfeo,代码行数:101,代码来源:RCFTSTLFiberSection3D.cpp

示例5: ks

const Matrix&
RCFTSTLFiberSection3D::getInitialTangent(void)
{
  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++];

    double tangent = theMat->getInitialTangent();
    
    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;
  }

  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 ks;
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:62,代码来源:RCFTSTLFiberSection3D.cpp


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