def __init__(self, fc_length=0.7, cutoff=1.2, factor=46402.):
     self.arguments = (fc_length, cutoff, factor)
     ForceField.__init__(self, 'deformation')
     self.arguments = (fc_length, cutoff, factor)
     self.fc_length = fc_length
     self.cutoff = cutoff
     self.factor = factor
Exemplo n.º 2
0
 def __init__(self, fc_length = 0.7, cutoff = 1.2, factor = 46402.):
     self.arguments = (fc_length, cutoff, factor)
     ForceField.__init__(self, 'deformation')
     self.arguments = (fc_length, cutoff, factor)
     self.fc_length = fc_length
     self.cutoff = cutoff
     self.factor = factor
Exemplo n.º 3
0
 def __init__(self, atom1, atom2, atom3, angle, force_constant):
     self.atom1 = atom1
     self.atom2 = atom2
     self.atom3 = atom3
     self.angle = angle
     self.force_constant = force_constant
     ForceField.__init__(self, 'harmonic angle restraint')
Exemplo n.º 4
0
 def __init__(self, atom1, atom2, atom3, atom4, dihedral, force_constant):
     self.index1, self.index2, self.index3, self.index4 = \
                self.getAtomParameterIndices((atom1, atom2, atom3, atom4))
     self.dihedral = dihedral
     self.force_constant = force_constant
     self.arguments = (self.index1, self.index2, self.index3, self.index4,
                       dihedral, force_constant) 
     ForceField.__init__(self, 'harmonic dihedral restraint')
Exemplo n.º 5
0
 def __init__(self, atom1, atom2, atom3, angle, force_constant):
     self.index1, self.index2, self.index3 = \
                 self.getAtomParameterIndices((atom1, atom2, atom3))
     self.arguments = (self.index1, self.index2, self.index3,
                       angle, force_constant) 
     self.angle = angle
     self.force_constant = force_constant
     ForceField.__init__(self, 'harmonic angle restraint')
Exemplo n.º 6
0
 def __init__(self, atom1, atom2, atom3, atom4, dihedral, force_constant):
     self.index1, self.index2, self.index3, self.index4 = \
                self.getAtomParameterIndices((atom1, atom2, atom3, atom4))
     self.dihedral = dihedral
     self.force_constant = force_constant
     self.arguments = (self.index1, self.index2, self.index3, self.index4,
                       dihedral, force_constant)
     ForceField.__init__(self, 'harmonic dihedral restraint')
Exemplo n.º 7
0
 def __init__(self, atom1, atom2, atom3, angle, force_constant):
     self.index1, self.index2, self.index3 = \
                 self.getAtomParameterIndices((atom1, atom2, atom3))
     self.arguments = (self.index1, self.index2, self.index3, angle,
                       force_constant)
     self.angle = angle
     self.force_constant = force_constant
     ForceField.__init__(self, 'harmonic angle restraint')
Exemplo n.º 8
0
 def __init__(self, atom1, atom2, atom3, atom4, dihedral, force_constant):
     self.atom1 = atom1
     self.atom2 = atom2
     self.atom3 = atom3
     self.atom4 = atom4
     self.dihedral = dihedral
     self.force_constant = force_constant
     ForceField.__init__(self, 'harmonic dihedral restraint')
 def __init__(self, cutoff=None, scale_factor=1.):
     ForceField.__init__(self, 'anisotropic_network')
     self.arguments = (cutoff, )
     self.cutoff = cutoff
     self.scale_factor = scale_factor
Exemplo n.º 10
0
            lambda a: np.array([0.0, -a[2], a[1]]),
            lambda a: np.array([a[2], 0.0, -a[0]]),
            lambda a: np.array([-a[1], a[0], 0.0])
        ]

        u = normal_fns[np.argmin(np.fabs(normal))](normal)
        u /= np.linalg.norm(u)
        v = np.cross(normal, u)
        v /= np.linalg.norm(v)
        alpha = np.random.uniform(0.0, np.pi * 2)
        return np.cos(alpha) * u + np.sin(alpha) * v


if __name__ == "__main__":

    import os, sys
    cwd = os.getcwd()
    assembled = os.path.abspath(os.path.dirname(str(sys.argv[0])))
    os.environ["ASSEMBLEPATH"] = "%s;%s" % (cwd, assembled)

    #test mass estimation
    from Database import Database
    D = Database()
    D.load("database\\database.txt", "gromacs")
    F = ForceField()
    F.load("database\\forcefield\\trappe.ff.txt")
    P = Polymer(D, F, "test", "gromacs")
    P.chain = "ccctttccCCt"

    print(P.get_mass())
Exemplo n.º 11
0
 def __init__(self, atom1, atom2, distance, force_constant):
     self.index1, self.index2 = self.getAtomParameterIndices((atom1, atom2))
     self.arguments = (self.index1, self.index2, distance, force_constant) 
     self.distance = distance
     self.force_constant = force_constant
     ForceField.__init__(self, 'harmonic distance restraint')
Exemplo n.º 12
0
 def __init__(self, atom1, atom2, distance, force_constant):
     self.atom1 = atom1
     self.atom2 = atom2
     self.distance = distance
     self.force_constant = force_constant
     ForceField.__init__(self, 'harmonic distance restraint')
Exemplo n.º 13
0
    def run(self) -> None:
        global terminate
        # Collect events until released
        with Listener(on_press=self.on_press,
                      on_release=self.on_release) as listener:
            listener.join()
        self.env.terminate = True


if __name__ == '__main__':
    print('LRAUV project')

    # showing vector field
    num_obstacles = 3
    samples = sampling_locations(num_samples=num_obstacles + 1, sample_dist=15)
    obstacles, goal = samples[:num_obstacles], samples[num_obstacles]
    FF = ForceField(goal.tolist(), obstacles)

    sim = SimView(plt, FF)
    tethys = TethysEnv(sim, FF)
    IOthread = KeyboardInput(tethys)
    IOthread.start()
    tethys.start()

    while not tethys.terminate:
        while not sim.q.empty():
            data = sim.q.get()
            sim(data)
        sim.update()
        sleep(0.01)
Exemplo n.º 14
0
    def __init__(self, parent, title):
        self.dirname = ''
        # A "-1" in the size parameter instructs wxWidgets to use the default size.
        # In this case, we select 200px width and the default height.
        wx.Frame.__init__(self, parent, title=title, size=(700, 600))
        self.CreateStatusBar()  # A Status bar in the bottom of the window
        self.SetBackgroundColour("white")

        cwd = os.getcwd()
        assembled = os.path.abspath(os.path.dirname(str(sys.argv[0])))
        os.environ["ASSEMBLEPATH"] = "%s;%s" % (cwd, assembled)

        #initialize datastructures
        self.db = Database()
        self.ff = ForceField()

        # Setting up the menu bar
        filemenu = wx.Menu()
        menuLoad = filemenu.Append(wx.ID_OPEN, "&Load...",
                                   " Load a setup file")
        menuSave = filemenu.Append(wx.ID_SAVEAS, "&Save as...",
                                   " Save the current setup")
        menuHelp = filemenu.Append(wx.ID_HELP, "&Help",
                                   " Optimization user manual")
        menuAbout = filemenu.Append(wx.ID_ABOUT, "&About",
                                    " Information about this program")
        filemenu.AppendSeparator()
        menuExit = filemenu.Append(wx.ID_EXIT, "E&xit",
                                   " Terminate the program")

        # Creating the menu bar
        menuBar = wx.MenuBar()
        menuBar.Append(filemenu,
                       "&File")  # Adding the "filemenu" to the MenuBar
        self.SetMenuBar(menuBar)  # Adding the MenuBar to the Frame content.

        #panels
        self.I = InputData(self)
        self.F = InputForceField(self)
        self.P = Polymers(self)
        self.S = SystemOut(self)

        self.make = wx.Button(self, label="MAKE!")

        box = wx.BoxSizer(wx.VERTICAL)
        box.Add(self.I, 1, wx.EXPAND | wx.ALL, 3)
        box.Add(self.F, 0, wx.EXPAND | wx.ALL, 3)
        box.Add(self.P, 1, wx.EXPAND | wx.ALL, 3)
        box.Add(self.S, 0, wx.EXPAND | wx.ALL, 3)
        box.Add(self.make, 0, wx.ALIGN_CENTER | wx.ALL, 3)
        self.SetSizer(box)
        self.SetSize((800, 700))
        self.Centre()

        # bind events to menu items
        self.Bind(wx.EVT_MENU, self.OnLoad, menuLoad)
        self.Bind(wx.EVT_MENU, self.OnSave, menuSave)
        self.Bind(wx.EVT_MENU, self.OnHelp, menuHelp)
        self.Bind(wx.EVT_MENU, self.OnAbout, menuAbout)
        self.Bind(wx.EVT_MENU, self.OnExit, menuExit)
        self.Bind(wx.EVT_BUTTON, self.OnMake, self.make)

        self.Show()
Exemplo n.º 15
0
 def __init__(self, cutoff = None, scale_factor = 1.):
     ForceField.__init__(self, 'anisotropic_network')
     self.arguments = (cutoff,)
     self.cutoff = cutoff
     self.scale_factor = scale_factor
Exemplo n.º 16
0
 def __init__(self, name):
     ForceField.__init__(self, name)
     self.type = 'nonbonded'
Exemplo n.º 17
0
 def __init__(self, cutoff = None, scale_factor = 1., version=1):
     ForceField.__init__(self, 'calpha')
     self.arguments = (cutoff,)
     self.cutoff = cutoff
     self.scale_factor = scale_factor
     self.version = version
Exemplo n.º 18
0
 def __init__(self, atom1, atom2, distance, force_constant):
     self.index1, self.index2 = self.getAtomParameterIndices((atom1, atom2))
     self.arguments = (self.index1, self.index2, distance, force_constant)
     self.distance = distance
     self.force_constant = force_constant
     ForceField.__init__(self, 'harmonic distance restraint')