xdatbus.fun_com

Functions

com_drift(xyz_path[, frame_start, frame_end, ...])

Calculate the center of mass (COM) drift velocity for a xyz file.

com_contcar(poscar_path, contcar_path[, del_inter])

Correct the CONTCAR file by adding the COM drift to the coordinates of the CONTCAR file.

Module Contents

xdatbus.fun_com.com_drift(xyz_path, frame_start=0, frame_end=None, save_csv=True, timestep=1)

Calculate the center of mass (COM) drift velocity for a xyz file.

Parameters

xyz_pathstr

Path to the XYZ file.

frame_startint

The first frame to consider.

frame_endint

The last frame to consider. If None, considers all frames.

save_csvbool

Whether to save the COM to a csv file.

timestepint

The time difference between each frame, in appropriate time units. Default is 1.

Returns

np.ndarray

The COM drift velocity, represented as a 3-element numpy array.

xdatbus.fun_com.com_contcar(poscar_path, contcar_path, del_inter=False)

Correct the CONTCAR file by adding the COM drift to the coordinates of the CONTCAR file. The COM drift is calculated by fcom01_drift().

Parameters

poscar_pathstr

Path to the POSCAR path.

contcar_pathstr

Path to the CONTCAR file.

del_interbool

Delete the intermediate files created by this function.