예제 #1
0
def close_Shear_center(cos_value,
                       profile_constant,
                       thickness=[],
                       basic_point=[0, 0]):
    '''
	Only used when the profile with only one closed cell
	'''
    bp = basic_point
    if not is_point_in(bp, cos_value):
        raise 'basic point not in profile,Choose another one'

    Pc = profile_constant

    c_x = copy.copy(cos_value)
    Tk1 = copy.copy(thickness)

    k = profile_toolbox.if_clockwise(c_x)
    if k > 0:
        c_x.reverse()
        Tk1.reverse()

    cc = open_profile.Open_Profile(c_x, Pc, thickness=Tk1, Qx=0, Qy=1)
    xx = close_Shear_center_x(cc,cos_value=c_x,Shear_ST = cc.Shear_ST,\
     thickness = Tk1,basic_point = bp)
    ##--------------------------------------------------------------------------##

    c_y = copy.copy(cos_value)
    Tk2 = copy.copy(thickness)

    k = profile_toolbox.if_clockwise(c_y)
    if k < 0:
        c_y.reverse()
        Tk2.reverse()

    dd = open_profile.Open_Profile(c_y, Pc, thickness=Tk2, Qx=1, Qy=0)

    yy = close_Shear_center_y(dd,cos_value = c_y,Shear_ST = dd.Shear_ST,\
       thickness = Tk2,basic_point = bp)

    aa = (xx + basic_point[0]).round(4)
    bb = (yy + basic_point[1]).round(4)
    return [aa, bb]
	
	new_dir = Pc.profile_To_centriod()

	# graph_plugin.draw_point_graph(g,new_dir,color='b')

#-------------------------------------------------------------------------#
	shear_flow = {}
	LL = []
	shear_flow_list = []

#-------------------------------------------------------------------------#
	ccc = [9,8]
	cccc = [new_dir[i] for i in ccc]

	thk = graph_line_thickness(g,ccc)
	val = open_profile.Open_Profile(cccc,Pc,thickness = thk,Qx = 1,Qy = 0)

	LL.extend(line_value_package(ccc))
	shear_flow_list.extend(val.Shear_ST)

	aa = Shearflow_package(LL,shear_flow_list)
#-------------------------------------------------------------------------#
	ccc = [10,8]
	cccc = [new_dir[i] for i in ccc]

	thk = graph_line_thickness(g,ccc)
	val = open_profile.Open_Profile(cccc,Pc,thickness = thk,Qx = 1,Qy = 0)

	LL.extend(line_value_package(ccc))
	shear_flow_list.extend(val.Shear_ST)
	
    g = Graph()
    for i in range(len(dirddd)):
        g.addVertex(i)
    for i in range(len(dirddd) - 1):
        g.addEdge(i, i + 1, 1)

# draw_point_graph(g,dirddd,color='b')

    val = Profile_Constant(graph=g, dir=dirddd)

    lis = val.profile_To_centriod()

    thk = graph_line_thickness(g, [0, 1, 2, 3])

    pp = [-0.5, -0.5]

    cc = open_profile.Open_Profile(lis, val, thickness=thk, Qx=0, Qy=1)
    xx = open_profile.get_Shear_center_x(cc,
                                         Shear_ST=cc.Shear_ST,
                                         basic_point=pp)
    print cc.Shear_ST
    print 'xxxxxx--->\n', xx, xx - pp[0], xx + pp[0]

    cc = open_profile.Open_Profile(lis, val, thickness=thk, Qx=1, Qy=0)
    yy = -1.0 * open_profile.get_Shear_center_y(
        cc, Shear_ST=cc.Shear_ST, basic_point=pp)
    print cc.Shear_ST
    print 'yyyyyyy--->\n', yy, yy - pp[1], yy + pp[1]

    cc.report()
예제 #4
0
    thk = graph_line_thickness(g, [0, 1, 2, 3, 4, 5])
    print('--------------------------', thk)
    # draw_point_graph(g,dirddd,color='b')

    Pc = Profile_Constant(thickness=thk, graph=g, dir=dirddd)

    new_dir = Pc.profile_To_centriod()

    cccc = dict_To_cos(new_dir)
    # cccc = lis
    print('ccccc--->', cccc, '\n\n')

    pp = [-1.0246, -0.45]

    cc = open_profile.Open_Profile(cccc, Pc, thickness=thk, Qx=0, Qy=1)

    A = open_profile.Surround_Area(cc.cos_value, basic_point=[-1, 0])
    xx = open_profile.get_Shear_center_x(cc,
                                         Shear_ST=cc.Shear_ST,
                                         basic_point=pp)
    print('xxxxxx--->\n', xx, xx - pp[0], xx + pp[0])

    cc = open_profile.Open_Profile(cccc, Pc, thickness=thk, Qx=1, Qy=0)
    yy = open_profile.get_Shear_center_y(cc,
                                         Shear_ST=cc.Shear_ST,
                                         basic_point=pp)
    print('yyyyyyy--->\n', yy, yy - pp[1], yy + pp[1])

    # A = open_profile.Surround_Area(cc.cos_value,basic_point = [-1,0])
    # Q0 = open_profile.get_Shear_Qo(cc.Shear_ST,cccc,basic_point =[0,0]) / (2*A)
    print('area', Pc.Area)
    print('Ix-->', Pc.Ix)
    print('Iy-->', Pc.Iy)
    print('Ixy-->', Pc.Ixy)
    new_dir = Pc.profile_To_centriod()
    print('area', Pc.Area)
    print('Ix-->', Pc.Ix)
    print('Iy-->', Pc.Iy)
    print('Ixy-->', Pc.Ixy)

    # draw_point_graph(g,Pc.dir ,color='b')
    cccc = dict_To_cos(Pc.dir)
    # cccc = [new_dir[0],new_dir[1]]

    val = open_profile.Open_Profile(cccc, Pc, thickness=thk, Qx=0, Qy=10)
    print('__doc__-->', val.__doc__)
    print('cos_value-->', val.cos_value)
    print('length-->', val.length)
    print('Ix-->', val.Ix)
    print('Iy-->', val.Iy)
    print('Ixy-->', val.Ixy)
    print('Sx-->', val.Sx)
    print('Sy-->-->', val.Sy)
    print('Shear_ST-->', val.Shear_ST)

    A = open_profile.Surround_Area(val.cos_value, basic_point=[-1, 0])

    Q0 = open_profile.get_Shear_Qo(val.Shear_ST, val.cos_value) / (2 * A)
    print(Q0)