def rel_to_abs_f(vector, cell):
"""
Converts a position vector in interal coordinates to absolut coordinates
in Angstroem for a film structure (2D).
"""
# TODO this currently only works if the z-coordinate is the one with no pbc
# Therefore if a structure with x non pbc is given this should also work.
# maybe write a 'tranform film to fleur_film routine'?
if len(vector) == 3:
postionR = np.array(vector)
postionR_f = np.array(postionR[:2])
#print postionR_f
cell_np = np.array(cell)
cell_np = np.array(cell_np[0:2, 0:2])
#print cell_np
new_xy = [i for i in np.matmul(postionR_f, cell_np)]
new_abs_pos_f = [new_xy[0], new_xy[1], postionR[2]]
return new_abs_pos_f
else:
return False
评论列表
文章目录