Skip to content

Fix OUTCAR parsing for VASP 5.4.4 with selective dynamics: variable m…#11

Open
eliakim-k wants to merge 1 commit into
raman-sc:masterfrom
eliakim-k:vasp544-selective-dynamics-fix
Open

Fix OUTCAR parsing for VASP 5.4.4 with selective dynamics: variable m…#11
eliakim-k wants to merge 1 commit into
raman-sc:masterfrom
eliakim-k:vasp544-selective-dynamics-fix

Conversation

@eliakim-k

Copy link
Copy Markdown

Fix OUTCAR parsing for VASP 5.4.4 (selective dynamics) and harden dielectric-tensor reading

Problem.
get_modes_from_OUTCAR assumes exactly 3xnat modes. With selective dynamics, VASP prints modes only for unconstrained atoms (3xN_free), so the fixed-length loop overruns the eigenvector block and crashes with AttributeError: 'NoneType' object has no attribute 'group'. Reproduced on VASP 5.4.4 (build Nov 2024) for a Cu(111) slab: nat=55, 48 frozen Cu atoms → only 21 modes exist, not 165.

Changes.

  • get_modes_from_OUTCAR: parse however many f = frequency lines exist and auto-detect per-mode atom count from the file (cross-checked against POSCAR nat, warns on mismatch).
  • get_epsilon_from_OUTCAR: extract the dielectric tensor via float-regex instead of str.split(), tolerating merged columns / signs / scientific notation.
  • Added get_epsilon_from_vasprun_xml + get_epsilon fallback wrapper.

Note. Imaginary (f/i=) modes are skipped by the frequency detector (intended for off-resonant Raman of stable structures); mode indices then refer to real modes only.
Verified against a real OUTCAR: 11 real modes parsed with correct frequencies and the dielectric tensor read correctly.

…ode count + robust dielectric-tensor parsing
@afonari

afonari commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Can you generate diff that only changes the actual code. Also how is this different compared to e309fa3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants