def findAtoms(self, identifiers, initialized=True, coordinates='orth_defect'): extra_atoms = self.surface().extraAtoms(coordinates='orth_surface') crystal_atoms = self.surface().crystalAtoms(end_layer=1, coordinates='orth_surface') unit_cell = self.surface().cell('orth_surface') atoms = findAtoms(extra_atoms, crystal_atoms, identifiers, unit_cell) atoms = self.change(atoms, to='orth_defect', fro='orth_surface') atoms = makeAtomsRelaxed( atoms, self.relaxation(), tolerance=2.0, ) atoms = self.change(atoms, to=coordinates, fro='orth_defect') if initialized and not (self.initialState() is None): initial_identifiers = [s['identifier'] for s in self.initialState()] initial_identifiers = self.initialStateIdentifiers(initial_identifiers) for i in range(len(atoms)): identifier = identifiers[i] if identifier in initial_identifiers: index = initial_identifiers.index(identifier) move = self.__initial_state[index]['move_vector'] atoms[index].position += move return atoms
def makeAtomsRelaxed(self, atoms, relaxation, tolerance=1): factor = self.relaxationFactor() atoms.positions *= factor atoms.cell[2] *= factor atoms = makeAtomsRelaxed(atoms, self.relaxation(), tolerance=tolerance) return atoms
def makeAtomsRelaxed(self, atoms, relaxation): atoms = atoms.copy() atoms = self.fullyUnrelaxed().change(atoms, fro='orth_surface', to='orth_crystal') atoms = self.crystal().makeAtomsRelaxed(atoms, self.crystal().relaxation()) atoms = self.change(atoms, to='orth_surface', fro='orth_crystal') atoms = makeAtomsRelaxed(atoms, self.relaxation(), tolerance=1.5) return atoms
def makeAtomsRelaxed(self, atoms, relaxation): atoms = self.makeSubsystemsRelaxed(atoms) if relaxation is None: return atoms.copy() size = len(self.molecule()) slab_atoms = atoms[:-size] relaxed_slab_atoms = relaxation[:-size] atoms.positions[:-size] = makeAtomsRelaxed(slab_atoms, relaxed_slab_atoms, 1.0).positions atoms.positions[-size:] = relaxation[-size:].positions return atoms
def makeAtomsRelaxed(self, atoms, relaxation, tolerance=1.0): if relaxation is None: return atoms factor = relaxationFactor(self.__atoms, relaxation) atoms.positions *= factor atoms.cell *= factor atoms = makeAtomsRelaxed(atoms, relaxation, tolerance=tolerance) for electrode in atoms.electrodes(): electrode.setCell(electrode.cell()*factor) return atoms
def makeAtomsRelaxed(self, atoms, relaxation, tolerance=1.0): atoms = self.makeSubsystemsRelaxed(atoms, tolerance=0.1) atoms = makeAtomsRelaxed(atoms, relaxation, tolerance=tolerance) return atoms
def makeAtomsRelaxed(self, atoms): return makeAtomsRelaxed(atoms, self.relaxation())