grimme-lab / mctc-lib

Modular computation tool chain library
https://grimme-lab.github.io/mctc-lib
Apache License 2.0
15 stars 17 forks source link

failed to read VASP: no atoms or `Number of atom types mismatches the number of counts` #60

Closed e-kwsm closed 2 months ago

e-kwsm commented 1 year ago

mctc-lib cc30341ec6a6c319489c4b4b5f7f2178db7a142d compiled by GCC 10.2.1 on Debian bullseye.

Prepare the following POSCAR:

POSCAR
3.0
1.0  0.0  0.0
0.0  1.0  0.0
0.0  0.0  1.0
 S
 1
direct
0.0  0.0  0.0

mctc-convert converts the file successfully:

$ mctc-convert POSCAR -o xyz -
1
poscar
S            0.00000000000000        0.00000000000000        0.00000000000000

However, if the indentation of the ion species and numbers are removed, i.e. changed to

S
1

mctc reads nothing:

$ mctc-convert POSCAR -o xyz -
0
poscar

Also, Number of atom types mismatches the number of counts is issued if changed to:

Si
1
 S
1
S
 1

The error does not occur if the above patterns are indented.

If the number of the ions are increased to ten,

e-kwsm commented 1 year ago

If the number of elements are two, mctc reads POSCAR successfully independently of the length of symbols and indentation.

poscar
3.0
1.0  0.0  0.0
0.0  1.0  0.0
0.0  0.0  1.0
B N
1 1
direct
0.0  0.0  0.0
0.5  0.5  0.5