Hi Zhanglei,

I tried to work with the rho2xsf code, but I prefered the denchar ones
because it is possible to set up more variables. However, when I was looking
for XSF informations I found this page:

http://www.xcrysden.org/doc/XSF.html#__toc__13

<http://www.xcrysden.org/doc/XSF.html#__toc__13>Here is the structure of the
XSF grid, which is constructed using the Fortran format, i.e., to access the
grid you must to do:

C-syntax:
  for (k=0; k<nz; k++)
  for (j=0; j<ny; j++)
  for (i=0; i<nx; i++)
  printf("%f",value[i][j][k]);

FORTRAN syntax:
  write(*,*)
  $  (((value(ix,iy,iz),ix=1,nx),iy=1,ny),iz=1,nz)

I hope this can help you.

Good work,

Weslley.


On Fri, Sep 10, 2010 at 10:40 PM, zhanglei <[email protected]> wrote:

>  Hi Weslley,
>
>
>
> Thank you very much for your advice!
>
>
>
> After reading the manual of Denchar, I found that this code is similar with
> rho2xsf. I can also define my own XYZ grid and finally obtain a file, named
> .XSF, with the following format.
>
> However, what exactly is the density value for the position, e.g. (2, 0,
> 0)?
>
>
>
> # systemLabel.XSF
>
> ATOMS
>
>   26          4.88240022         -0.08352631          0.00006140
>
>   26          6.15692301          2.91460609          0.00000436
>
> …
>
>   26          1.84258624          3.60793081         -1.42032133
>
>   26          4.99807464          4.87996835         -1.57094524
>
>   26          6.09310871          7.32127741         -1.45258353
>
>   26          7.95044995          3.67018655         -1.42977940
>
>   26          3.70962202          7.27176411         -1.47336896
>
>    2          3.66994589          3.47611895          0.00087005
>
>    2          4.41715376          2.02051489         -0.00081967
>
> BEGIN_BLOCK_DATAGRID_3D
>
>  DATA_from:FeHesub.DRHO
>
>  BEGIN_DATAGRID_3D_DRHO:spin_1
>
>    106   112    90
>                                                                               
>           #
> my definition for grids
>
>   1.8000000E+00 -1.0000000E-01
> -2.0000000E+00                                 #                        for
> origin
>
>   8.0000000E+00  0.0000000E+00  0.0000000E+00
>    #                        for origin
>
>   0.0000000E+00  8.0000000E+00  0.0000000E+00
>
>   0.0000000E+00  0.0000000E+00  6.0000000E+00
>
>  -1.38841E-03 -1.31591E-03 -1.27415E-03 -1.25845E-03 -1.24830E-03
> -1.22782E-03           # charge for PIN_UP
>
>  -1.20458E-03 -1.17644E-03 -1.13945E-03 -1.10145E-03 -1.07345E-03
> -1.06778E-03
>
>  -1.08766E-03 -1.13587E-03 -1.21489E-03 -1.31853E-03 -1.43500E-03
> -1.56127E-03
>
>  -1.69482E-03 -1.83016E-03 -1.95622E-03 -2.06447E-03 -2.14878E-03
> -2.20475E-03
>
>  -2.22827E-03 -2.20652E-03 -2.12539E-03 -1.98227E-03 -1.75469E-03
> -1.42163E-03
>
>  -9.67779E-04 -3.72732E-04  3.94846E-04  1.36330E-03  2.51582E-03
> 3.83300E-03
>
>   5.24905E-03  6.65572E-03  7.90497E-03  8.81380E-03  9.23699E-03
> 9.10112E-03
>
>   8.42834E-03  7.33264E-03  5.97637E-03  4.52817E-03  3.13710E-03
> 1.88167E-03
>
>   8.06114E-04 -7.24776E-05 -7.47507E-04 -1.26632E-03 -1.65272E-03
> -1.93084E-03
>
>  -2.11756E-03 -2.22112E-03 -2.26403E-03 -2.24870E-03 -2.19120E-03
> -2.10496E-03
>
>  -1.99538E-03 -1.86868E-03 -1.73307E-03 -1.59869E-03 -1.47700E-03
> -1.37597E-03
>
>  -1.28993E-03 -1.23082E-03 -1.18704E-03 -1.15517E-03 -1.11946E-03
> -1.08978E-03
>
>  -1.05914E-03 -1.01949E-03 -9.65953E-04 -8.96622E-04 -8.17461E-04
> -7.38097E-04
>
>  -6.44861E-04 -5.87127E-04 -5.82667E-04 -6.33176E-04 -7.40719E-04
> -9.09593E-04
>
>  -1.12436E-03 -1.36253E-03 -1.59740E-03 -1.80011E-03 -1.92620E-03
> -1.91662E-03
>
>  -1.75328E-03 -1.39584E-03 -7.76065E-04  1.99780E-04  1.66756E-03
> 3.85481E-03
>
>   7.11264E-03  1.19011E-02  1.87853E-02  2.83026E-02  4.07044E-02
> 5.55967E-02
>
>   7.16452E-02  8.65794E-02  9.76430E-02  1.02481E-01 -1.96892E-03
> -1.87333E-03
>
>  -1.78008E-03 -1.67960E-03 -1.54126E-03 -1.36418E-03 -1.16541E-03
> -9.50314E-04
>
>  -7.29789E-04 -5.20021E-04 -3.41712E-04 -2.16724E-04 -1.56353E-04
> -1.67128E-04
>
>  -2.55162E-04 -4.11668E-04 -6.22298E-04 -8.62564E-04 -1.10974E-03
> -1.35241E-03
>
>  -1.57851E-03 -1.77418E-03 -1.92991E-03 -2.04025E-03 -2.10153E-03
> -2.10917E-03
>
>  -2.04315E-03 -1.89085E-03 -1.63939E-03 -1.26519E-03 -7.54049E-04
> -7.42874E-05
>
>   8.07627E-04  1.92640E-03  3.26230E-03  4.79884E-03  6.47601E-03
> 8.16225E-03
>
>   9.66424E-03  1.07630E-02  1.12784E-02  1.11169E-02  1.03061E-02
> 8.98425E-03
>
>   7.35444E-03  5.62942E-03  3.98765E-03  2.52960E-03  1.29317E-03
> 2.80759E-04
>
>  -4.96747E-04 -1.08476E-03 -1.51833E-03 -1.82481E-03 -2.02718E-03
> -2.13098E-03
>
>  -2.15088E-03 -2.09996E-03 -1.99896E-03 -1.85410E-03 -1.67151E-03
> -1.45910E-03
>
>  -1.23033E-03 -1.00228E-03 -7.92862E-04 -6.09925E-04 -4.71887E-04
> -3.99387E-04
>
>  -3.75643E-04 -4.00874E-04 -4.54887E-04 -5.46884E-04 -6.59238E-04
> -7.76363E-04
>
>  -8.86315E-04 -9.82501E-04 -1.06423E-03 -1.13222E-03 -1.16198E-03
> -1.19549E-03
>
>  -1.24500E-03 -1.31885E-03 -1.41988E-03 -1.55406E-03 -1.71279E-03
> -1.88134E-03
>
>  -2.04065E-03 -2.16515E-03 -2.21541E-03 -2.15413E-03 -1.94014E-03
> -1.52900E-03
>
>  -8.52978E-04  1.87195E-04  1.73808E-03  4.05135E-03  7.49216E-03
> 1.25596E-02
>
>   1.98610E-02  2.99696E-02  4.31454E-02  5.89619E-02  7.60048E-02
> 9.18782E-02
>
>   1.03677E-01  1.08877E-01 -2.36784E-03 -2.23082E-03 -2.06479E-03
> -1.86106E-03
>
>  -1.59334E-03 -1.25825E-03 -8.65193E-04 -4.40041E-04 -3.49091E-06
> 4.15233E-04
>
>   7.80971E-04  1.05700E-03  1.21791E-03  1.24918E-03  1.14240E-03
> 9.11142E-04
>
>   5.79221E-04  1.75583E-04 -2.42317E-04 -6.45235E-04 -1.01625E-03
> -1.33831E-03
>
>  -1.59828E-03 -1.78929E-03 -1.90850E-03 -1.95382E-03 -1.91890E-03
> -1.77110E-03
>
> …
>
>
>
>
>
> Thank you very much!
>
>
>
> Best wishes!
>
> Yours sincerely,
>
> Leila
>
>
>
> *发件人:* [email protected] [mailto:[email protected]] *代表 *Weslley
> Souza Patrocinio
> *发送时间:* 2010年9月10日 19:53
> *收件人:* [email protected]
> *主题:* Re: [SIESTA-L] How to read charge density at a given position?
>
>
>
> Hi, Leila.
>
>
>
> You can use the Denchar (one of the Siesta utils) to generate the charge
> density distribution. In the input file of you will define the region in the
> space that you want to calculate the charge density and the number of
> discretization points, so you can build your own XYZ grid and choose the
> points that are important.
>
>
>
> Good luck!
>
> Yours,
>
>
>
> Weslley.
>
>
>
> --
> Weslley Souza Patrocinio
>
> Pesquisador
> Departamento de Nanotecnologia
> Centro de Pesquisas Avançadas Wernher von Braun
>
> e-mail: [email protected]
> skype: weslley.vonbraun
>



-- 
Weslley Souza Patrocinio

Pesquisador
Departamento de Nanotecnologia
Centro de Pesquisas Avançadas Wernher von Braun

e-mail: [email protected]
skype: weslley.vonbraun

Responder a