mphowardlab / azplugins

A HOOMD-blue component for soft matter simulations.
BSD 3-Clause "New" or "Revised" License
21 stars 13 forks source link

Allow zero epsilon in FENE bonds #62

Closed mphoward closed 2 years ago

mphoward commented 2 years ago

This feature was requested by a user, and I don't see a strong reason not to. Do you recall why we made this choice @astatt ?

The necessary changes are:

  1. Remove check onlj1 == Scalar(0) on line 84.
  2. Add check on line 95 if (lj1 != Scalar(0) && ...)
  3. I'm not sure why this wasn't here before (probably it's assumed these variables are zeros anyway), but to be safe add an else branch for the if on line 95 that sets both bond_eng and force_divr to zero.
  4. Remove error check on epsilon and sigma from bond.py, and remove any related unit test checks.
  5. Add a unit test that verifies everything works when epsilon and/or sigma are zero.

Line numbers refer to current main (b09ff91).

astatt commented 2 years ago

There was no specific reason except that we did not need it at the time, so we didn't implement it. The main purpose of the FENE potential in azplugins was to have alternative code to core HOOMD-blue, which made some weird choice in the potential we weren't 100% sure about. So I see no opposing reason.

Does the user want to implement this themselves? If not, I can probably do it over the weekend since I've written the original code, whenever #61 is complete.

mphoward commented 2 years ago

Very good, that was what I remembered too, so let's move ahead with adding this.

@judevishnu has offered to implement it once #61 is done, and since the changes are relatively noninvasive, I think he has it covered.