Skip to content

[BUG] virials issue in vasprun.xml #212

@hezhengda

Description

@hezhengda

Summary

When using dpdata to process vasprun.xml, an error will occur regarding virials: IndexError: index 0 is out of bounds for axis 0 with size 0.

Suggested solution (it works)
Two files need to be modified:
(1) ./dpdata/vasp/xml.py. One can delete the last output variable all_strs (around line 101)
(2) ./dpdata/system.py. (around line 1284) One can comment out the following code, as shown in below:

# for ii in range (self.get_nframes()) :                                                                                                                                                                                      
#     vol = np.linalg.det(np.reshape(self.data['cells'][ii], [3,3]))                                                                                                                                                          
#     self.data['virials'][ii] *= v_pref * vol 

Don't know whether it will affect anything (for other calculations), but so far it works for me.

Best,
Zhengda

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvasp

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions