Editing source code of fix srd to allow for polymer beads to be included in rotation step

Dear Developers,

I am attempting to implement a coupling between polymer beads and an SRD solvent; in this coupling, the beads are included in the collision cell averaging and the rotation step. This coupling is well established in the literature as a simple and efficient way to couple SRD and a kinetic polymer model. I am happy to provide references if necessary. My first idea was to input a group to fix srd which contained both the polymers and SRD particles; however, in the default implementation of fix srd, the group with SRDs requires monodispersity and raises an error if we input a group with more than one mass. I have limited experience in editing the source code, so I would greatly appreciate some suggestions on this issue.

1 Like

Why not have an additional, optional argument where you can specify a group specifically for those polymer beads? You will have to identify those separately, anyway.

I’m not familiar with adding arguments to the command, are there any resources for learning this? Additionally, how would I then go about including this group in the averaging and rotation? Perhaps one could have a very simple logical statement to select the lighter SRD particle mass out of the group and assign it to mass_srd?

The resource for learning how to do things in LAMMPS is the LAMMPS source code.

The group membership is indicated by a bitmap. Again, you can see in the existing code how - for example - the “big” particles are identified by fix srd.

Sorry for not being more specific, but if you want to do these kinds of changes, you either have to know enough C++ so you can read and understand existing code and follow the example, or you need to find a collaborator that does. Asking in a forum to tell you what to do about a feature that you care about (but not necessarily anybody in the forum) is not likely to work.

I’m in the process of learning C++, I’ll just keep going with that and see where it takes me. Thanks for the help.

This is quite risky. You are likely to waste a lot of time by making mistakes without noticing.
I stick by my recommendation to find a suitably competent collaborator.

Unfortunately, I do not have any collaborators who can give me their time to solve these issues and finding a suitable one isn’t something I can manage in the immediate future, hence I am happy to learn. I am following the Dr Shafat Mubin textbook on editing lammps source code. I have implemented your suggestion of adding an extra argument, which compiles and works correctly, though it does not include the polymers in the rotation step. I am struggling to identify the original group which holds the SRDs, I would then unify the polymer group and SRD group so the code can run over both, can you advise?

I have given all the advice I can give. Explaining more details would essentially require me to do what you want to do first and then tell you. I don’t have the time and am not interested in that area of research.

Then you are doomed. If you don’t have the time to find a collaborator but also don’t have the ability to teach yourself (I don’t think the textbook you mentioned is going to help much to acquire the skills you need and particularly not on short notice) there is not much else you can do.

Alright, thanks axel have a nice day !

For future readers of this thread: you might be interested in these modifications of fix_srd: GitHub - palmergroup/mpcd_polymer_colloid: Adaptation of LAMMPS' stochastic rotation dynamics module to perform multi-particle collision dynamics simulations of polymer and colloid solutions using an Andersen thermostat (“Additionally, we have implemented a collision scheme in which small mesoparticles (e.g., polymer beads) can exchange momentum with the solvent particles”).

1 Like