d=dump(trajectory);
d.sort()
time=d.time()
stats=np.zeros(len(time))
statsx=np.zeros(len(time))
statsy=np.zeros(len(time))
count=0
sumx=0
sumy=0
phobulk=0

# FlatSinMagnet_phi0.35_pe100_step1000000_Tau10.L100.lammpstrj
#Output file names 

name="newLattice_cutoff{:}_{:}".format(cutoff,filename)
outputfile="{:}.XYZ".format(namefiles.output(name))

fxyz=open(outputfile,"w")

#look at displacements ..and subtract the total netdisplacement. 
grandsumx=0
grandsumy=0
xmid=int(xlattice/2.0)
height=np.zeros(xlattice)

for t in time:
  if count>skip and count%skip1==0:
   lattice=np.zeros((xlattice,ylattice))
   #elegant module in pizza.py library. Easy way to process the lammpstrj files. d.vecs() goes frame by frame.  
   idlist,typelist,xlist,ylist,zlist=d.vecs(t,"id","type","x","y","z")
   cmx=0
trajectory = "{:}.lammpstrj".format(filename)

print "Input file:{0:s}".format(trajectory)

d=dump(trajectory);
d.sort()
time=d.time()

collect = len(time)-skip-(2*skip1) # of time frames to collect for. will have nsamples*(collect-skip)/skip1 total samples in the end
print collect

nsamples = 10
nsamplesTotal = nsamples*(collect-skip)/skip1

name = "rhoLocalvsrhoRed_{:}".format(filename)
outputfile = "{:}.stats".format(namefiles.output(name))

foutput=open(outputfile,"w")


nsamples = 100 #number of probe volumes to sample in each frame
r2 = pow(r,2.0)
nmax = int(4*0.9069*r2) #close packed max # of particles in probe volumes
n = np.zeros((nmax),dtype=int) #number of samples obtained

rhoTotal = np.zeros(nmax) #n total particles as a function of the number of red(driven) particles.
rhoTotalvar = np.zeros(nmax)
rho = np.zeros(2)  #rho[0] = n active particles, rho[1] = n passive particles.


count = 0
示例#3
0
vytype2 = np.zeros(np.divide(xhi, cg))
vytype1_std = np.zeros(np.divide(xhi, cg))
vytype2_std = np.zeros(np.divide(xhi, cg))
countersum1 = np.zeros(np.divide(xhi, cg))
countersum2 = np.zeros(np.divide(xhi, cg))
count = 0
sumx = 0
sumy = 0

#check= "dump/checktrajectory_{0:s}.XYZ".format(filename)
#checkfile = open(check,"w")

#Output file names

name = "vprofUnnormalized_{:}".format(filename)
outputfile = "{:}.stats".format(namefiles.output(name))

foutput = open(outputfile, "w")

#look at displacements
grandsumx = 0
grandsumy = 0

for t in time:
    if count > skip and count % skip1 == 0 and (count -
                                                skip) / skip1 < collect:
        #elegant module in pizza.py library. Easy way to process the lammpstrj files. d.vecs() goes frame by frame.
        idlist, typelist, xlist, ylist, zlist = d.vecs(t, "id", "type", "x",
                                                       "y", "z")
        cmx = 0
        cmy = 0