Page 1 of 1

Bader with Gaussian cube reference

Posted: Mon Jun 11, 2007 2:21 pm
by maharan
Is there a way to make bader program use a reference charge file specified as gaussian cube file ?

Or is there a free tool to convert my gaussian cube file to vasp format ?

Thank you, Maciek

Posted: Tue Jun 12, 2007 6:40 am
by graeme
The reference file reading is only set up for chgcar file, but there is no good reason for this. With a small change, the code should be able to read cube or chgcar files. If this would help, we'll implement it.

A cube -> chgcar converter would also be nice.

Posted: Tue Jun 12, 2007 1:41 pm
by maharan
I would appreciate it very much if you could implement reading of cube reference!


I am trying to write cube->chgcar converter but I am stuck with debuging. Integrated number of electron is the same whenever I use cube or converted chgcar but the distribution over atoms is different. I tried different units (Bohr/A), loops ordering for grid (z or x first) but I cant locate bug.
Could you point me to very detailed description of CHGCAR format ?
I cant find on the web so my work is revese engineering.

Posted: Fri Jun 15, 2007 5:22 pm
by maharan
I wrote a simple Cube to CHGCAR converter. I tested it on one of my G98 cube files and it seems to work (The output CHGCAR file gives the same results with Bader program).

Please feel free to use and modify it:

http://www.chem.univ.gda.pl/~maharan/cube2chgcar.c

patch for cube format as reference input

Posted: Tue Sep 18, 2007 10:23 am
by jvoss
I've made a patch which allows bader to read cube files as reference densities:
http://dcwww.camd.dtu.dk/~jovo/bader_cuberef.diff
Run
patch -p1 <somepath/bader_cuberef.diff
inside the bader source directory to apply the patch.
Bader will distinguish between cube and chgcar automatically.

Posted: Tue Sep 18, 2007 4:29 pm
by andri
Thanks Johannes, this looks excellent.

Posted: Wed Sep 19, 2007 2:52 am
by graeme
Nice addition Johannes. We've added your cube reference file loading code to the current source and binaries.

Posted: Wed Sep 19, 2007 4:22 am
by maharan
Thank you. Although I used my converter program I think this modification will be useful in the future!