def read_db(self,minimum): '''Read structure from Pele minimum''' cluster=Cluster(self.natoms, np.reshape(minimum.coords,(-1,3)), self.minimiser, atom_types=get_atom_types(self.composition), labels=self.labels) cluster.energy=minimum.energy cluster.quenched=True return cluster
def read_db(self, minimum): '''Read structure from Pele minimum''' cluster = Cluster(self.natoms, np.reshape(minimum.coords, (-1, 3)), self.minimiser, atom_types=get_atom_types(self.composition), labels=self.labels) cluster.energy = minimum.energy cluster.quenched = True return cluster
def read_xyz(self,xyz_file): '''Read structure from xyz file.''' natoms=int(xyz_file.readline()) coords=np.empty(shape=(natoms,3)) energy=float(xyz_file.readline().split()[1]) for i in range(0,natoms): coords[i]=xyz_file.readline().split()[1:4] cluster=Cluster(natoms, coords, self.minimiser, atom_types=get_atom_types(self.composition), labels=self.labels) cluster.energy=energy cluster.quenched=True return cluster
def read_xyz(self, xyz_file): '''Read structure from xyz file.''' natoms = int(xyz_file.readline()) coords = np.empty(shape=(natoms, 3)) energy = float(xyz_file.readline().split()[1]) for i in range(0, natoms): coords[i] = xyz_file.readline().split()[1:4] cluster = Cluster(natoms, coords, self.minimiser, atom_types=get_atom_types(self.composition), labels=self.labels) cluster.energy = energy cluster.quenched = True return cluster