Esempio n. 1
0
Hyd = out_dict["H"]

print "Atom positions read from file."

###############################################################################
#Determine the atom correlations for the water molecules
#For clathrates, all the H's are within 1A of the oxygen atom within 
#	the same water molecule, but further away from any other 
#	oxygen atom. Thus, this can be used to separate and sort out
#	which atoms belong in which molecule. The index number of the 
#	oxygen atom is taken as the index number of the molecule.
###############################################################################

OH_length = 1 #Angstroms

out_dict = Clath_xyz.correlateWaters(Oxy, Hyd, OH_length)

#Use 2D lists to store the vectors
OH_all = out_dict["OH_all_vec"]

#These lists store the H1 (or H2) indices that correlate with each O
OH1_all_cor = out_dict["OH1_all_cor"]
OH2_all_cor = out_dict["OH2_all_cor"]
    
print "Atoms correlated."

###############################################################################
#Calculate internal water molecule vectors OH1, OH2, and HH
###############################################################################
OH1 = []
OH2 = []
Esempio n. 2
0
Hyd = out_dict["H"]

print "Atom positions read from file."

###############################################################################
#Determine the atom correlations for the water molecules
#For clathrates, all the H's are within 1A of the oxygen atom within
#	the same water molecule, but further away from any other
#	oxygen atom. Thus, this can be used to separate and sort out
#	which atoms belong in which molecule. The index number of the
#	oxygen atom is taken as the index number of the molecule.
###############################################################################

OH_length = 1  #Angstroms

out_dict = Clath_xyz.correlateWaters(Oxy, Hyd, OH_length)

#Use 2D lists to store the vectors
OH_all = out_dict["OH_all_vec"]

#These lists store the H1 (or H2) indices that correlate with each O
OH1_all_cor = out_dict["OH1_all_cor"]
OH2_all_cor = out_dict["OH2_all_cor"]

print "Atoms correlated."

###############################################################################
#Calculate internal water molecule vectors OH1, OH2, and HH
###############################################################################
OH1 = []
OH2 = []
            # print "###################################################################################"
            # print (i,j,k)
            for l in range(0, len(Hyd)):
                Hyd_cell.append(Hyd[l] + (Geo.Vector(i, j, k) * cellSize))
                # print Hyd[l] + (Geo.Vector(i,j,k) * cellSize)
            for m in range(0, len(Oxy)):
                Oxy_cell.append(Oxy[m] + (Geo.Vector(i, j, k) * cellSize))
                # print Oxy[m] + (Geo.Vector(i,j,k) * cellSize)

print "Made unit cell duplicates."


###############################################################################
# Determine which H's go with which O's
###############################################################################
out_dict = Clath_xyz.correlateWaters(Oxy_cell, Hyd_cell, lenOH)

OH1_all_cor = out_dict["OH1_all_cor"]
OH2_all_cor = out_dict["OH2_all_cor"]

print "Correlated O's and H's."  # This piece takes the longest amount of time so far.


###############################################################################
# Calculate internal water molecule vectors OH1, OH2, and HH
###############################################################################
OH1 = []
OH2 = []
HH = []
for waterNo in range(0, len(Oxy_cell)):
    OH1.append(Hyd_cell[OH1_all_cor[waterNo]] - Oxy_cell[waterNo])
            #print "###################################################################################"
            #print (i,j,k)
            for l in range(0, len(Hyd)):
                Hyd_cell.append(Hyd[l] + (Geo.Vector(i,j,k) * cellSize))
                #print Hyd[l] + (Geo.Vector(i,j,k) * cellSize)
            for m in range(0, len(Oxy)):
                Oxy_cell.append(Oxy[m] + (Geo.Vector(i,j,k) * cellSize))
                #print Oxy[m] + (Geo.Vector(i,j,k) * cellSize)

print "Made unit cell duplicates."


###############################################################################
#Determine which H's go with which O's
###############################################################################
out_dict = Clath_xyz.correlateWaters(Oxy_cell, Hyd_cell, lenOH)

OH1_all_cor = out_dict["OH1_all_cor"]
OH2_all_cor = out_dict["OH2_all_cor"]

print "Correlated O's and H's." #This piece takes the longest amount of time so far.


###############################################################################
#Calculate internal water molecule vectors OH1, OH2, and HH
###############################################################################
OH1 = []
OH2 = []
HH = []
for waterNo in range(0,len(Oxy_cell)):
    OH1.append(Hyd_cell[OH1_all_cor[waterNo]] - Oxy_cell[waterNo])