How to visualize the trjactory generated by NWChem

From NWChem

You are viewing a single post from the thread title above
Jump to: navigation, search

Click here for full thread
Just Got Here
Threads 0
Posts 2
If it is not too late here is the python code for extracting coordinate files from molecular dynamics simulation containing 32 atoms:
the program opens log file mpirunlogtrim.txt
and outputs coordinates to mpirunlogtrim.xyz frame by frame readable in VMD

%----------------------------------------------
from numpy import *
import numpy as np

file = open('./mpirunlogtrim.txt');

elems=0;
fctr=0;
elctr=0;
data = file.readlines();
file.close();

elems=32;
elem=[]*elems;
  1. read elements list
for n in range(0,elems):
   elem[n]=data[n+2].rsplit()[1];
print elem[n]

incr=0;
filew=open('./mpirunlogtrim.xyz','w');
readnext=1;
pos=2;
while readnext:
  filew.write(str(elems)+'\n');
filew.write('Dynamics at 500 K'+'\n');
for n in range(0,elems):
list_of_el=list(data[n+pos].rsplit());
filew.write(.join(format(el,'<15') for el in list_of_el[1:5])+'\n');
incr+=1;
pos+=elems+31;

if pos+1>len(data):
readnext=0;

filew.close();
%---------------------------------------------------------


Who's here now Members 0 Guests 0 Bots/Crawler 0


AWC's: 2.5.10 MediaWiki - Stand Alone Forum Extension
Forum theme style by: AWC