Login

add pbc

Author:
renpj
Posted:
October 8, 2016
Language:
Python
Version:
Not specified
Tags:
pbc
Score:
-2 (after 2 ratings)

Add pbc to atoms

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import ase.io
filename = 'MoC-66-Au40-873K-pos-1.xyz'
cell = [[16.031934861413301,  9.256041907867520,-0.00000000000000 ],
        [-0.000000000000000, 18.512083815735100, 0.000000000000000],          
        [-0.000000000000000, -0.000000000000000,21.297938808914601],]
traj= ase.io.read(filename,index=':')
newtraj = []
for i in traj:
    newi = i.copy()
    newi.cell = cell
    newi.pbc = True
    newtraj.append(newi)

ase.io.write('traj.xsf',images=newtraj,format='xsf')

More like this

Comments

Please login first before commenting.