本文整理汇总了Python中oricrete.folding2.CreasePatternView类的典型用法代码示例。如果您正苦于以下问题:Python CreasePatternView类的具体用法?Python CreasePatternView怎么用?Python CreasePatternView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CreasePatternView类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_constrained_YCP
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
示例2: get_constrained_YCP
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
示例3: get_constrained_YCP
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()
示例4: CnstrTargetFace
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()