コード例 #1
0
                                               1.0, 'test_charge')

universe.setForceField(ForceField)

print 'Energy Terms:'
print universe.energyTerms()
e, g = universe.energyAndGradients()
print 'Gradient on Atom 1'
print g[universe.atom1]
print 'Gradient on Atom 2'
print g[universe.atom2]

print 'Gradient Test'
gradientTest(universe)
print 'Second derivative Test'
forceConstantTest(universe)

#import time
#start_time = time.time()

#for t in range(100000):
#   e, g = universe.energyAndGradients()
#print 'Time to do 100000 energy and gradient evaluations'
#print time.time()-start_time

#print '------------------Graph-------------------'
#step = 10000
#x=np.linspace(1.1,1.25,step)
#y=np.linspace(1.1,1.25,step)
#i=0;
#for i in range(step):
コード例 #2
0
ForceField = BSplineGrid.BSplineGridForceField("../../../Example/grids/LJa.nc", 1.0, "test_charge")

universe.setForceField(ForceField)

print "Energy Terms:"
print universe.energyTerms()
e, g = universe.energyAndGradients()
print "Gradient on Atom 1"
print g[universe.atom1]
print "Gradient on Atom 2"
print g[universe.atom2]

print "Gradient Test"
gradientTest(universe)
print "Second derivative Test"
forceConstantTest(universe)

# import time
# start_time = time.time()

# for t in range(100000):
#   e, g = universe.energyAndGradients()
# print 'Time to do 100000 energy and gradient evaluations'
# print time.time()-start_time


# print '------------------Graph-------------------'
# step = 10000
# x=np.linspace(1.1,1.25,step)
# y=np.linspace(1.1,1.25,step)
# i=0;