script chg2cube.pl

Vasp transition state theory tools

Moderator: moderators

Post Reply
rafter
Posts: 2
Joined: Tue Sep 02, 2008 9:16 pm

script chg2cube.pl

Post by rafter »

I tried to use the script chg2cube.pl but when I have to enter atom types by atomic number I don't know how the program will read. For example, I have Pt 12 atoms Co 12 atom O 1 atom and H 2 atoms. I enter 78 27 8 1 but it have error said NUMBER OF ELEMENT TYPES DOES NOT MATCH NUMBER OF ATOMIC NUMBERS GIVEN. How am I supposed to enter the input?
Thank you.
dano
Posts: 39
Joined: Sat Nov 05, 2005 12:04 am
Contact:

Re: script chg2cube.pl

Post by dano »

It looks to me like you are entering the data correctly. If you have four atom groups in your CHGCAR then you need to enter four numbers, separated by spaces and <enter>. If you have not updated on cvs in a while that particular script was updated in late August.
crajesh
Posts: 2
Joined: Fri Oct 05, 2007 5:18 am

Re: script chg2cube.pl

Post by crajesh »

Does this code work for non-orthogonal cells also ?
or works properly for cubic cells/or othogonal cells only ..?

thanx
rajesh
graeme
Site Admin
Posts: 2291
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: script chg2cube.pl

Post by graeme »

I does not look like this script does deal with non-orthogonal boxes correctly. But it should. We'll post back when it's been done.
dano
Posts: 39
Joined: Sat Nov 05, 2005 12:04 am
Contact:

Re: script chg2cube.pl

Post by dano »

The script has been checked and can handle non-orthogonal cells at this point.
modey3
Posts: 1
Joined: Sun Jan 04, 2009 4:27 am

Re: script chg2cube.pl

Post by modey3 »

Hello,

I'm getting the same error. I am just running a 16 atom Fe and 1 N supercell. I enter the atomic numbers as:

26 7

and I get the "NUMBER OF ELEMENT TYPES DOES NOT MATCH NUMBER OF ATOMIC NUMBERS GIVEN" error

My CHGCAR file looks like:

FeN Oct Bulk Calc
1.00000000000000
5.740000 0.000000 0.000000
0.000000 5.740000 0.000000
0.000000 0.000000 5.740000
16 1
Direct
0.000000 0.998361 0.000000
0.500000 0.949386 0.000000
0.000000 0.501639 0.000000
0.000000 0.007031 0.500000
0.500000 0.550614 0.000000
0.500000 0.998361 0.500000
0.000000 0.492969 0.500000
0.500000 0.501639 0.500000
0.254426 0.250000 0.245574
0.745574 0.250000 0.245574
0.240959 0.750000 0.259041
0.254426 0.250000 0.754426
0.759041 0.750000 0.259041
0.745574 0.250000 0.754426
0.240959 0.750000 0.740959
0.759041 0.750000 0.740959
0.500000 0.250000 0.000000

36 36 36

CHARGE DENSITY DATA


What could be the problem?

Thank you

modey3
graeme
Site Admin
Posts: 2291
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: script chg2cube.pl

Post by graeme »

I'm pretty sure this is due to a convention that we have in which the first line of your POSCAR or CHGCAR file should be the elements used in the calculation. Try changing your first line from

FeN Oct Bulk Calc

to

Fe N
vietbac
Posts: 6
Joined: Mon Jun 09, 2008 7:29 pm

Re: script chg2cube.pl

Post by vietbac »

Hi,

I got the same problem. I have CHGCAR file for Aluminium bulk system.

POSCAR file
Al
4.05000000000000
0.4985804050614968 0.4985804050614968 0.0000000000000000
0.0000000000000000 0.4985804050614968 0.4985804050614968
0.4985804050614968 0.0000000000000000 0.4985804050614968
1
Direct
0.0000000000000000 0.0000000000000000 0.0000000000000000
CHGCAR file
Al
4.05000000000000
0.498580 0.498580 0.000000
0.000000 0.498580 0.498580
0.498580 0.000000 0.498580
1
Direct
0.000000 0.000000 0.000000

24 24 24
-.17130759910E+00 -.27145340249E-01 0.38590045741E+00 0.10061363175E+01 0.17299028414E+01
0.24304876139E+01 0.29933762663E+01 0.33514083817E+01 0.35035584706E+01 0.35078623871E+01
0.34438003969E+01 0.33757276029E+01 0.33478536358E+01 0.33757276029E+01 0.34438003969E+01
perl chg2cube.pl CHGCAR

SELECT INPUT FILE FORMAT 1=CHGCAR or 2=LOCPOT: 1
READING 'chgcar' FILE FORMAT

USING 'bohr' FOR OUTPUT UNITS
ENTER ELEMENT TYPES BY ATOMIC NUMBER: 13

NUMBER OF ELEMENT TYPES DOES NOT MATCH NUMBER OF ATOMIC NUMBERS GIVEN

Please help!
dano
Posts: 39
Joined: Sat Nov 05, 2005 12:04 am
Contact:

Re: script chg2cube.pl

Post by dano »

The top line in vasp4 CHGCAR is an optional comment line, our group by convention uses this line to include element types. However because the cube format uses atomic numbers instead of element names so the script was not written to accommodate anything but a blank comment line or no comment line.

To make the script work simply delete any text in the top line.

I will update the script to handle a comment line and modernize it work with what I expect is a new vasp5 CHGCAR format.
I will post here when the script has been updated

Dan
dano
Posts: 39
Joined: Sat Nov 05, 2005 12:04 am
Contact:

Re: script chg2cube.pl

Post by dano »

chg2cube.pl has been updated to handle vasp5 and the optional comment line. It can be obtained from cvs

Dan
Post Reply