Daniel Russel wrote: > For a while I have been thinking it would be nice to add another layer > of indirection for particle storage in IMP. The idea would be that we > add some base classes like: > class ParticleContainer { > //provide virtual get_number, get, find etc. > } > class ParticlePairContainer; > class ParticleSetContainer;
Sounds like a reasonable interface to me.
> Then restraints would internally have a appropriate particle > container. The nice thing would be that you could then choose to share > containers between restraints and states as needed, reducing the > number of things that need to be updated when something changes. > > This could be implemented without changing the existing API since we > could leave the exiting get/set methods in the restraints. And just > add a method to set the container if you want it shared. > > NonbondedListRestraint would go away we we would just have > PairListRestraint (you just set the ParticlePairContainer in the > restraint to be the NonbondedList). Likewise, the BondedList base > class goes away and the BondDecoratorListRestraint.
There definitely needs to be a little more flexibility in the nonbonded list implementations. For example, it is often necessary to exclude pairs other than bonded pairs, for example 1-3 (angle) or 1-4 (dihedral) pairs, or specifically listed pairs (e.g. protein-ligand close contacts). Seems like it would make sense to allow this functionality in whatever container is used by the nonbonded list.
Ben