wulfric.dump_poscar#

wulfric.dump_poscar(crystal_like, file_object='POSCAR', comment: str = None, decimals=8, mode: str = 'Direct')[source]#

Write Crystal-like object to the POSCAR file.

Parameters:
crystal_likeany

Object to be written. It has to have .cell and .atoms attributes. cell has to be a 3x3 array-like object, atoms has to be a list of Atom objects.

file_objectstr of file-like object, optional

File to be written. If str, then file is opened with the given name. Otherwise it has to have .write() method.

commentstr, optional

Comment to be written in the first line of the file. Has to be a single line. All new lines symbols are replaced with spaces.

decimalsint, default 8

Number of decimals to be written.

modestr, default "Direct"

Mode of the coordinates to be written. Can be "Direct" or "Cartesian".