7
$\begingroup$

I have used the finite displacements method for phonon spectrum calculation, and when I typed the command to create force sets:

phonopy -f disp-{001..024}/vasprun.xml

But I have got this error:

        _
  _ __ | |__   ___  _ __   ___   _ __  _   _
 | '_ \| '_ \ / _ \| '_ \ / _ \ | '_ \| | | |
 | |_) | | | | (_) | | | | (_) || |_) | |_| |
 | .__/|_| |_|\___/|_| |_|\___(_) .__/ \__, |
 |_|                            |_|    |___/
                                       2.7.1

Python version 3.8.3
Spglib version 1.16.0

Displacements were read from "phonopy_disp.yaml".
counter (file index): 1 2 3 4 5 6 7 Traceback (most recent call last):
  File "/home/ouettar/.local/bin/phonopy", line 43, in <module>
    main(**argparse_control)
  File "/home/ouettar/.local/lib/python3.8/site-packages/phonopy/cui/phonopy_script.py", line 1553, in main
    create_FORCE_SETS_from_settings(settings, symprec, log_level)
  File "/home/ouettar/.local/lib/python3.8/site-packages/phonopy/cui/phonopy_script.py", line 438, in create_FORCE_SETS_from_settings
    create_FORCE_SETS(
  File "/home/ouettar/.local/lib/python3.8/site-packages/phonopy/cui/create_force_sets.py", line 115, in create_FORCE_SETS
    force_sets = get_force_sets(interface_mode,
  File "/home/ouettar/.local/lib/python3.8/site-packages/phonopy/interface/calculator.py", line 586, in get_force_sets
    force_sets = parse_set_of_forces(num_atoms,
  File "/home/ouettar/.local/lib/python3.8/site-packages/phonopy/interface/vasp.py", line 69, in parse_set_of_forces
    forces = vasprun.read_forces()
  File "/home/ouettar/.local/lib/python3.8/site-packages/phonopy/interface/vasp.py", line 501, in read_forces
    return self._parse_expat_vasprun_xml()
  File "/home/ouettar/.local/lib/python3.8/site-packages/phonopy/interface/vasp.py", line 597, in _parse_expat_vasprun_xml
    return self._parse_by_expat(self._fileptr)
  File "/home/ouettar/.local/lib/python3.8/site-packages/phonopy/interface/vasp.py", line 602, in _parse_by_expat
    vasprun.parse()
  File "/home/ouettar/.local/lib/python3.8/site-packages/phonopy/interface/vasp.py", line 712, in parse
    self._p.ParseFile(self._fileptr)

Do you have any idea how to fix this error?

$\endgroup$
7
  • 1
    $\begingroup$ just try this phonopy -f */vasprun.xml and update me. $\endgroup$ Dec 21, 2021 at 12:15
  • $\begingroup$ Displacements were read from "phonopy_disp.yaml". Number of files to be read (25) don't match to the number of displacements (24) in phonopy_disp.yaml. FORCE_SETS could not be created. $\endgroup$
    – Chi Kou
    Dec 21, 2021 at 12:23
  • 3
    $\begingroup$ looks like number of vasprun.xml is 25 whereas number of displacement in phonopy_disp.yml file 24. kindly check this consistency $\endgroup$ Dec 21, 2021 at 14:18
  • 1
    $\begingroup$ Just letting you know that the phonopy chat room is now called "python-based matter modeling software". $\endgroup$ Dec 21, 2021 at 16:56
  • 1
    $\begingroup$ @pranavkumar Do you have any other ideas? $\endgroup$ Jan 20 at 22:53

1 Answer 1

5
$\begingroup$

This is basic bash-script which will be quite useful, just start with scratch

phonopy -d --dim 2 2 2 --pa auto -c POSCAR                    
                                                                     
for m in `ls POSCAR-0*`                                              
do                                                                   
fol=`echo $m|cut -d "-" -f 2`                                        
mkdir dis_$fol                                                       
cp POSCAR-$fol dis_$fol/POSCAR                                       
cp INCAR.phon dis_$fol/INCAR                                         
cp POTCAR dis_$fol/                                                  
cp KPOINTS.phon dis_$fol/KPOINTS                                     
#cp run.pbs dis_$fol/                                                
cd dis_$fol/                                                         
#run vasp                                        
cd ..                                                                
done

save this as file1.sh and run as bash -i file1.sh For getting results in one shot

list=$(ls -d dis*)                                                   
echo ${list}                                                         
phonopy -f ${list}/vasprun.xml                   
cat <<END >mesh.conf                                                 
DIM = 2 2 2                                                          
ATOM_NAME = Al                                                       
MP = 31 31 31                                                        
EIGENVECTORS = .true.                                                
FORCE_CONSTANTS = Write                                              
END                                                                  
phonopy -t mesh.conf

save this again in as bash script and run it

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.