Exemple #1
0
    def setup_aatopology(self):
        GMIN.initialize()
        pot = GMINPotential(GMIN)
        coords = pot.getCoords()
        nrigid = coords.size / 6

        print "I have %d PAP molecules in the system" % nrigid
        print "The initial energy is", pot.getEnergy(coords)

        water = create_pap()

        system = RBTopology()
        system.add_sites([deepcopy(water) for i in xrange(nrigid)])
        self.potential = pot
        self.nrigid = nrigid

        self.render_scale = 0.1
        self.atom_types = system.get_atomtypes()

        self.draw_bonds = []
        for i in xrange(nrigid):
            self.draw_bonds.append((3 * i, 3 * i + 1))
            self.draw_bonds.append((3 * i, 3 * i + 2))

        return system
Exemple #2
0
    def setup_aatopology(self):
        GMIN.initialize()
        pot = GMINPotential(GMIN)
        coords = pot.getCoords()        
        nrigid = old_div(coords.size, 6)

        print("I have %d water molecules in the system"%nrigid)
        print("The initial energy is", pot.getEnergy(coords))

        water = create_base()
        
        system = RBTopology()
        system.add_sites([deepcopy(water) for i in range(nrigid)])
        self.potential = pot
        self.nrigid = nrigid
        
        self.render_scale = 0.15
        self.atom_types = system.get_atomtypes()
        
        self.draw_bonds = []
        for i in range(nrigid-1):
            self.draw_bonds.append((2*i, 2*i+1))
            self.draw_bonds.append((2*i, 2*i+2))
    
        return system
Exemple #3
0
 def setUp(self):
     self.nrigid = 10
     self.topology = RBTopology()
     self.topology.add_sites(
         [create_tetrahedron() for _ in range(self.nrigid)])
     self.topology.finalize_setup()
     self.measure = MeasureAngleAxisCluster(self.topology)
Exemple #4
0
    def setup_aatopology(self):
        water_sites, ref = water(self.xyzfile)
        rbsystem = RBTopology()
        rbsystem.add_sites(water_sites)
        rbsystem.finalize_setup()
        #print len(rbsystem.sites), len(rbsystem.indices)
        print "I have %d water molecules in the system" % len(rbsystem.sites)
        rbcoords = rbsystem.coords_adapter(np.zeros(len(rbsystem.sites)*6))
        for site, com in zip(rbsystem.sites, rbcoords.posRigid):
            com[:] = ref.coords[site.atom_indices[0]] - site.atom_positions[0]
        pot = LJ(eps=0.1550, sig=3.1536)
        # get the flattened coordinate array
        print "The initial energy is", pot.getEnergy(ref.coords.flatten())
        rbpot = rigidbody.RBPotentialWrapper(rbsystem, pot) 
        print "rbpot.getEnergy(rbcoords.coords)", rbpot.getEnergy(rbcoords.coords)
        e, g = rbpot.getEnergyGradient(rbcoords.coords)
        g_n = rbpot.NumericalDerivative(rbcoords.coords, eps=1e-4)
        cg = rbsystem.coords_adapter(g-g_n)

        # coords = rbpot.getCoords()
        # nrigid = rbcoords.size / 6
        # print "nrigid", nrigid
        self.potential = rbpot
        self.nrigid = len(rbsystem.sites)
        self.render_scale = 0.3
        self.atom_types = rbsystem.get_atomtypes()
Exemple #5
0
    def setUp(self):
        #GMIN.initialize()
#        self.pot = GMINPotential(GMIN)
        self.nrigid = 10
        self.water = create_water()
        self.topology = RBTopology()
        self.topology.add_sites([deepcopy(self.water) for _ in xrange(self.nrigid)])
        self.topology.finalize_setup()
Exemple #6
0
    def make_atom_indices_cpp_topology(self, atom_indices=None):
        sites = [make_otp() for _ in xrange(self.nrigid)]
        if atom_indices is None:
            atom_indices = np.array(range(self.nrigid * 3), dtype=int)
            np.random.shuffle(atom_indices)
        i = 0
        for site in sites:
            site.atom_indices = atom_indices[i:i + site.get_natoms()].copy()
            i += site.get_natoms()

        topology = RBTopology()
        topology.add_sites(sites)
        topology.finalize_setup(use_cpp=False)
        return topology, atom_indices
Exemple #7
0
    def setUp(self):
        nrigid = 3
        self.topology = RBTopology()
        self.topology.add_sites([make_otp() for i in range(nrigid)])
        self.topology.finalize_setup()

        cartesian_potential = LJ()
        self.pot = RBPotentialWrapper(self.topology, cartesian_potential)

        self.x0 = _x03
        self.x0 = np.array(self.x0)
        self.e0 = -17.3387670023
        assert nrigid * 6 == self.x0.size

        self.x0atomistic = _x03_atomistic
        self.nrigid = nrigid
Exemple #8
0
 def setup_aatopology(self):
     """this sets up the topology for the whole rigid body system"""
     topology = RBTopology()
     topology.add_sites([self.make_otp() for _ in xrange(self.nrigid)])
     
     self.render_scale = 0.2
     self.atom_types = topology.get_atomtypes()
     
     self.draw_bonds = []
     for i in xrange(self.nrigid):
         self.draw_bonds.append((3*i, 3*i+1))
         self.draw_bonds.append((3*i, 3*i+2))
     
     topology.finalize_setup()
 
     return topology
Exemple #9
0
 def setUp(self):
     self.nrigid = 10
     self.topology = RBTopology()
     self.topology.add_sites([create_water() for _ in range(self.nrigid)])
     self.topology.finalize_setup()
     self.transform = TransformAngleAxisCluster(self.topology)
Exemple #10
0
 def make_normal_cpp_topology(self):
     sites = [make_otp() for _ in xrange(self.nrigid)]
     normal_topology = RBTopology()
     normal_topology.add_sites(sites)
     normal_topology.finalize_setup()
     return normal_topology