dpdata.vasp package#
Submodules#
dpdata.vasp.outcar module#
- dpdata.vasp.outcar.atom_name_from_potcar_string(instr: str) str[source]#
Get atom name from a potcar element name.
e.g. Sn_d -> Sn
- Parameters:
- instrstr
input potcar elemenet name
- Returns:
- name: str
name of atoms
- dpdata.vasp.outcar.system_info(lines: list[str], type_idx_zero: bool = False) tuple[list[str], list[int], ndarray, int | None, int | None][source]#
Get system information from lines of an OUTCAR file.
- Parameters:
- lineslist[str]
the lines of the OUTCAR file
- type_idx_zerobool
if true atom types starts from 0 otherwise from 1.
- Returns:
- atom_names: list[str]
name of atoms
- atom_numbs: list[int]
number of atoms that have a certain name. same length as atom_names
- atom_types: np.ndarray
type of each atom, the array has same lenght as number of atoms
- nelm: optional[int]
the value of NELM parameter
- nwrite: optional[int]
the value of NWRITE parameter
dpdata.vasp.poscar module#
dpdata.vasp.xml module#
- dpdata.vasp.xml.analyze(fname, type_idx_zero=False, begin=0, step=1, convergence_check=True)[source]#
Deal with broken xml file.
- dpdata.vasp.xml.analyze_calculation(cc: Any, nelm: int | None) tuple[ndarray, ndarray, float, ndarray, ndarray | None, bool | None][source]#
Analyze a calculation block.
- Parameters:
- ccxml.etree.ElementTree.Element
The xml element for a ion step calculation
- nelmOptional[int]
The number nelm, if it is not None, convergence check is performed.
- Returns:
- posinp.ndarray
The positions
- cellnp.ndarray
The cell
- enerfloat
The energy
- forcenp.ndarray
The forces
- strOptional[np.ndarray]
The stress
- is_converged: Optional[bool]
If the scf calculation is converged. Only return boolean when nelm is not None. Otherwise return None.