def set_atoms(self, atoms): if self.atoms == atoms: return # performs an update of the atoms Calculator.set_atoms(self, atoms) write_turbomole('coord', atoms) # energy and forces must be re-calculated self.update_energy = True self.update_forces = True
def set_atoms(self, atoms): if self.atoms == atoms: return # performs an update of the atoms Calculator.set_atoms(self, atoms) write_turbomole("coord", atoms) # energy and forces must be re-calculated self.update_energy = True self.update_forces = True
def set_atoms(self, atoms): if self.atoms == atoms: if (self.updated and os.path.isfile('coord')): self.updated = False a = read('coord').get_positions() if np.allclose(a, atoms.get_positions(), rtol=0, atol=1e-13): return else: return # performs an update of the atoms write('coord', atoms) Calculator.set_atoms(self, atoms) # energy and forces must be re-calculated self.update_energy = True self.update_forces = True
def set_atoms(self, atoms): if self.atoms == atoms: return # performs an update of the atoms Calculator.set_atoms(self, atoms) # # We may reside in a clean directory, # Write 'control' and auxiliary files: # self.store2files(TURBOMOLE_INPUT_FILES) write_turbomole('coord', atoms) # energy and forces must be re-calculated self.update_energy = True self.update_forces = True
def set_atoms(self, atoms): # Delete old coord control, ... files, if exist for f in [ 'coord', 'basis', 'energy', 'gradients', 'alpha', 'beta', 'mos', 'forceapprox', 'statistics', 'dscf_problem', 'control' ]: if os.path.exists(f): os.remove(f) # if self.atoms == atoms: # if (self.updated and os.path.isfile('coord')): # self.updated = False # a = read('coord').get_positions() # if np.allclose(a, atoms.get_positions(), rtol=0, atol=1e-13): # return # else: # return # performs an update of the atoms write('coord', atoms) if not self.key_parameters["basis"] == 'cefine': string = '\n\na coord\n*\nno\nb all ' + self.key_parameters[ 'basis'] + '\n*\neht\n\n' + str( self.key_parameters['charge'] ) + '\n\nscf\niter\n' + str( self.key_parameters['maxit'] ) + '\n\ncc\nmemory\n1000\n*\ndft\non\nfunc\n' + self.key_parameters[ 'method'] + '\n*\nri\non\nm\n3000\n*\n*' self.define_str = string with open('def.inp', 'w') as f: f.write(self.define_str) command = 'define < def.inp > define.out' else: self.define_str = self.key_parameters['method'] + '-chrg ' + str( self.key_parameters['charge']) command = self.define_str + ' > cefine.out' # run define proc = Popen([command], shell=True, stderr=PIPE) error = proc.communicate()[1] if 'abnormally' in error: raise OSError(error) Calculator.set_atoms(self, atoms) # energy and forces must be re-calculated self.update_energy = True self.update_forces = True