def mddata(self, inf='md.in', outf='md.out'): if self.md_init is None: try: return md.Md(inf, outf) except FileNotFoundError: print("No MD data found in {}".format(os.get_cwd())) return self.md_init
def main(): dest_dir='./scfs' try: os.mkdir(dest_dir) except FileExistsError: pass x=md.Md('md.in','md.out') traj = x.get_trajectory1() for i in range(len(traj)): pos = '' for line in traj[i]: pos += line+'\n' scfinput = fstring.format(i,pos) f=open('{}/scf.{}.in'.format(dest_dir,i),'w') f.write(scfinput) f.close()
def main(): dest_dir = './scfs' try: os.mkdir(dest_dir) except FileExistsError: pass x = md.Md('md.in', 'md.out') nat = x.nat ntyp = x.ntyp traj = x.get_trajectory1() latvex = x.latvex_string for i in range(len(traj)): positions = '' for line in traj[i]: positions += line + '\n' scfinput = fstring.format(i, nat, ntyp, latvex, positions) f = open('{}/scf.{}.in'.format(dest_dir, i), 'w') f.write(scfinput) f.close()
#!/usr/bin/env python3 import md as md import datafile as d import matrix as m import matplotlib.pyplot as plt nat = 24 x = md.Md('md.out') positions = x.get_trajectory2() latvecs = m.get_pwi_latvecs('md.in') positions.pop() #xyzpositions = [] #for i in positions: # xyz = [] # for j in range(nat): # xyz.append(latvecs @ i[j]) # xyzpositions.append(xyz) # getting Cl1-C2 bondlengths # must subtract 1 due to zero indexing Cl_ind = 1 - 1 C_ind = 2 - 1 distances = []
""" Generate x-hetero modes for Cl libration in pcl2phi. usage: ./xhet.py arg1 arg1 is the angle by which Cl12 and Cl11 will be rotated about the point at the nearest carbon. """ if len(sys.argv) > 1: theta_y = int(sys.argv[1])*np.pi/180 # We attempt to roate the molcule to correct orientation # by roating the molecule about the z axis x = md.Md('best.origin.crystal.works.pwi') pos = x.get_trajectory2()[0] rc1 = pos[0] rc11 = pos[10] rc4 = pos[3] rcl12 = pos[11] # these two R's should be identical # but due to OCD we will define both # R412: the distance from c4 to cl12 # R111: the distance from c1 to cl11 R412 = m.norm(rc4-rcl12) R111 = m.norm(rc1-rc11)