2
$\begingroup$

I want to model some cells with liquid water using VASP. I use the Packmol package to generate the initial configuration, but when I try to convert the pdb output file into the POSCAR format, the positions are completely messed up. This is the input file for Packmol, which places 17 H2O molecules in a 5x5x20 Angström box:

#
# A box with water
#

tolerance 2.0
filetype pdb
output water_box.pdb

structure water.pdb
  number 17
  inside box 0. 0. 0. 5. 5. 20.
end structure

This looks fine when I open the output file in VESTA, all molecules are within the stated confines with reasonable minimal distance:

Packmol output structure

But this structure contains no cell information. When I export the data as POSCAR format, the cell looks like this:

Exported output

The positions are messed up and the minimal distance between molecules is not preserved. As such, some of these molecules are not recognizable as H2O anymore.

I get exactly the same result, when I copy the atomic positions from the .pdb file and place them in a POSCAR file manually.

How can I convert the pdb file into the POSCAR format properly?

$\endgroup$
2
  • 1
    $\begingroup$ I only have two suggestions: use XYZ format and/or try to convert the PDB with OpenBabel and then add the cell info manually. $\endgroup$
    – Camps
    Commented Jul 26 at 13:41
  • $\begingroup$ I second the suggestion to save as XYZ from packmol. $\endgroup$ Commented Jul 28 at 18:09

1 Answer 1

3
$\begingroup$

I found a solution in the newest version of packmol, 20.15, which introduces orthorhombic periodic boundary conditions as feature. Before, I used 20.14, which lacks this feature.

I added a line with pbc 5.0 5.0 20.0, to enforce a 5x5x20 Angström box, so now my input file looks like this:

#
# A box with water
#

tolerance 2.0
filetype pdb
output water_box.pdb
pbc 5.0 5.0 20.0 

structure water.pdb
  number 17
  inside box 0. 0. 0. 5. 5. 20.
end structure

The output file now contains an additional line 6 headed with CRYST1, which contains the crystal box dimensions:

HEADER 
TITLE     Built with Packmol                                             
REMARK   Packmol generated pdb file 
REMARK   Home-Page: http://m3g.iqm.unicamp.br/packmol
REMARK
CRYST1     5.00     5.00    20.00  90.00  90.00  90.00 P 1           1
HETATM    1  H   HOH A   1       0.755   2.026   0.737                          
HETATM    2  H   HOH A   1       2.331   2.446   0.829                          
HETATM    3  O   HOH A   1       1.400   2.790   0.706
...   

VESTA now loads this file correctly. While it looks simple to add, I would caution against just adding this line in a file generated by earlier versions, since the periodic images are likely not considered there.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .