[Pw_forum] real space mesh

Stefano Baroni baroni at sissa.it
Thu Feb 2 10:21:43 CET 2006


The index of arrays used to store functions defined on 3D meshes is  
actually a shorthand for three indeces, following the FORTRAN  
convention ("leftmost index runs faster"). An example will explain  
this better. Suppose you have a 3D array of dimension (nr1,nr2,nr3),  
say psi(nr1,nr2,nr3). FORTRAN compilers store this array sequentially  
in the computer RAM in the following way:
psi(1,1,1)
psi(2,1,1)
...
psi(nr1,1,1)
psi(1,2,1)
psi(2,2,1)
...
psi(nr1,2,1)
...
psi(nr1,nr2,1)
psi(1,1,nr3)
etc

Let "ind" be the position of the (i,j,k) element in the above list:  
the relation between ind and (i,j,k) is:

ind = i + (j-1)*nr1 + (k-1)*nr2*nr1

This should clarify the relation between 1D and 3D indexing. In real  
space, the (i,j,k) point of the mesh is

(i-1)*tau_1 + (j-1)*tau_2 + (k-1)* tau_3

where the tau's are the basis vectors of the Bravais lattice. The  
latter are stored row-wise in the "AT" array:

tau_1 = at(1,*)
tau_2 = at(2,*)
tau_3 = at(3,*)

(or at least so it was the last time I looked into the code ;-)

Hope this helps

Stefano B.



On Feb 2, 2006, at 7:33 AM, Dmitry Korotin wrote:

> Dear pwscf users and authors,
>   how can I get coordinates of points of FFT mesh in Bohr or  
> Angstrom units?
> For example, I have an array psic(nrxxs) (which is FT of
> evc(ik,ibnd)). How can I find point in real space for psic(3) or
> psic(100)?
>
> Thank you in advance,
> Dmitry Korotin.
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://www.democritos.it/mailman/listinfo/pw_forum

---
Stefano Baroni - SISSA  &  DEMOCRITOS National Simulation Center -  
Trieste
[+39] 040 3787 406 (tel) -528 (fax) / stefanobaroni (skype)

Please, if possible, don't  send me MS Word or PowerPoint attachments
Why? See:  http://www.gnu.org/philosophy/no-word-attachments.html



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20060202/ccda04e9/attachment.html>


More information about the users mailing list