Commit 6395dcac authored by cmaffeo2's avatar cmaffeo2
Browse files

Slightly updated bead generation code to fix problems when a segment is 1 monomer long

parent 861434ba
......@@ -82,6 +82,7 @@ def set_splines(seg, coordinates, hid, hmap, hrank, fwd, orientation=None):
assert( len(ids) == 1 )
q = quaternion_from_matrix( orientation[ids[0]] )
quats = [q, q]
coords[-1] = pos + orientation[ids[0]].dot(np.array((0,0,1)))
else:
coords,contours,quats = [[],[],[]]
......
......@@ -958,11 +958,15 @@ class Segment(ConnectableElement, Group):
if len(existing_beads) == 0 or existing_beads[0][0].get_nt_position(self,0) >= 0.5:
# if len(existing_beads) > 0:
# assert(existing_beads[0].get_nt_position(self) >= 0.5)
b = self._generate_one_bead( self.nt_pos_to_contour(0), 0)
c = self.nt_pos_to_contour(0)
if self.num_nt == 1: c -= 0.4
b = self._generate_one_bead(c, 0)
existing_beads = [(b,0)] + existing_beads
if existing_beads[-1][0].get_nt_position(self,1)-(self.num_nt-1) < -0.5 or len(existing_beads)==1:
b = self._generate_one_bead( self.nt_pos_to_contour(self.num_nt-1), 0)
c = self.nt_pos_to_contour(self.num_nt-1)
if self.num_nt == 1: c += 0.4
b = self._generate_one_bead(c, 0)
existing_beads.append( (b,1) )
assert(len(existing_beads) > 1)
......@@ -2142,7 +2146,7 @@ class SegmentModel(ArbdModel):
# t.name = t.name + "%03d" % (t.nts*10**decimals)
t.name = char + "%03d" % (beadtype_count[char])
t.mass = t.nts * 150
t.diffusivity = 150 if t.nts == 0 else min( 50 / np.sqrt(t.nts/5), 150)
t.diffusivity = 120 if t.nts == 0 else min( 50 / np.sqrt(t.nts/5), 120)
beadtype_count[char] += 1
if self.DEBUG: print( "{} --> {} ({})".format(num_nt0, bead.num_nt, t.name) )
beadtype_s[key] = bead.type_ = t
......
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