what to write instead of hpmc.field.wall(mc)

18 views
Skip to first unread message

azam cheraghi

unread,
May 30, 2023, 11:53:37 AMMay 30
to hoomd...@googlegroups.com
Hi,

I am updating an old version code of hoomd to use it in my program. I don't know how to update that line ext_wall=hpmc.field.wall(mc)

old : ## set up the spherical container
    ext_wall = hpmc.field.wall(mc)
    container=container_helper.Sphere(ext_wall, cont_rad, origin=[0,0,0])

My changes: ext_wall = hpmc.field.wall(mc)
    walls = container_helperC.Sphere(ext_wall, cont_rad, origin=[0,0,0])
    wall_potential = hoomd.hpmc.external.wall.WallPotential(walls)
    mc.external_potential = wall_potential


The container_helperC is another python code that will change the ext_wall parameters like
class Sphere:
def __init__(self, ext_wall, rad, origin):
        self.R=rad
        self.origin=origin
        self.ext_wall=ext_wall
        self.ext_wall.add_sphere_wall(self.R, origin=self.origin)
        self.ext_wall.set_volume(4./3.*np.pi*pow(self.R,3.0))


Regards
Azam

Joshua Anderson

unread,
May 30, 2023, 12:19:57 PMMay 30
to hoomd...@googlegroups.com
Azam,

Thanks for sharing that information.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

--
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/CAKfCtRMdb3SFJ53NHHQo1tQcP0rOQa0gN0dy9epYrHbA5VcqSw%40mail.gmail.com.

azam cheraghi

unread,
May 30, 2023, 12:46:01 PMMay 30
to hoomd...@googlegroups.com
I actually needed help with that. Because of that line, I don't know how to change it.

Tim Moore

unread,
May 30, 2023, 9:40:31 PMMay 30
to hoomd...@googlegroups.com
Hi Azam,

You will need to be more specific to receive help on this mailing list. It is not clear what you are trying to achieve with the code you posted. I recommend working through the tutorials in the HOOMD-blue documentation to familiarize yourself with the v3 API, and then reading the documentation on using walls in hpmc. If you still have questions, then reply with a specific question about what you do not understand. 

Tim

--
Tim Moore
Reply all
Reply to author
Forward
0 new messages