def __init__(self ,natoms,r_ij ,eleNums,eleNames ,eleMasses,nPool ,stride,subString ,boxAdd,surface ,surfGA): self.natoms = natoms self.r_ij = r_ij self.eleNums = eleNums self.eleNames = eleNames self.eleMasses = eleMasses self.nPool = nPool self.stride = stride self.subString = subString self.boxAdd = boxAdd ''' Surface Object. ''' self.surface = surface self.surfGA = surfGA db.lock() self.calcNum = db.findLastDir() + 1 os.system("mkdir " + str(self.calcNum)) db.unlock() self.genRan()
def runCalc(self): ''' Start calculation making new directory. ''' db.lock() self.calcNum = db.findLastDir() + 1 while os.path.exists(str(self.calcNum)): self.calcNum = db.findLastDir() + 1 os.system("mkdir " + str(self.calcNum)) self.produceOffspring() db.unlock() self.minimise()