Some questions about running MC simulations using hpmc.pair.user.CPPPotential

23 views
Skip to first unread message

Irem

unread,
Apr 28, 2023, 12:33:11 PM4/28/23
to hoomd-users
Hi,

I'm trying to customize the system in this tutorial for my purposes. I have a few questions regarding this:

1- Is the C++ code passed into hoomd as a python string optimized in the background? Or should I write this code as though I'm writing the most optimum version of the code? For instance, instead of evaluating cos(delta) every time patch orientations are checked, one could define 

const float cos_delta 

directly and use that. Also, one could first check if particle-particle distance is correct, and then proceed to calculate orientations. Should I worry about these things?

2- I would like to define two different sets of patches for two different types of particles. As far as I understand, I have to define mc.pair_potential in one go, right? I can't define them separately and then set particles of type 'A' to one type of potential, and type 'B' to another type, right? Would have to use "unsigned int type_i" to treat different types of particles in one go?

3- Is there an example for how to set up a box updater to run an NPT simulation in v3.x? 

Best,
Irem

Brandon Butler

unread,
May 1, 2023, 10:27:43 AM5/1/23
to hoomd...@googlegroups.com

Hey Irem,

1. There is no optimization other than what the compiler provides for JIT code.

2. Yes you need to define the entire potential including type differences in the single function body.

3. The box updater is not for NPT simulations. In MC use the hoomd.hpmc.update.BoxMC to run NPT or the hoomd.md.methods.NPT in MD for the NPT ensemble.

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/359a60c6-e595-4cc3-965f-b929790e71efn%40googlegroups.com.
--
Brandon Butler
MolSSI Fellow
PhD Candidate, Chemical Engineering and Scientific Computing | Glotzer Lab, University of Michigan
Email: butl...@umich.edu
Reply all
Reply to author
Forward
0 new messages