hoomd-blue icon indicating copy to clipboard operation
hoomd-blue copied to clipboard

Create a PotentialPairBase class

Open b-butler opened this issue 4 years ago • 2 comments

Description

The code in AnisoPotentialPair.h and PotentialPair.h is very similar in fact it looks like it was copied into AnisoPotentialPair.h. The code duplication means that changes must be made in two places and increases the code complexity and maintenance burden. Creating a PotentialPairBase.h that incorporates the commonalities would be helpful in simplifying the code base and provide a single place for modifying the common class behavior. This would also show more clearly the similarities between the classes.

Proposed solution

Create a new base class for PotentialPair and AnisoPotentialPair. Some things to keep in mind are PotentialPair supports r_on which AnisoPotentialPair doesn't. PotentialPair supports xplor energy shifting while AnisoPotentialPair doesn't. AnisoPotentialPair has shape support. There are other differences, but these are the biggest.

b-butler avatar Dec 16 '20 17:12 b-butler

I would suggest being more explicit with the naming. Rather than PotentialPairBase, leave PotentialPair as the base class and create PotentialPairIso.

vyasr avatar Dec 16 '20 21:12 vyasr

You may also want to take a look at the Triplet Potentials before doing this. I know there is a lot of code duplication between the isotropic pairs and the triplets.

tommy-waltmann avatar Apr 19 '21 17:04 tommy-waltmann

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Nov 23 '22 19:11 github-actions[bot]

This issue has been automatically closed because it has not had recent activity.

github-actions[bot] avatar Dec 04 '22 19:12 github-actions[bot]