cylindrical box

51 views
Skip to first unread message

azam cheraghi

unread,
Mar 2, 2023, 7:12:37 PM3/2/23
to hoomd...@googlegroups.com
Hi,

I am trying to confine my hard particles in a cylindrical periodic box,using MC simulation, but I don't know how. I found the cylindrical.wall command, but it doesn't support the periodic box feature. I would really appreciate your help.

Regards
Azam
University of Saskatchewan, Canada

kmo...@ucsb.edu

unread,
Mar 3, 2023, 4:34:05 PM3/3/23
to hoomd-users
Hi Azam,

How would your box be both cylindrical and periodic? You can't tile a cylinder like you can a rectangular box. Do you mean periodic in the axial direction "z"? If so, that should be available using the appropriate axis flag in default cylindrical wall command.

Best,
Kevin

azam cheraghi

unread,
Mar 4, 2023, 9:46:34 AM3/4/23
to hoomd...@googlegroups.com
Hi,

Yes, it's period in Z axis. I realized that there's a cylindrical wall command but it mentions the wall commands are not periodic. Plus I don't know that if I use configuration.box, do I need to use the wall too or not.

Thanks
Azam


--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/352ba814-fdd7-49cc-b3a3-81dff4331682n%40googlegroups.com.

Joshua Anderson

unread,
Mar 4, 2023, 3:05:01 PM3/4/23
to hoomd...@googlegroups.com
Azam,

The *walls* themselves are not periodic. For example, if you place a radius 1 cylinder along the x-axis near the bottom (y=-L) of the box then particles at the top of the box (y=L) will not interact with it. However, when your walls match across periodic boundary conditions, then particles on both sides of the box will interact with the wall (which is infinite in the non-periodic space).

For walls in HPMC, the most important point to check is the "Wall support" section in the HPMC shape class to see if the wall you are interested in is supported by the shape you plan to use. Not all shapes support all walls.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

azam cheraghi

unread,
Mar 7, 2023, 10:03:54 AM3/7/23
to hoomd...@googlegroups.com
I think what I was first confused about is what is the difference between config.box command and hoomd.wall command. As I know the first one considers the periodic boundary and the other does not. But I don't know in my case do I need to define both? Because one of them is defining what is the origin of the cylinder and what is the diameter. Now to define the length (height) I have to consider the config.box command. My cylinder is defined in a way that it is periodic only in z direction, now to consider the periodic boundary, I don't know where to put the command and how?
The Shapes of particles that I am trying now are octahedron shaped and I am using the very first tutorial in MC which is a cube shaped box.

My second question:
Where can I find more examples of HoomD? Because I am really new to it.



Joshua Anderson

unread,
Mar 7, 2023, 10:55:26 AM3/7/23
to hoomd...@googlegroups.com
Azam,

hoomd.wall.Cylinder has no length property. See the full API and mathematical definition in the documentation: https://hoomd-blue.readthedocs.io/en/v3.9.0/module-hoomd-wall.html#hoomd.wall.Cylinder

I don't know what `config.box` command you are referring to. In HOOMD-blue, the simulation box is a property of the system state. There are many ways to access it, as detailed in the tutorials.

For more examples using HOOMD-blue, see the "Tutorials" and "How to" sections of the documentation: https://hoomd-blue.readthedocs.io/en/v3.9.0/index.html . Search or browse the documentation to find details on all the capabilities that HOOMD offers.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

Brandon Butler

unread,
Mar 7, 2023, 1:17:53 PM3/7/23
to hoomd...@googlegroups.com

Hey!

Dropping in here too. 'configuration/box' is a HOOMD GSD spec or part of the HOOMD snapshot not the state. All HOOMD simulations have a box which may or may not have walls defined in it. If you define a cylindrical wall which has the axis aligned with the z-axis, since the cylinder is infinite in the axis direction, the z direction inside the cylinder will be periodic since the box is. 

Best,

Brandon

To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/CAKfCtRNRPRRk4K5axY0rh_g6_WbiFuVRKp5b0pjocsHRBzTe9g%40mail.gmail.com.
--
Brandon Butler
MolSSI Fellow
PhD Candidate, Chemical Engineering and Scientific Computing | Glotzer Lab, University of Michigan
Email: butl...@umich.edu

azam cheraghi

unread,
Mar 7, 2023, 2:29:57 PM3/7/23
to hoomd...@googlegroups.com

snapshot.particles.types = ['octahedron']

snapshot.particles.typeid = [0] * 19

hoomd.wall.Cylinder(radius=1.95, axis=(0, 0, 1), origin=(0.0, 0.0, 0.0), inside=True, open=True)

snapshot.configuration.box = [40, 40, 40, 0, 0, 0]


with gsd.hoomd.open(name='p.gsd', mode='xb') as f:

    f.append(snapshot)


I tried to use the idea of having a cylindrical wall inside a cubic box, but when I start randomizing it, based on the result, it didnt include the walls and particles are all around the box.


Joshua Anderson

unread,
Mar 7, 2023, 3:58:29 PM3/7/23
to hoomd...@googlegroups.com
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

azam cheraghi

unread,
Mar 7, 2023, 5:50:57 PM3/7/23
to hoomd...@googlegroups.com
Awesome, that works now. Thanks a lot all.

Reply all
Reply to author
Forward
0 new messages