Closed joaander closed 6 years ago
There is a subtle difficulty with the proposed API. The integration methods do not know what the anisotropic mode is until after prepRun is called.
Thus, randomize_velocities() should set a flag to trigger a randomization of the velocities at the start of the next run(). prepRun will call randomizeVelocities for each integration method. Each method will then randomize its velocities if the flag is set and then reset the flag.
It is reasonable to randomize velocities with an NVE integrator. In this case, the user will need to supply a temperature T. This temperature will need to be saved and used when randomizing the velocities. This implementation can be in the base class integration method. At the python level, nvt will determine T from the python method object and set it in C++ where nve will take in T as an argument.
Summary of changes needed:
@avisekdas How far did you get on your implementation? Will you have time to finish off the last parts next week?
The rigid rods example in the tutorial notebooks would be a good test system.
Let me know what I can do to help move this along. I would like to include this capability in hoomd v2.2 - to be released soon.
Original comment by Avisek Das (Bitbucket: avisekdas, GitHub: avisekdas).
Hi Josh,
I think I did complete the job, but I didn' have time to extensively test it. I won't have time for this in the next month. If you can take over the testing, please do so. Otherwise we have to include this in a 2.2.* release.
Thanks, Avisek
However and whenever you wish to work on finalizing this is fine with me. I, and other hoomd developers and users will review it only after a pull request is submitted.
v2.2 will be released Sep 8, 2017.
Rescheduling for v2.3.
Original report by me.
Some use-cases would be aided by a random velocity initialization built in to hoomd. Suggested API: Add a method to IntegratorTwoStep that draws random gaussian rngs (calling method in HOOMDMath.h) scaled appropriately for the degrees of freedom provided by the integrator (velocity, angular momentum) accounting for 2D/3D simulations, whether or not anisotropic mode is enabled, and the number of rotational degrees of freedom each particle has. This needs to be in the integrator method because no other class in hoomd has all of this information. The average total veloctiy should be removed to prevent the system from having center of mass motion (this requires a reduction in MPI simulations).
Suggested python API: