Here are a bunch of conceptually separate patches. They are unlikely to work entirely separately in practice due to external things like IMP.{ih} and SConscript files and test cases tying them together.
The first cleans up the BondedListScoreState by deleted some commented out code adding a comment and adding a set_particles method to go along with the corresponding method in nonbonded list.
The next updates the nonbonded list in two ways. First it is refactored so that the internals can be reused by other states (namely a BipartiteNonbondedListState I use) and secondly the distance threshold belongs in the iterator, not in the constructor as different restraints may have different thresholds. It is not currently used as the internal implementation is dumb, but we should try to converge on the desired interface anyway.
Corresponding changes are made to the NonbondedRestraint
I added a preliminary implementation of a BondedList which uses the bond decorator definition of a bond. It comes with a restraint which uses length and spring constant info stored in the bond particle to restrain the bond. We probably want to revisit what is stored in the bond (in light of the discussions concerning the Harmonic).
Finally, the aforementioned bipartite nonbondedlist. It only returns pairs which cross two sets of particles. It seemed worth having such a class as it can be implemented much more efficiently than just having filters on top of the regular nonbonded list. And it is little code until then.
'patch' didn't like any of these patches, since none of them ended in a CR. So I had to add that in manually. May be worth checking at your end to see what's stripping the terminating CR, since 'svn di' doesn't usually do that...
Daniel Russel wrote: > The first cleans up the BondedListScoreState by deleted some commented > out code adding a comment and adding a set_particles method to go along > with the corresponding method in nonbonded list.
Looks fine to me: r339.
> The next updates the nonbonded list in two ways. First it is refactored > so that the internals can be reused by other states (namely a > BipartiteNonbondedListState I use) and secondly the distance threshold > belongs in the iterator, not in the constructor as different restraints > may have different thresholds. It is not currently used as the internal > implementation is dumb, but we should try to converge on the desired > interface anyway.
I committed this as r340, but I don't agree 100% on the second point. One of the major advantages of a nonbonded list is that the evaluation time scales (typically) as NlogN rather than N^2, because it does not contain all pairs of atoms in the system once the system 'box' size increases past the cutoff. Of course with the existing implementation this makes no difference, but with a smarter implementation we'd probably want a cutoff both in the constructor and in the iterators (with a simple condition that the constructor cutoff is not less than any iterator cutoff).
> Corresponding changes are made to the NonbondedRestraint
Same comment above applies; r341.
> I added a preliminary implementation of a BondedList which uses the bond > decorator definition of a bond. It comes with a restraint which uses > length and spring constant info stored in the bond particle to restrain > the bond. We probably want to revisit what is stored in the bond (in > light of the discussions concerning the Harmonic).
Tragically you forgot to include BondDecoratorRestraint.cpp...
> Finally, the aforementioned bipartite nonbondedlist. It only returns > pairs which cross two sets of particles. It seemed worth having such a > class as it can be implemented much more efficiently than just having > filters on top of the regular nonbonded list. And it is little code > until then.
Looks fine to me; r342.
Ben
participants (2)
-
Ben Webb
-
Daniel Russel