コード例 #1
0
ファイル: motivation.py プロジェクト: xiuru-yan/espresso
# front wall of the channel
front_shape = shapes.Rhomboid(corner=[0.0, 0.0, 0.0], a=[boxX, 0.0, 0.0],
                              b=[0.0, 1.0, 0.0], c=[0.0, 0.0, boxZ], direction=1)
boundaries.append(front_shape)
output_vtk_rhomboid(
    front_shape, out_file=output_path + "/wallFront.vtk")

# back wall of the channel
back_shape = shapes.Rhomboid(corner=[0.0, boxY - 1.0, 0.0], a=[boxX, 0.0, 0.0],
                             b=[0.0, 1.0, 0.0], c=[0.0, 0.0, boxZ], direction=1)
boundaries.append(back_shape)
output_vtk_rhomboid(
    back_shape, out_file=output_path + "/wallBack.vtk")

# obstacle - cylinder A
cylA_shape = shapes.Cylinder(center=[11.0, 2.0, boxZ / 2.], axis=[0.0, 0.0, 1.0],
                             length=boxZ, radius=2.0, direction=1)
boundaries.append(cylA_shape)
output_vtk_cylinder(
    cylA_shape, n=20, out_file=output_path + "/cylinderA.vtk")

# obstacle - cylinder B
cylB_shape = shapes.Cylinder(center=[16.0, 8.0, boxZ / 2.], axis=[0.0, 0.0, 1.0],
                             length=boxZ, radius=2.0, direction=1)
boundaries.append(cylB_shape)
output_vtk_cylinder(
    cylB_shape, n=20, out_file=output_path + "/cylinderB.vtk")

# obstacle - cylinder C
cylC_shape = shapes.Cylinder(center=[11.0, 12.0, boxZ / 2.], axis=[0.0, 0.0, 1.0],
                             length=boxZ, radius=2.0, direction=1)
boundaries.append(cylC_shape)
コード例 #2
0
oif.output_vtk_rhomboid(rhom_shape=tmp_shape, out_file=directory+"/vtk/wallTop.vtk")

# front wall of the channel
tmp_shape = shapes.Rhomboid(corner=[0.0, 0.0, 0.0], a=[boxX, 0.0, 0.0], b=[0.0, 1.0, 0.0], c=[0.0, 0.0, boxZ],
                            direction=1)
boundaries.append(tmp_shape)
oif.output_vtk_rhomboid(rhom_shape=tmp_shape, out_file=directory+"/vtk/wallFront.vtk")

# back wall of the channel
tmp_shape = shapes.Rhomboid(corner=[0.0, boxY-1.0, 0.0], a=[boxX, 0.0, 0.0], b=[0.0, 1.0, 0.0], c=[0.0, 0.0, boxZ],
                            direction=1)
boundaries.append(tmp_shape)
oif.output_vtk_rhomboid(rhom_shape=tmp_shape, out_file=directory+"/vtk/wallBack.vtk")

# cylinder A
tmp_shape = shapes.Cylinder(center=[boxX/2, boxY/2, boxZ/2], axis=[0.0, 0.0, 1.0], length=boxZ, radius=6.0, direction=1)
boundaries.append(tmp_shape)
oif.output_vtk_cylinder(cyl_shape=tmp_shape, n=20, out_file=directory+"/vtk/cylinderA.vtk")

boundary_particle_type = 100

print("Boundaries created.")

# cell constants (4 cells in linear formation)
cell_radius = r_cell
cell_positions = []

gap_size = 0.5

cluster_centerX = cell_radius * 5
cluster_centerY = boxY/2.0