Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in OpenGL visualizer #3533

Merged
merged 5 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions samples/visualization_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
group.add_argument("--wall", action="store_const", dest="shape", const="Wall",
default="Wall")
for shape in ("Sphere", "Ellipsoid", "Cylinder", "SpheroCylinder",
"Stomatocyte", "SimplePore", "SlitPore", "HollowConicalFrustum"):
"Stomatocyte", "SimplePore", "Slitpore", "HollowConicalFrustum"):
group.add_argument("--" + shape.lower(), action="store_const",
dest="shape", const=shape)
args = parser.parse_args()
Expand Down Expand Up @@ -62,51 +62,53 @@
dist=20, normal=[0.1, 0.0, 1]),
particle_type=0, penetrable=True)

if args.shape == "Sphere":
elif args.shape == "Sphere":
system.constraints.add(shape=espressomd.shapes.Sphere(
center=[25, 25, 25], radius=15, direction=1),
particle_type=0, penetrable=True)

if args.shape == "Ellipsoid":
elif args.shape == "Ellipsoid":
system.constraints.add(shape=espressomd.shapes.Ellipsoid(
center=[25, 25, 25], a=25, b=15, direction=1),
particle_type=0, penetrable=True)

if args.shape == "Cylinder":
elif args.shape == "Cylinder":
system.constraints.add(shape=espressomd.shapes.Cylinder(
center=[25] * 3, axis=[1, 0, 0], direction=1, radius=10, length=30),
particle_type=0,
penetrable=True)

if args.shape == "SpheroCylinder":
elif args.shape == "SpheroCylinder":
system.constraints.add(
shape=espressomd.shapes.SpheroCylinder(center=[25] * 3, axis=[1, 0, 0],
direction=1, radius=10, length=30),
particle_type=0,
penetrable=True)

if args.shape == "Stomatocyte":
elif args.shape == "Stomatocyte":
system.constraints.add(shape=espressomd.shapes.Stomatocyte(
inner_radius=3, outer_radius=7, axis=[1.0, 0.0, 0.0], center=[25] * 3,
layer_width=3, direction=1), particle_type=0, penetrable=True)

if args.shape == "SimplePore":
elif args.shape == "SimplePore":
system.constraints.add(shape=espressomd.shapes.SimplePore(
center=[25, 25, 25], axis=[1, 0, 0], length=15, radius=12.5,
smoothing_radius=2), particle_type=0, penetrable=True)

if args.shape == "Slitpore":
elif args.shape == "Slitpore":
system.constraints.add(shape=espressomd.shapes.Slitpore(
channel_width=15, lower_smoothing_radius=3, upper_smoothing_radius=3,
pore_length=20, pore_mouth=30, pore_width=5), particle_type=0,
penetrable=True)

if args.shape == "HollowConicalFrustum":
elif args.shape == "HollowConicalFrustum":
system.constraints.add(shape=espressomd.shapes.HollowConicalFrustum(
r1=12, r2=8, length=15.0, thickness=3,
axis=[0.0, 0.0, 1.0], center=[25, 25, 25], direction=1),
particle_type=0, penetrable=True)

else:
raise ValueError("Unknown shape '{}'".format(args.shape))

for i in range(100):
rpos = np.random.random(3) * box_l
Expand Down
Loading