Skip to content
Snippets Groups Projects
Commit 5b9c57e4 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9183 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent f4cc8c35
No related branches found
No related tags found
No related merge requests found
...@@ -57,14 +57,15 @@ def lmp2xyz(lammps,xyz,xpos): ...@@ -57,14 +57,15 @@ def lmp2xyz(lammps,xyz,xpos):
countsnap=1 countsnap=1
if data!='n': coords={} if data!='n': coords={}
else: coords=zeros((int(numatoms),4),dtype=float) else: coords=zeros((int(numatoms),4),dtype=float)
sys.stdout.write("Writing [%d]: "%(snaps)) # sys.stdout.write("Writing %d snapshots\n"%(snaps))
sys.stdout.flush() # sys.stdout.flush()
read_atoms=0 read_atoms=0
types={}
for line in lines: for line in lines:
if line.find('ITEM: TIMESTEP')==0: if line.find('ITEM: TIMESTEP')==0:
read_atom_flag=False read_atom_flag=False
sys.stdout.write("%d "%(countsnap)) # sys.stdout.write("%d "%(countsnap))
sys.stdout.flush() # sys.stdout.flush()
fout.writelines("%s\nAtoms\n"%(numatoms)) fout.writelines("%s\nAtoms\n"%(numatoms))
countsnap+=1 countsnap+=1
continue continue
...@@ -75,13 +76,11 @@ def lmp2xyz(lammps,xyz,xpos): ...@@ -75,13 +76,11 @@ def lmp2xyz(lammps,xyz,xpos):
read_atoms+=1 read_atoms+=1
parse=line.split() parse=line.split()
if parse[0]!="": if parse[0]!="":
# print [mass_floor[int(floor(mass[int(parse[1])-1]))],float(parse[xpos-1]),float(parse[xpos]),float(parse[xpos+1])]
if data!='n': if data!='n':
if mass[int(parse[1])-1]==1.0: if parse[1] not in types.keys():
type='Au' type=raw_input("Atom name for type %s: "%parse[1])
else: types[parse[1]]=type
type=mass_floor[int(floor(mass[int(parse[1])-1]))] coords[int(parse[0])-1]=[types[parse[1]],float(parse[xpos-1]),float(parse[xpos]),float(parse[xpos+1])]
coords[int(parse[0])-1]=[type,float(parse[xpos-1]),float(parse[xpos]),float(parse[xpos+1])]
else: else:
coords[int(parse[0])-1][0]=int(parse[1]) coords[int(parse[0])-1][0]=int(parse[1])
coords[int(parse[0])-1][1]=float(parse[xpos-1]) coords[int(parse[0])-1][1]=float(parse[xpos-1])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment