Skip to content
Snippets Groups Projects
Commit 5d01a8a5 authored by cmaffeo2's avatar cmaffeo2
Browse files

Updated bondAngle to be two angles, one bond

parent 9f55d328
No related branches found
No related tags found
No related merge requests found
...@@ -149,12 +149,12 @@ class Parent(): ...@@ -149,12 +149,12 @@ class Parent():
# for b in (i,j): assert(b in beads) # for b in (i,j): assert(b in beads)
self.exclusions.append( (i,j) ) self.exclusions.append( (i,j) )
def add_bond_angle(self, i,j,k, bond_angle, exclude=False): def add_bond_angle(self, i,j,k,l, bond_angle, exclude=False):
assert( len(set((i,j,k))) == 3 ) assert( len(set((i,j,k,l))) == 4 )
## TODO: how to handle duplicating and cloning bonds ## TODO: how to handle duplicating and cloning bonds
# beads = [b for b in self] # beads = [b for b in self]
# for b in (i,j): assert(b in beads) # for b in (i,j): assert(b in beads)
self.bond_angles.append( (i,j,k, bond_angle) ) self.bond_angles.append( (i,j,k,l, bond_angle) )
def get_restraints(self): def get_restraints(self):
ret = [] ret = []
...@@ -219,14 +219,14 @@ class Parent(): ...@@ -219,14 +219,14 @@ class Parent():
def _get_bond_potentials(self): def _get_bond_potentials(self):
bonds = [b for i,j,b,ex in self.get_bonds()] bonds = [b for i,j,b,ex in self.get_bonds()]
bondangles1 = [b[1] for i,j,k,b in self.get_bond_angles()] bondangles1 = [b[1] for i,j,k,l,b in self.get_bond_angles()]
bondangles2 = [b[2] for i,j,k,b in self.get_bond_angles()] return list(set( bonds+bondangles1 ))
return list(set( bonds+bondangles1+bondangles2 ))
def _get_angle_potentials(self): def _get_angle_potentials(self):
angles = [b for i,j,k,b in self.get_angles()] angles = [b for i,j,k,b in self.get_angles()]
bondangles = [b[0] for i,j,k,b in self.get_bond_angles()] bondangles1 = [b[0] for i,j,k,l,b in self.get_bond_angles()]
return list(set( angles+bondangles )) bondangles2 = [b[2] for i,j,k,l,b in self.get_bond_angles()]
return list(set( angles+bondangles1+bondangles2 ))
## Removed because prohibitively slow ## Removed because prohibitively slow
...@@ -1240,7 +1240,7 @@ component "data" value 3 ...@@ -1240,7 +1240,7 @@ component "data" value 3
with open(self._bond_angle_filename,'w') as fh: with open(self._bond_angle_filename,'w') as fh:
for b in self.get_bond_angles(): for b in self.get_bond_angles():
item = tuple([p.idx for p in b[:-1]] + [str(p) for p in b[-1]]) item = tuple([p.idx for p in b[:-1]] + [str(p) for p in b[-1]])
fh.write("BONDANGLE %d %d %d %s %s %s\n" % item) fh.write("BONDANGLE %d %d %d %d %s %s %s\n" % item)
def dimensions_from_structure( self, padding_factor=1.5, isotropic=False ): def dimensions_from_structure( self, padding_factor=1.5, isotropic=False ):
## TODO: cache coordinates using numpy arrays for quick min/max ## TODO: cache coordinates using numpy arrays for quick min/max
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment