Commit e32b9c26 authored by cmaffeo2's avatar cmaffeo2
Browse files

Added _generate_bead_callbacks. Made lists into tuples for ParticleType __hash_key function

parent 49db14de
......@@ -327,6 +327,7 @@ class ParticleType():
def __hash_key(self):
l = [self.name,self.charge]
for keyval in sorted(self.__dict__.items()):
if isinstance(keyval[1], list): keyval = (keyval[0],tuple(keyval[1]))
l.extend(keyval)
return tuple(l)
......
......@@ -1541,10 +1541,13 @@ class SegmentModel(ArbdModel):
decompPeriod, pairlistDistance=None,
nonbondedResolution=0)
# self.max_basepairs_per_bead = max_basepairs_per_bead # dsDNA
# self.max_nucleotides_per_bead = max_nucleotides_per_bead # ssDNA
self.children = self.segments = segments
self._generate_bead_callbacks = []
self._bonded_potential = dict() # cache for bonded potentials
self._generate_strands()
self.grid_potentials = []
......@@ -2543,6 +2546,10 @@ class SegmentModel(ArbdModel):
pot = self.get_dihedral_potential(k,t0)
self.add_dihedral( n1,n2,n3,n4, pot )
for callback in self._generate_bead_callbacks:
callback(self)
# ## remove duplicate potentials; ## TODO ensure that they aren't added twice in the first place?
# self.remove_duplicate_terms()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment