input charge density generation  [SOLVED]

Total energy, geometry optimization, DFT+U, spin....

Moderator: bguster

Locked
koalad
Posts: 7
Joined: Mon May 14, 2018 4:51 pm

input charge density generation

Post by koalad » Mon May 14, 2018 4:59 pm

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.
Last edited by koalad on Mon May 14, 2018 6:02 pm, edited 2 times in total.

User avatar
gmatteo
Posts: 291
Joined: Sun Aug 16, 2009 5:40 pm

Re: input charge density generation

Post by gmatteo » Mon May 14, 2018 5:57 pm


koalad
Posts: 7
Joined: Mon May 14, 2018 4:51 pm

Re: input charge density generation

Post by koalad » Mon May 14, 2018 6:02 pm

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?

User avatar
gmatteo
Posts: 291
Joined: Sun Aug 16, 2009 5:40 pm

Re: input charge density generation  [SOLVED]

Post by gmatteo » Mon May 14, 2018 6:21 pm

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#L405

Run 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.F90

for the low-level machinery we use to read/write density files.
In this case, one could call the post-processing tool from cut3d.

koalad
Posts: 7
Joined: Mon May 14, 2018 4:51 pm

Re: input charge density generation

Post by koalad » Mon May 14, 2018 10:03 pm

Thank you so much for your help. I will try what you've said. Thanks!

Locked