コード例 #1
0
ファイル: skittles.py プロジェクト: masci/mmLib
            U12 = U21 = atom_obj[u-1]["u[0][1]"]
            U13 = U31 = atom_obj[u-1]["u[0][2]"]
            U23 = U32 = atom_obj[u-1]["u[1][2]"]
            U = tlsvld.array([[U11,U12,U13],[U21,U22,U23],[U31,U32,U33]])
            V11 = atom_obj[u]["u[0][0]"]
            V22 = atom_obj[u]["u[1][1]"]
            V33 = atom_obj[u]["u[2][2]"]
            V12 = V21 = atom_obj[u]["u[0][1]"]
            V13 = V31 = atom_obj[u]["u[0][2]"]
            V23 = V32 = atom_obj[u]["u[1][2]"]
            V = tlsvld.array([[V11,V12,V13],[V21,V22,V23],[V31,V32,V33]])

            ## Calculate all of the residuals
            Suij = rosenfeld = diff_trace_UV = sum_square_diff = 0.0
            cc_UV = tlsvld.calc_ccuij(U, V)
            #cc_UV = AtomMath.calc_CCuij([[U11,U12,U13],
            #                             [U21,U22,U23],
            #                             [U31,U32,U33]],
            #                            [[V11,V12,V13],
            #                             [V21,V22,V23],
            #                             [V31,V32,V33]])
            rosenfeld = tlsvld.rosenfeld(Upos, Vpos, U, V)
            sum_square_diff = tlsvld.sum_square_diff(U, V)
            diff_trace_UV = tlsvld.diff_trace_uv(U, V)

            ## The actual output of this entire script.
            print "%s\t%s:%s-%s:%s\t%s\t%.10f\t%.10f\t%.10f\t%.10f\t%.10f" % (
                bond_pos, cid1, res_name1, res_num1, bond, tls_group,
                cc_UV, Suij, rosenfeld/10000,
                diff_trace_UV/10000, sum_square_diff/10000**2)
コード例 #2
0
ファイル: test.py プロジェクト: Sree-Inventrust/pymmlib
#print "EIGENS = ", tlsvld.jacobi(U,3,3, EIGENS, EVECS )
print U
print "EIGENS = ", tlsvld.eigenvalues(U)

x1 = 1.00
y1 = 2.00
z1 = 3.00
x2 = 6.00
y2 = 5.00
z2 = 4.00
d = math.sqrt( (x1-x2)**2 + (y1-y2)**2 + (z1-z2)**2 )
U = tlsvld.array([[0.37471362,-0.07411912,-0.0379023],[-0.07411912,0.39010298,-0.03240841],[-0.0379023,-0.03240841,0.33057791]])
V = tlsvld.array([[0.38484156,-0.06933809,-0.04994903],[-0.06933809,0.41376374,-0.03275701],[-0.04994903,-0.03275701,0.33967632]])
print d
a = tlsvld.array([x1,y1,z1])
b = tlsvld.array([x2,y2,z2])

#     n = numpy.array([(a[0] - b[0])/d, (a[1] - b[1])/d, (a[2] - b[2])/d])
#     Un = numpy.dot(numpy.dot(n, U), numpy.transpose(n))
#     Vn = numpy.dot(numpy.dot(n, V), numpy.transpose(n))
#     return abs(Un - Vn)
n = numpy.array([(a[0] - b[0])/d, (a[1] - b[1])/d, (a[2] - b[2])/d])
Un = numpy.dot(numpy.dot(n, U), numpy.transpose(n))
Vn = numpy.dot(numpy.dot(n, V), numpy.transpose(n))
print "[Python] DOT(n, U) = ", numpy.dot(n, U)
print "[Python] d = ", d
print "[Python] Rosenfeld = ", abs(Un - Vn)
print "="*80
print "[Fortran] Rosenfeld = ", tlsvld.rosenfeld(a,b,U,V)
コード例 #3
0
                continue

            #U = Ueq[u-1]
            #V = Ueq[u]

            U11 = atom_obj[u-1]["u[0][0]"]
            U22 = atom_obj[u-1]["u[1][1]"]
            U33 = atom_obj[u-1]["u[2][2]"]
            U12 = U21 = atom_obj[u-1]["u[0][1]"]
            U13 = U31 = atom_obj[u-1]["u[0][2]"]
            U23 = U32 = atom_obj[u-1]["u[1][2]"]
            U = tlsvld.array([[U11,U12,U13],[U21,U22,U23],[U31,U32,U33]])
            V11 = atom_obj[u]["u[0][0]"]
            V22 = atom_obj[u]["u[1][1]"]
            V33 = atom_obj[u]["u[2][2]"]
            V12 = V21 = atom_obj[u]["u[0][1]"]
            V13 = V31 = atom_obj[u]["u[0][2]"]
            V23 = V32 = atom_obj[u]["u[1][2]"]
            V = tlsvld.array([[V11,V12,V13],[V21,V22,V23],[V31,V32,V33]])

            Suij = rosenfeld = diff_trace_UV = sum_square_diff = 0.0
            cc_UV = tlsvld.calc_ccuij(U, V)
            #cc_UV = AtomMath.calc_CCuij([[U11,U12,U13],[U21,U22,U23],[U31,U32,U33]], [[V11,V12,V13],[V21,V22,V23],[V31,V32,V33]])
            rosenfeld = tlsvld.rosenfeld(Upos, Vpos, U, V)
            sum_square_diff = tlsvld.sum_square_diff(U, V)
            diff_trace_UV = tlsvld.diff_trace_uv(U, V)
            print "%s\t%s:%s-%s:%s\t%s\t%.10f\t%.10f\t%.10f\t%.10f\t%.10f" % (
                bond_pos, cid1, res_name1, res_num1, bond, tls_group,
                cc_UV, Suij, rosenfeld/10000,
                diff_trace_UV/10000, sum_square_diff/10000**2)