def get_cell_angle(self): """ return lattices angle of unit cell in degree. """ gamma = (self.cell_lattices[0], self.cell_lattices[1]) alpha = (self.cell_lattices[1], self.cell_lattices[2]) beta = (self.cell_lattices[2], self.cell_lattices[0]) angles = [Vector.get_angle(x, y) for x, y in (alpha, beta, gamma)] return angles
def get_latt(pot_lines): """ 格子の情報を parse する """ pos_latt = pot_lines.index("LATTICE\n") scale = float(pot_lines[pos_latt+4].split()[1]) cell_lattices = np.array([[float(x) for x in y.split()[1:4]] for y in pot_lines[pos_latt+5:pos_latt+8]]) volume = Vector.get_volume(*cell_lattices) * scale ** 3 return {'volume': volume, 'latt': cell_lattices, 'latt_scale': scale}
def get_data(self, pot_lines): """ tetragonalにのみ対応 c/aとvolumeのみを出力する 必要あればdictの項目を増やして対応 その際vaspyのPOSCARを参照したい """ pos_latt = pot_lines.index("LATTICE\n") scale = float(pot_lines[pos_latt+4].split()[1]) cell_lattices = np.array([[float(x) for x in y.split()[1:4]] for y in pot_lines[pos_latt+5:pos_latt+8]]) latt_length = [np.linalg.norm(x) * scale for x in cell_lattices] cova = latt_length[2] / latt_length[0] volume = Vector.get_volume(*cell_lattices) * scale ** 3 occ = self.get_occupation(pot_lines) return({'volume': volume, 'c/a': cova, 'occ': occ})
def get_cell_volume(self): """ Return cell volume """ volume = Vector.get_volume(*self.cell_lattices) * self.cell_scale ** 3 return volume