[CPMD-list] grid on real space

Juerg Hutter hutter at pci.unizh.ch
Tue Mar 29 17:24:23 CEST 2005


Hi

> Thanks. So in this situation, the inner production of two real space
> functions can not be calculated by add all number form 1 to NNR1
> directly, and it should be something like
> SUM=0.d0
> DO K = 1, NR3
>   DO J = 1, NR2
>      DO I = 1, NR1
>          N = I + (J-1)*KR1+(K-1)*KR1*KR2
>          SUM=SUM+F1(N)*F2(N)
>      END DO
>  END DO
> END DO
>
> right?

This is correct. Two points:
1) If you are sure that F1(N)=0 outside the array
   you can still (maybe) use the one dimensional loop.
   However, this is an ugly trick and should only be used
   is performance is an issue.
2) Be careful with the dimensions (local/global).
   The real space grids are distributed (over x or 1 dimension).
   The global dimensions are KR1S, KR2S, KR3S (and NR1S, NR2S, NR3S).
   The local dimensions are KR1, KR2, etc (infact KR2=KR2S only 1
   differs).
   If you need absolute addressing, you want the x loop to be
   DO IX=NRXPL(icpu,1),NRXPL(icpu,1)
      I=IX-NRXPL(icpu,1)+1
C     IX global address
C     I local address

regards

Juerg Hutter

>
> best wishes,
> zhenyu
>
>
>
> On Mon, 28 Mar 2005 18:01:33 +0200 (MEST), Juerg Hutter
> <hutter at pci.unizh.ch> wrote:
> > Hi
> >
> > KR1, KR2, KR3 are the dimensions of Fortran arrays
> > that are used to keep the real space grid values.
> > The grid size is actually NR1, NR2, NR3.
> > For performance reasons (memory access) it is a good idea
> > to choose KR1 = NR1+1.
> > You can think of KR1 as the leading dimension parameter
> > you can find e.g. in LAPACK.
> >
> > regards
> >
> > Juerg Hutter
> >
> > ----------------------------------------------------------
> > Juerg Hutter                   Phone : ++41 1 635 4491
> > Physical Chemistry Institute   FAX   : ++41 1 635 6838
> > University of Zurich           E-mail: hutter at pci.unizh.ch
> > Winterthurerstrasse 190
> > CH-8057 Zurich, Switzerland
> > ----------------------------------------------------------
> >
> >
> > On Mon, 28 Mar 2005, Zhenyu LI wrote:
> >
> > > Dear all,
> > >
> > > I am a liitle confused on the grid on real space. We found that
> > > MAXFFT=NNR1=KR1*KR2*KR3.
> > > So we expect a grid from 0 to KR1-1, or from 1 to KR1. According to
> > > PBC, in both case f(0)=f(KR1). But the real space wavefunction seems
> > > normalized to 1/Sqrt(NR1*NR2*NR3) instead of 1/Sqrt(KR!*KR2*KR3), and
> > > typically KR1=NR1+1.
> > >
> > > Would anybody please clarify this issue for me, thanks!
> > >
> > > best wishes,
> > > zhenyu
> > > _______________________________________________
> > > CPMD-list mailing list
> > > CPMD-list at cpmd.org
> > > http://cpmd.org/mailman/listinfo/cpmd-list
> > >
> >
> _______________________________________________
> CPMD-list mailing list
> CPMD-list at cpmd.org
> http://cpmd.org/mailman/listinfo/cpmd-list
>



More information about the CPMD-list mailing list