hoomd-blue
hoomd-blue copied to clipboard
Create a PotentialPairBase class
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.
I would suggest being more explicit with the naming. Rather than PotentialPairBase
, leave PotentialPair
as the base class and create PotentialPairIso
.
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.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
This issue has been automatically closed because it has not had recent activity.