def setup(self, step, time, configuration): self.__initTime = time typeList = configuration.types() self.__histSize = 2*len(typeList) self.__histogram = [] for i in range(0, self.__histSize): self.__histogram.append(foldyFloatList()) ourLattice = configuration.lattice() ourReps = ourLattice.repetitions() self.__width = ourReps[0] self.__height = ourReps[1] total = 0 for i in range(0, self.__width): for j in range(0, self.__height): if typeList[self.__height*i+j] in self.__spec: leftI = (i-1+self.__width)%self.__width rightI = (i+1+self.__width)%self.__width upJ = (j+1+self.__height)%self.__height downJ = (j-1+self.__height)%self.__height if typeList[self.__height*leftI+j] in self.__spec: total += 1 if typeList[self.__height*rightI+j] in self.__spec: total += 1 if typeList[self.__height*i+upJ] in self.__spec: total += 1 if typeList[self.__height*i+downJ] in self.__spec: total += 1 self.__currTot = total self.__lastTime = time self.__currentTime = time
def finalize(self): self.__lastTime = self.__currentTime self.__finalHist = [] totalWeight = foldyFloatList() for data in self.__histogram: temp = data.extractSum() totalWeight.addValue(temp) self.__finalHist.append(temp) ovTot = totalWeight.extractSum() for index in range(0, self.__histSize): self.__finalHist[index] = self.__finalHist[index]/float(ovTot)
def setup(self, step, time, configuration): self.__initTime = time typeList = configuration.types() self.__histSize = len(typeList) self.__histogram = [] for i in range(0, self.__histSize): self.__histogram.append(foldyFloatList()) total = 0 for i in typeList: if i in self.__spec: total += 1 self.__currTot = total
def setup(self, step, time, configuration): self.__initTime = time typeList = configuration.types() # There are up to 3 bonds (6 half-bonds) per atom self.__histSize = 3*len(typeList) self.__histogram = [] for i in range(0, self.__histSize): self.__histogram.append(foldyFloatList()) ourLattice = configuration.lattice() ourReps = ourLattice.repetitions() self.__width = ourReps[0] self.__height = ourReps[1] self.__depth = ourReps[2] self.__lastTime = time self.__currentTime = time
def setup(self, step, time, configuration): self.__initTime = time typeList = configuration.types() # There are up to 3 bonds (6 half-bonds) per atom self.__histSize = 3 * len(typeList) self.__histogram = [] for i in range(0, self.__histSize): self.__histogram.append(foldyFloatList()) ourLattice = configuration.lattice() ourReps = ourLattice.repetitions() self.__width = ourReps[0] self.__height = ourReps[1] self.__depth = ourReps[2] self.__lastTime = time self.__currentTime = time
import sys for x in sys.path: print x from foldyFloatList import foldyFloatList a = foldyFloatList() a.addValue(1.0) print(a.toString()) a.addValue(2.0) print(a.toString()) a.addValue(3.0) print(a.toString()) a.addValue(4.0) print(a.toString()) a.addValue(5.0) print(a.toString()) a.addValue(6.0) print(a.toString()) a.addValue(-1.0) print(a.toString()) a.addValue(7.0) print(a.toString()) a.addValue(-8.0) print(a.toString()) a.addValue(1.0) print(a.toString()) a.addValue(3.0) print(a.toString()) a.addValue(-10.0) print(a.toString()) a.addValue(3.0)