test equilibrium

31 views
Skip to first unread message

azam cheraghi

unread,
Apr 13, 2023, 12:46:03 PM4/13/23
to hoomd...@googlegroups.com
I am doing HPMC NPT simulation. 
BoxMC = hoomd.hpmc.update.BoxMC(trigger = hoomd.trigger.Periodic(10), betaP = 20)
BoxMC.volume = {'weight':0.5,'mode':'standard','delta':5.0}

I need to find out am I in equilibrium or not by drawing a graph of volume change vs MC moves. I tried to export the volume using hoomd.dump.gsd but it didn't work. On the other hand I don't know how to export the moves. The code is running on a cluster so I have issues with visualization as well. I would appreciate if you could put me on the right track.

Regards
Azam

Brandon Butler

unread,
Apr 14, 2023, 10:48:28 AM4/14/23
to hoomd...@googlegroups.com

Hey Azam,

Have you looked at the logging tutorial which addresses this exact question? As for visualization, this is based on what software you want to use. I personally use OVITO basic or pro typically, but there are a variety of options for rendering or viewing simulation trajectories.

Also in the future, saying something doesn't work makes helping difficult. To get the best answers in the mailing list, please provide minimal working examples of the failures, what you expect to happen, what happens (with error output if appropriate), etc...

Best,

Brandon

--
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/CAKfCtROh6PF_hMiKpa2wU6-TONdpPRJ-%2B3%3DCZ_Y%3DKxBbz9jg3w%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,
Apr 17, 2023, 9:18:46 AM4/17/23
to hoomd...@googlegroups.com
Hi ,

Thanks for your reply. I would look into that and I will try to be more specific in future.


azam cheraghi

unread,
Apr 17, 2023, 11:06:59 AM4/17/23
to hoomd...@googlegroups.com
thermodynamic_properties = hoomd.hpmc.compute.ThermodynamicQuantities(
AttributeError: module 'hoomd.hpmc.compute' has no attribute 'ThermodynamicQuantities'

The tutorial is for MD simulation. I modified it a little bit but still got this error.

Brandon Butler

unread,
Apr 17, 2023, 1:04:26 PM4/17/23
to hoomd...@googlegroups.com

Hey again Azam,

Did you look at the documentation to see if hoomd.hpmc.compute.ThermodynamicQuantities exists? You would need to use something like log[("box", "volume")] = (lambda : sim.state.box.volume, "scalar") to store the volume as part 4 of the logging tutorial shows with estimated time remaining (ETR).

Best,

Brandon

azam cheraghi

unread,
Apr 17, 2023, 1:33:17 PM4/17/23
to hoomd...@googlegroups.com
yes I did check the documentation and I realized that code is not compatible with HPMC.compute. I will try the new solution then, thanks alot.

Joshua Anderson

unread,
Apr 17, 2023, 3:45:19 PM4/17/23
to hoomd...@googlegroups.com
For what it is worth, the volume computed by `hoomd.md.compute.ThermodynamicQuantities` is accurate for HPMC simulations. So is `num_particles`. It is the pressure, energy, degrees of freedom, etc.. that are MD specific.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

azam cheraghi

unread,
Apr 17, 2023, 4:15:27 PM4/17/23
to hoomd...@googlegroups.com
Does that mean that I can define MD in the code of HPMC?
Because I used the code `hoomd.md.compute.ThermodynamicQuantities' in my HPMC and I got an error because I 'think' I didn't define md. Now I am asking that I can use 
 integrator = hoomd.md.Integrator(dt=0.005) with mc = hoomd.hpmc.integrate.ConvexPolyhedron(default_d = 0.3, default_a = 0.4, nselect = 2)?
I am trying to make it clear for myself. Thanks for your time.

Joshua Anderson

unread,
Apr 18, 2023, 7:24:15 AM4/18/23
to hoomd...@googlegroups.com
In an earlier message, you stated that you got this error:
module 'hoomd.hpmc.compute' has no attribute 'ThermodynamicQuantities'

This is expected because `hoomd.hpmc.compute.ThermoDynamicQuantities` does not exist. Use `hoomd.md.compute.ThermoDynamicQuantities`. As I explained, `num_particles` and `volume` are valid properties even for simulations that use a HPMC integrator instead of an MD integrator. Brandon's solution using a lambda also works, as does reading `configuration.box` from the GSD file and computing volume later: v = box[0] * box[1] * box[2]. You will find that HOOMD-blue has a very general API and there are always multiple ways to achieve any given goal.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
Reply all
Reply to author
Forward
0 new messages