Page 1 of 1
input charge density generation
Posted: Mon May 14, 2018 4:59 pm
by koalad
Hello everyone.
I have a question regarding a non self-consistent calculation in abinit.
I would like to run a non self-consistent calculation using a charge density that I have "manually" generated.
Is there any way that I can "manually" generate a charge density so that the abinit code can read and run the non self-consistent calculation?
How should I make the density file? Do I need generate an unformatted file?
Thanks in advance.
Re: input charge density generation
Posted: Mon May 14, 2018 5:57 pm
by gmatteo
Re: input charge density generation
Posted: Mon May 14, 2018 6:02 pm
by koalad
gmatteo wrote:https://docs.abinit.org/tutorial/base3/
Thanks for your reply.
Maybe my question was unclear.
I wanted to use a "manually" generated charge density instead of SCF generated charge density.
It seems like that the link that you've provided talks about the SCF-generated charge density.
Can you help me with this?
Re: input charge density generation [SOLVED]
Posted: Mon May 14, 2018 6:21 pm
by gmatteo
I wanted to use a "manually" generated charge density instead of SCF generated charge density
The easiest solution is hacking the code in the part that writes the density in real space (rhor) to file.
The density is written by fftdatar_writer at the end of the SCF cycle.
https://github.com/abinit/abinit/blob/6 ... v.F90#L405Run a SCF calculation just to enter that part, fill the rhor((nfft,nspden) array before the call to fftdatar_write.
At this point you have a DEN file with your data and you can start a NSCF calculation that reads this file with getden/irdden
Alternatively, one could write a post-processing tool in Fortran to read a DEN file, replace rhor and write a new file
with the Abinit header and the records containing the new density.
This requires extra coding.
See
https://github.com/abinit/abinit/blob/6 ... _ioarr.F90for the low-level machinery we use to read/write density files.
In this case, one could call the post-processing tool from cut3d.
Re: input charge density generation
Posted: Mon May 14, 2018 10:03 pm
by koalad
Thank you so much for your help. I will try what you've said. Thanks!