示例#1
0
    def atoms(self):
        """ Returns ase.atoms.Atoms object. """
        atoms = Atoms(cell=self.cell,
                      pbc=self.pbc,
                      info=self.info,
                      celldisp=self._celldisp.copy())

        atoms.arrays = {}
        for name, a in self.arrays.items():
            atoms.arrays[name] = a.copy()
        atoms.constraints = copy.deepcopy(self.constraints)
        self._atoms = atoms
        return self._atoms
示例#2
0
    def copy(self):
        """Return a copy."""
        atoms = Atoms(cell=self.cell,
                      pbc=self.pbc,
                      info=self.info,
                      celldisp=self._celldisp.copy())

        atoms.arrays = {}
        for name, a in self.arrays.items():
            atoms.arrays[name] = a.copy()
        atoms.constraints = copy.deepcopy(self.constraints)
        strc = self.__class__(atoms)
        return strc