예제 #1
0
int 
PDeltaCrdTransf2d::initialize(Node *nodeIPointer, Node *nodeJPointer)
{       
    int error;
    
    nodeIPtr = nodeIPointer;
    nodeJPtr = nodeJPointer;
    
    if ((!nodeIPtr) || (!nodeJPtr))
    {
        opserr << "\nPDeltaCrdTransf2d::initialize";
        opserr << "\ninvalid pointers to the element nodes\n";
        return -1;
    }
    
    // see if there is some initial displacements at nodes
    if (initialDispChecked == false) {
        
        const Vector &nodeIDisp = nodeIPtr->getDisp();
        const Vector &nodeJDisp = nodeJPtr->getDisp();
        for (int i=0; i<3; i++)
            if (nodeIDisp(i) != 0.0) {
                nodeIInitialDisp = new double [3];
                for (int j=0; j<3; j++)
                    nodeIInitialDisp[j] = nodeIDisp(j);
                i = 3;
            }
            for (int j=0; j<3; j++)
                if (nodeJDisp(j) != 0.0) {
                    nodeJInitialDisp = new double [3];
                    for (int i=0; i<3; i++)
                        nodeJInitialDisp[i] = nodeJDisp(i);
                    j = 3;
                }
                
                initialDispChecked = true;
    }
    
    // get element length and orientation
    if ((error = this->computeElemtLengthAndOrient()))
        return error;
    
    
    return 0;
}
예제 #2
0
파일: CrdTransf3d.cpp 프로젝트: lcpt/xc
int XC::CrdTransf3d::initialize(Node *nodeIPointer, Node *nodeJPointer)
  {
    int error;
    set_node_ptrs(nodeIPointer,nodeJPointer);

    // Checks if they are initial displacements of the nodes.
    if(initialDispChecked == false)
      {
        const Vector &nodeIDisp = nodeIPtr->getDisp();
        const Vector &nodeJDisp = nodeJPtr->getDisp();
        for(int i=0;i<6;i++)
          if(nodeIDisp(i)!=0.0) //Found displacement of node I.
            {
              nodeIInitialDisp.resize(6);
              for(int j=0;j<6;j++)
                nodeIInitialDisp[j]= nodeIDisp(j); //Setting initial displacements.
              i= 6; //exit.
            }

        for(int j=0; j<6; j++)
          if(nodeJDisp(j) != 0.0)
            {
              nodeJInitialDisp.resize(6);
              for(int i=0; i<6; i++)
                nodeJInitialDisp[i] = nodeJDisp(i); //Asignamos displacements iniciales.
              j = 6;
            }
        initialDispChecked = true;
      }

    // get element length and orientation
    if((error = this->computeElemtLengthAndOrient()))
      return error;

    static Vector XAxis(3);
    static Vector YAxis(3);
    static Vector ZAxis(3);

    // get 3by3 rotation matrix
    if((error = this->getLocalAxes(XAxis, YAxis, ZAxis)))
      return error;
    return 0;
  }