Пример #1
0
from tip4p import dump_path

# initialize GMIN and potential
GMIN.initialize()
pot = GMINPotential(GMIN)
coords = pot.getCoords()

nrigid = coords.size / 6
print "I have %d water molecules in the system" % nrigid

water = tip4p.water()
#water.S = np.identity(3, dtype="float64")
#water.S*=10.

# define the whole water system
system = RBSystem()
system.add_sites([deepcopy(water) for i in xrange(nrigid)])

# this is an easy access wrapper for coordinates array
ca = system.coords_adapter(coords)

#buildingblocks.rotate(3.0, ca.rotRigid[-1:])
#ret = mylbfgs(coords, pot.getEnergyGradient, iprint=0)
#coords2 = ret[0]
#np.savetxt("coords1_2.txt", coords1)
#np.savetxt("coords2_2.txt", coords2)

coords1 = np.loadtxt("coords1.txt")
coords2 = np.loadtxt("coords2.txt")
print pot.getEnergy(coords1), pot.getEnergy(coords2)