Page 1 of 1

error with using chgsum.pl

Posted: Sat Dec 29, 2012 1:48 am
by jinshang
Dear all,

I have encountered an error when using "chgsum.pl CHGCAR1 CHGCAR2":

In the output file "CHGCAR_sum", the charges from the two files (i.e. CHGCAR1 and CHGCAR2) are correctly added, but the coordinates part only display the coordinate from "CHGCAR1" but not "CHGCAR2". So I have to manually input coordinate for "CHGCAR2" into "CHGCAR_sum" evry time.

Does anyone has the same problem?

Thank you very much in advance.

Best regards,
Eric

Re: error with using chgsum.pl

Posted: Sat Dec 29, 2012 2:14 am
by graeme
The script has to choose the coordinates of one of the files. It chooses the first.

If you want the coordinates of the second file, you can do chgsum.pl CHGCAR2 CHGCAR1

But we warned that it probably doesn't make sense to add charge density files for structures with different geometries.

Re: error with using chgsum.pl

Posted: Sat Dec 29, 2012 12:55 pm
by jinshang
Dear Graeme,

Thank you very much for your prompt reply!

I am adding charge density files for structures with the same geometries in order to obtain the charge density difference. First, I calculate charge density for a complex "A+B"; then calculate that for "A" by removing "B" and fixing the geometry of "A+B"; then calculate that for "B" by removing "A" and fixing the geometry of "A+B". Second, I use chgsum.pl to add "A"+"B". Finally, I use chgdiff.pl to obtain the difference between "A"+"B" and "A+B".

The problem lies in the second step: there is only coordinates for "A" in the resulting file "A"+"B". Therefore I have to manually add coordinates for "B" into file "A"+"B" in order to do the third step.

I am wondering if there is a method to bypass my manual work?

Thank you very much.

Best regards,
Eric

Re: error with using chgsum.pl

Posted: Sat Dec 29, 2012 2:05 pm
by graeme
Ah, yes, of course, I see what you mean.

It would be easy enough to concatenate all the atomic positions. Perhaps this functionality makes sense as the default for the chgsum.pl script. If I can't think of any reason why we shouldn't, I'll change it.

Re: error with using chgsum.pl

Posted: Sat Dec 29, 2012 2:57 pm
by jinshang
Thank you very much! Could you please let me know if you fix the script to enable this function? My email address is jin.shang916@gmail.com or j.shang@student.unimelb.edu.au