Beispiel #1
0
    /**
     Computes the axial strain along the structure at given locations.

     Arguments:
     Provide numpy array of points to evalute strain at (x,y,z)
     x(i) - x distance from elastic center for point i
     y(i) - y distance from elastic center for point i
     z(i) - z axial location of point i

     Return:
     epsilon_axial - a numpy array containing axial strain at point (x(i), y(i), z(i)) due to axial loads and bi-directional bending

     **/
    bpn::array computeAxialStrain(int length, const bpn::array &x_np, const bpn::array &y_np,
                                  const bpn::array &z_np) {


        Vector x(length);
        Vector y(length);
        Vector z(length);
        // Vector E(length);
        Vector epsilon_axial(length);

        for (int i = 0 ; i < length; i++) {
            x(i) = bp::extract<double>(x_np[i]);
            y(i) = bp::extract<double>(y_np[i]);
            z(i) = bp::extract<double>(z_np[i]);
            // E(i) = bp::extract<double>(E_np[i]);
        }

        beam->computeAxialStrain(x, y, z, epsilon_axial);

        bp::list list;
        for(int i = 0; i < epsilon_axial.size(); i++)
        {
            list.append(epsilon_axial(i));
        }

        return bpn::array(list);

    }
Beispiel #2
0
  /**
     Computes the axial strain along the structure at given locations.

     Arguments:
     Provide numpy array of points to evalute strain at (x,y,z)
     x(i) - x distance from elastic center for point i
     y(i) - y distance from elastic center for point i
     z(i) - z axial location of point i

     Return:
     epsilon_axial - a numpy array containing axial strain at point (x(i), y(i), z(i)) due to axial loads and bi-directional bending

  **/
  Vector computeAxialStrain(int length, Vector &x_np, Vector &y_np, Vector &z_np){
    
    Vector epsilon_axial(length);
    
    beam->computeAxialStrain(x_np, y_np, z_np, epsilon_axial);

    return epsilon_axial;
  }