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


Python CreasePatternView.configure_traits方法代码示例

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


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

示例1: get_constrained_YCP

# 需要导入模块: from oricrete.folding2 import CreasePatternView [as 别名]
# 或者: from oricrete.folding2.CreasePatternView import configure_traits [as 别名]
def get_constrained_YCP(L_x, L_y, n_x, n_y):
    def geo_trans(X):
        x, y, z = X.T
        y = y - 1.1

#    y[2], y[3], y[4], y[5] = -1.428, 1.428, -1, 1
        y[2], y[3], y[4], y[5] = -0.7488, 0.7488, -0.275, 0.275
#    x[2], x[3], x[8] , x[9] = 3.43, 3.43, 1.93, 4.93
        x[2], x[3], x[8] , x[9] = 3.6925, 3.6925, 2.045, 5.34
        return np.c_[x, y, z]




    cp = YoshimuraCreasePattern(L_x=L_x, L_y=L_y, n_x=n_x, n_y=n_y,
                            geo_transform=geo_trans)

    fixed_node = fix(cp.N_h[0, 0], (0, 1, 2))
    planar_front_boundary = link(cp.N_h[0, 0], 1, 1.0,
                             cp.N_h[1:, 0], 1, -1.0)
    planar_back_boundary = link(cp.N_h[0, -1], 1, 1.0,
                            cp.N_h[1:, -1], 1, -1.0)
    linked_left_boundary_x = link(cp.N_h[0, 0], 0, 1.0,
                              cp.N_h[0, 1:], 0, -1.0)
    linked_left_boundary_z = link(cp.N_h[0, 0], 2, 1.0,
                              cp.N_h[0, 1:], 2, -1.0)
    linked_left_and_right_z = link(cp.N_v[0, :], 2, 1.0,
                               cp.N_v[1, :], 2, -1.0)
#    linked_right_boundary_x = link(ycp.N_v[-1, 0], 0, 1.0,
#                                   ycp.N_v[-1, 1:], 0, -1.0)
    cntrl_displ = [([(cp.N_v[1, 0], 0, 1.0)], -1)]
    cs = fixed_node + planar_front_boundary + planar_back_boundary + linked_left_boundary_x + linked_left_boundary_z + linked_left_and_right_z + cntrl_displ

    caf = CnstrTargetFace(F=[r_, s_, 4 * 0.4 * t_ * r_ * (1 - r_ / L_x) + 0.15])
    n_arr = np.hstack([cp.N_h[:, :].flatten(),
                   cp.N_i[:, :].flatten()
                  ])

    init = Initialization(cp=cp, tf_lst=[(caf, n_arr)])
    fold = Folding(source=init, n_steps=10, dof_constraints=cs)
    fold.u_1

    print 'nodal coordinates', fold.x_1
    print 'facets', fold.F
    print 'facet coordinates', fold.x_1[fold.F]

    v = CreasePatternView(root=init)
    v.configure_traits()

    return fold
开发者ID:simvisage,项目名称:oricrete,代码行数:52,代码来源:ycp_1x2_inclined_joist.py

示例2: get_constrained_YCP

# 需要导入模块: from oricrete.folding2 import CreasePatternView [as 别名]
# 或者: from oricrete.folding2.CreasePatternView import configure_traits [as 别名]
def get_constrained_YCP(L_x, L_y, n_x, n_y):
    
    ycp = YoshimuraCreasePattern(L_x=L_x, L_y=L_y, n_x=n_x, n_y=n_y)
    
    fixed_node = fix(ycp.N_h[0, 0], (0, 1, 2))
    planar_front_boundary = link(ycp.N_h[0, 0], 1, 1.0,
                                 ycp.N_h[1:, 0], 1, -1.0)
    planar_back_boundary = link(ycp.N_h[0, -1], 1, 1.0,
                                 ycp.N_h[1:, -1], 1, -1.0)
    linked_left_boundary_x = link(ycp.N_h[0, 0], 0, 1.0,
                                  ycp.N_h[0, 1:], 0, -1.0)
    linked_left_boundary_z = link(ycp.N_h[0, 0], 2, 1.0,
                                  ycp.N_h[0, 1:], 2, -1.0)
    linked_left_and_right_z = link(ycp.N_v[0, :], 2, 1.0,
                                   ycp.N_v[1, :], 2, -1.0)
    linked_right_boundary_x = link(ycp.N_v[-1, 0], 0, 1.0,
                                   ycp.N_v[-1, 1:], 0, -1.0)
    cntrl_displ = [([(ycp.N_h[-1, 1], 0, 1.0)], -1.15)]
    cs = fixed_node + planar_front_boundary + planar_back_boundary + linked_left_boundary_x + linked_left_boundary_z + linked_left_and_right_z + linked_right_boundary_x + cntrl_displ

    caf = CnstrTargetFace(F=[r_, s_, 4 * 0.4 * t_ * r_ * (1 - r_ / L_x) + 0.15])
    n_arr = np.hstack([ycp.N_h[:, :].flatten(),
                   ycp.N_i[:, :].flatten()
                  ])

    init = Initialization(cp=ycp, tf_lst=[(caf, n_arr)])
    fold = Folding(source=init, n_steps=10, dof_constraints=cs)
    fold.u_1

    print 'nodal coordinates', fold.x_1
    print 'facets', fold.F
    print 'facet coordinates', fold.x_1[fold.F]
    print "punkte" , fold.x_t[-1]
    print "hallo", ycp.F_L
    print "nodes_neighbors", ycp.N_neighbors
    v = CreasePatternView(root=init)
    v.configure_traits()

    return fold
开发者ID:simvisage,项目名称:oricrete,代码行数:41,代码来源:skatch.py

示例3: get_constrained_YCP

# 需要导入模块: from oricrete.folding2 import CreasePatternView [as 别名]
# 或者: from oricrete.folding2.CreasePatternView import configure_traits [as 别名]
        source=init,
        n_steps=10,
        MAX_ITER=500,
        goal_function_type="none",
        dof_constraints=fixed_node
        + planar_front_boundary
        + planar_back_boundary
        + linked_left_boundary_x
        + linked_left_boundary_z
        + linked_left_and_right_z
        + linked_right_boundary_x
        + cntrl_displ,
        #                    tf_lst=[(caf, n_arr)]
    )
    print "u", lift.u_t[-1]
    return init, lift


"""configure parameters:"""

init, fold = get_constrained_YCP(
    L_x=6.3, L_y=4.2, n_x=4, n_y=8, d=-1.25
)  # l_x length, l_y length, n_x number of elments, n_y number of Elements, d deformation of the right side


v = CreasePatternView(root=init)
v.configure_traits()
al = AbaqusLink(data=fold, n_split=10)
al.model_name = "x3y8"
al.build_inp()
开发者ID:simvisage,项目名称:oricrete,代码行数:32,代码来源:vault_shape.py

示例4: CnstrTargetFace

# 需要导入模块: from oricrete.folding2 import CreasePatternView [as 别名]
# 或者: from oricrete.folding2.CreasePatternView import configure_traits [as 别名]
n_r_h = cp.N_h[-1, (0, -1)].flatten()
n_lr_h = cp.N_h[(0, 0, -1, -1), (0, -1, 0, -1)].flatten()
n_fixed_y = cp.N_h[(0, -1), 2].flatten()

corner_slides = [([(cp.N_h[0, 0], 0, L_x), (cp.N_h[0, 0], 1, -L_y)], 0),
         ([(cp.N_h[-1, 0], 0, L_x), (cp.N_h[-1, 0], 1, L_y)], 0),
         ([(cp.N_h[-1, -1], 0, L_x), (cp.N_h[-1, -1], 1, -L_y)], 0),
         ([(cp.N_h[0, -1], 0, L_x), (cp.N_h[0, -1], 1, L_y)], 0),
         ([(cp.N_h[2, 0], 2, 1.0), (cp.N_h[2, -1], 2, -1.0)], 0),
         ([(cp.N_h[3, 0], 2, 1.0), (cp.N_h[3, -1], 2, -1.0)], 0),
         ([(cp.N_h[3, 0], 2, 1.0), (cp.N_h[2, 0], 2, -1.0)], 0),
         ([(cp.N_h[0, 2], 2, 1.0), (cp.N_h[-1, 2], 2, -1.0)], 0),
         ]

face_z_t = CnstrTargetFace(F=[r_, s_, -0.6 * t_ * (r_ * (1 - r_ / L_x) + s_ * (1 - s_ / L_y))])
init = Initialization(cp=cp, tf_lst=[(face_z_t, cp.N)], t_init=0.1)
fold = Folding(source=init,
               goal_function_type='potential_energy',
               n_steps=40,
               MAX_ITER=1000,
               #tf_lst=[(face_z_t, cp.N)],
               dof_constraints=fix(n_l_h, [0], v) + fix(n_lr_h, [2]) + \
                               fix(n_fixed_y, [1]) + fix(n_r_h, [0], -v) + \
                               corner_slides)
#               dof_constraints=fix([0, 1], [0], v) + fix([0, 1, 6, 7], [2]) + \
#                               fix([0], [1]) + fix([6, 7], [0], -v))
fold.u_t[-1]

cpw = CreasePatternView(root=init)
cpw.configure_traits()
开发者ID:kelidas,项目名称:oricrete,代码行数:32,代码来源:ycp02_3x4_poteng_ff_dev.py


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