Generation¶
Generate MXene Structural Data¶
The crystal structure data generated by mxene includes three methods:
Usage:
Starting from layered structure, customize structural elements, number of layers, supercell size, etc.
>>> from mxene.core.mxenes import MXene >>> from pymatgen.io.vasp import Poscar >>> structures = MXene.from_standard(terminal_site='fcc', terminal="O", base="Ti")
Read and generate from the existing poscar file.
>>> structures = MXene.from_file('POSCAR')
Read the existing POSCAR and convert it to
Structurethrough pymatgen, and convert it toMXenesequentially.>>> pos = Poscar.from_file('POSCAR') >>> st = pos.structure >>> structures = MXene.from_structure(st)
Note
The 2 and 3 methods are inherited from structure.
VASP input¶
This package can be used to generate VASP inputs easily. The files are “POSCAR”,”INCAR”,”KPOINTS”,”POTCAR”,”pbs.run” .etc.
Examples:
# POSCAR
>>> from mxene.core.mxenes import MXene
>>> from mxene.prepare.vaspinput import MXVaspInput
>>> from pymatgen.io.vasp.inputs import Poscar
>>> structure = MXene.from_standard(terminal_site='fcc', terminal="O", base="Ti")
>>> poscar = Poscar(structure)
# POTCAR
>>> sym_potcar_map = check_potcar(potpath=r"POT-database")
>>> potcar = get_potcar(poscar, sym_potcar_map=sym_potcar_map)
# KPOINTS
>>> from pymatgen.io.vasp import Kpoints
>>> kpoints = Kpoints(kpts=((3, 3, 1),))
# INCAR
>>> from mxene.prepare.conf_files import opt_incar
>>> from pymatgen.io.vasp import Incar
>>> incar = Incar.from_string(opt_incar)
# run file (depend on your machine.)
>>> from pymatgen.io.vasp import Incar
>>> run_f = """#PBS -S /bin/bash
... #PBS -N vasp
... #PBS -l nodes=1:ppn=12
... #PBS -l walltime=120:00:00
... #PBS -q master
... source /opt/intel/oneapi/mkl/latest/env/vars.sh intel64
... source /opt/intel/oneapi/compiler/latest/env/vars.sh intel64
... source /opt/intel/oneapi/mpi/2021.4.0/env/vars.sh intel64
... export PATH=/opt/software/vasp.5.4.4/bin:$PATH
... cd ${PBS_O_WORKDIR}
... mpirun -np 40 vasp_std"""
>>> incar = Incar.from_string(opt_incar)
# ALL
>>> mxinput = MXVaspInput(incar, kpoints, poscar, potcar, optional_files=None, **kwargs)
>>> mxinput.write_input(output_dir=".",make_dir_if_not_present=True)