CP2K 2.4 (Revision 12889)
Functions | Variables

ps_wavelet_kernel Namespace Reference

Creates the wavelet kernel for the wavelet based poisson solver. More...

Functions

subroutine, public createKernel (geocode, n01, n02, n03, hx, hy, hz, itype_scf, iproc, nproc, kernel, mpi_group, error)
 Allocate a pointer which corresponds to the zero-padded FFT slice needed for calculating the convolution with the kernel expressed in the interpolating scaling function basis. The kernel pointer is unallocated on input, allocated on output.
subroutine Surfaces_Kernel (n1, n2, n3, m3, nker1, nker2, nker3, h1, h2, h3, itype_scf, karray, iproc, nproc, mpi_group, error)
 Build the kernel of the Poisson operator with surfaces Boundary conditions in an interpolating scaling functions basis. Beware of the fact that the nonperiodic direction is y!
subroutine calculates_green_opt (n, n_scf, itype_scf, intorder, xval, yval, c, mu, hres, g_mu, error)
subroutine calculates_green_opt_muzero (n, n_scf, intorder, xval, yval, c, hres, green, error)
subroutine indices (var_realimag, nelem, intrn, extrn, index)
subroutine Free_Kernel (n01, n02, n03, nfft1, nfft2, nfft3, n1k, n2k, n3k, hgrid, itype_scf, iproc, nproc, karray, mpi_group, error)
 Build the kernel of a gaussian function for interpolating scaling functions. Do the parallel HalFFT of the symmetrized function and stores into memory only 1/8 of the grid divided by the number of processes nproc.
subroutine inserthalf (n1, n3, lot, nfft, i1, zf, zw)
subroutine kernelfft (n1, n2, n3, nd1, nd2, nd3, nk1, nk2, nk3, nproc, iproc, zf, zr, mpi_group, error)
 (Based on suitable modifications of S.Goedecker routines) Calculates the FFT of the distributed kernel
subroutine realcopy (lot, nfft, n2, nk1, nk2, zin, zout)
subroutine switch (nfft, n2, lot, n1, lzt, zt, zw)
subroutine mpiswitch (j3, nfft, Jp2st, J2st, lot, n1, nd2, nd3, nproc, zmpi1, zw)
subroutine gequad (nterms, p, w, urange, drange, acc)

Variables

CHARACTER(len=*), parameter,
private 
moduleN = 'ps_wavelet_kernel'

Detailed Description

Creates the wavelet kernel for the wavelet based poisson solver.

Author:
Florian Schiffmann (09.2007,fschiff)

Function Documentation

subroutine ps_wavelet_kernel::calculates_green_opt ( INTEGER,intent(in)  n,
INTEGER,intent(in)  n_scf,
INTEGER,intent(in)  itype_scf,
INTEGER,intent(in)  intorder,
REAL(KIND=dp),dimension(0:n_scf),intent(in)  xval,
REAL(KIND=dp),dimension(0:n_scf),intent(in)  yval,
REAL(KIND=dp),dimension(intorder+1),intent(in)  c,
REAL(KIND=dp),intent(in)  mu,
REAL(KIND=dp),intent(in)  hres,
REAL(KIND=dp),dimension(n),intent(out)  g_mu,
TYPE(cp_error_type),intent(inout)  error 
) [private]

Definition at line 566 of file ps_wavelet_kernel.f90.

References CPPostcondition.

Referenced by Surfaces_Kernel().

Here is the caller graph for this function:

subroutine ps_wavelet_kernel::calculates_green_opt_muzero ( INTEGER,intent(in)  n,
INTEGER,intent(in)  n_scf,
INTEGER,intent(in)  intorder,
REAL(KIND=dp),dimension(0:n_scf),intent(in)  xval,
REAL(KIND=dp),dimension(0:n_scf),intent(in)  yval,
REAL(KIND=dp),dimension(intorder+1),intent(in)  c,
REAL(KIND=dp),intent(in)  hres,
REAL(KIND=dp),dimension(n),intent(out)  green,
TYPE(cp_error_type),intent(inout)  error 
) [private]

Definition at line 709 of file ps_wavelet_kernel.f90.

Referenced by Surfaces_Kernel().

Here is the caller graph for this function:

subroutine,public ps_wavelet_kernel::createKernel ( CHARACTER(len=1),intent(in)  geocode,
INTEGER,intent(in)  n01,
INTEGER,intent(in)  n02,
INTEGER,intent(in)  n03,
REAL(KIND=dp),intent(in)  hx,
REAL(KIND=dp),intent(in)  hy,
REAL(KIND=dp),intent(in)  hz,
INTEGER,intent(in)  itype_scf,
INTEGER,intent(in)  iproc,
INTEGER,intent(in)  nproc,
REAL(KIND=dp),dimension(:),pointer  kernel,
INTEGER,intent(in)  mpi_group,
TYPE(cp_error_type),intent(inout)  error 
)

Allocate a pointer which corresponds to the zero-padded FFT slice needed for calculating the convolution with the kernel expressed in the interpolating scaling function basis. The kernel pointer is unallocated on input, allocated on output.

Parameters:
geocodeIndicates the boundary conditions (BC) of the problem: 'F' free BC, isolated systems. The program calculates the solution as if the given density is "alone" in R^3 space. 'S' surface BC, isolated in y direction, periodic in xz plane The given density is supposed to be periodic in the xz plane, so the dimensions in these direction mus be compatible with the FFT Beware of the fact that the isolated direction is y! 'P' periodic BC. The density is supposed to be periodic in all the three directions, then all the dimensions must be compatible with the FFT. No need for setting up the kernel.
iproc,nproc,:number of process, number of processes
n01,n02,n03; dimensions of the real space grid to be hit with the Poisson Solver
itype_scforder of the interpolating scaling functions used in the decomposition
hx,hy,hz,:grid spacings. For the isolated BC case for the moment they are supposed to be equal in the three directions
kernelpointer for the kernel FFT. Unallocated on input, allocated on output. Its dimensions are equivalent to the region of the FFT space for which the kernel is injective. This will divide by two each direction, since the kernel for the zero-padded convolution is real and symmetric.
Warning:
Due to the fact that the kernel dimensions are unknown before the calling, the kernel must be declared as pointer in input of this routine. To avoid that, one can properly define the kernel dimensions by adding the nd1,nd2,nd3 arguments to the PS_dim4allocation routine, then eliminating the pointer declaration.
Author:
Luigi Genovese
Date:
February 2007

Definition at line 69 of file ps_wavelet_kernel.f90.

References CPPostcondition, ps_wavelet_util::F_FFT_dimensions(), Free_Kernel(), and Surfaces_Kernel().

Referenced by ps_wavelet_types::RS_z_slice_distribution().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine ps_wavelet_kernel::Free_Kernel ( INTEGER,intent(in)  n01,
INTEGER,intent(in)  n02,
INTEGER,intent(in)  n03,
INTEGER,intent(in)  nfft1,
INTEGER,intent(in)  nfft2,
INTEGER,intent(in)  nfft3,
INTEGER,intent(in)  n1k,
INTEGER,intent(in)  n2k,
INTEGER,intent(in)  n3k,
REAL(KIND=dp),intent(in)  hgrid,
INTEGER,intent(in)  itype_scf,
INTEGER,intent(in)  iproc,
INTEGER,intent(in)  nproc,
REAL(KIND=dp),dimension(n1k, n2k, n3k/nproc),intent(out)  karray,
INTEGER,intent(in)  mpi_group,
TYPE(cp_error_type),intent(inout)  error 
) [private]

Build the kernel of a gaussian function for interpolating scaling functions. Do the parallel HalFFT of the symmetrized function and stores into memory only 1/8 of the grid divided by the number of processes nproc.

Build the kernel (karray) of a gaussian function for interpolating scaling functions $$ K(j) = (x) g_k(x'-x) (x'- j) dx dx' $$

Parameters:
n01,n02,n03 : Mesh dimensions of the density
nfft1,nfft2,nfft3 : Dimensions of the FFT grid (HalFFT in the third direction)
n1k,n2k,n3k : Dimensions of the kernel FFT
hgridMesh step
itype_scfOrder of the scaling function (8,14,16)
Author:
T. Deutsch, L. Genovese
Date:
February 2006

Definition at line 840 of file ps_wavelet_kernel.f90.

References CPPostcondition, error, gequad(), kernelfft(), and ps_wavelet_scaling_function::scaling_function().

Referenced by createKernel().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine ps_wavelet_kernel::gequad ( INTEGER  nterms,
REAL(KIND=dp),dimension(*)  p,
REAL(KIND=dp),dimension(*)  w,
REAL(KIND=dp)  urange,
REAL(KIND=dp)  drange,
REAL(KIND=dp)  acc 
) [private]

Definition at line 1408 of file ps_wavelet_kernel.f90.

Referenced by Free_Kernel().

Here is the caller graph for this function:

subroutine ps_wavelet_kernel::indices ( INTEGER,intent(out)  var_realimag,
INTEGER,intent(in)  nelem,
INTEGER,intent(in)  intrn,
INTEGER,intent(in)  extrn,
INTEGER,intent(out)  index 
) [private]

Definition at line 800 of file ps_wavelet_kernel.f90.

Referenced by Surfaces_Kernel().

Here is the caller graph for this function:

subroutine ps_wavelet_kernel::inserthalf ( INTEGER,intent(in)  n1,
INTEGER,intent(in)  n3,
INTEGER,intent(in)  lot,
INTEGER,intent(in)  nfft,
INTEGER,intent(in)  i1,
REAL(KIND=dp),dimension(n1/2+1, n3/2+1),intent(in)  zf,
REAL(KIND=dp),dimension(2, lot, n3/2),intent(out)  zw 
) [private]

Definition at line 1040 of file ps_wavelet_kernel.f90.

Referenced by kernelfft().

Here is the caller graph for this function:

subroutine ps_wavelet_kernel::kernelfft ( INTEGER,intent(in)  n1,
INTEGER,intent(in)  n2,
INTEGER,intent(in)  n3,
INTEGER,intent(in)  nd1,
INTEGER,intent(in)  nd2,
INTEGER,intent(in)  nd3,
INTEGER,intent(in)  nk1,
INTEGER,intent(in)  nk2,
INTEGER,intent(in)  nk3,
INTEGER,intent(in)  nproc,
INTEGER,intent(in)  iproc,
REAL(KIND=dp),dimension(n1/2+1, n3/2+1, nd2/nproc),intent(in)  zf,
REAL(KIND=dp),dimension(nk1, nk2, nk3/nproc),intent(inout)  zr,
INTEGER,intent(in)  mpi_group,
TYPE(cp_error_type),intent(inout)  error 
) [private]

(Based on suitable modifications of S.Goedecker routines) Calculates the FFT of the distributed kernel

Restrictions
Copyright (C) Stefan Goedecker, Cornell University, Ithaca, USA, 1994 Copyright (C) Stefan Goedecker, MPI Stuttgart, Germany, 1999 Copyright (C) 2002 Stefan Goedecker, CEA Grenoble This file is distributed under the terms of the GNU General Public License, see http://www.gnu.org/copyleft/gpl.txt .
Parameters:
zfReal kernel (input) zf(i1,i2,i3)
zrDistributed Kernel FFT zr(2,i1,i2,i3)
nprocnumber of processors used as returned by MPI_COMM_SIZE
iproc[0:nproc-1] number of processor as returned by MPI_COMM_RANK
n1,n2,n3: logical dimension of the transform. As transform lengths most products of the prime factors 2,3,5 are allowed. The detailed table with allowed transform lengths can be found in subroutine CTRIG
nd1,nd2,nd3: Dimensions of work arrays
Author:
S. Goedecker, L. Genovese
Date:
February 2006

Definition at line 1087 of file ps_wavelet_kernel.f90.

References CPPostcondition, ctrig(), fftstp(), inserthalf(), mpiswitch(), realcopy(), ps_wavelet_base::scramble_unpack(), and switch().

Referenced by Free_Kernel().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine ps_wavelet_kernel::mpiswitch ( INTEGER  j3,
INTEGER  nfft,
INTEGER  Jp2st,
INTEGER  J2st,
INTEGER  lot,
INTEGER  n1,
INTEGER  nd2,
INTEGER  nd3,
INTEGER  nproc,
REAL(KIND=dp),dimension(2,n1,nd2/nproc,nd3/nproc,nproc)  zmpi1,
REAL(KIND=dp),dimension(2,lot,n1)  zw 
) [private]

Definition at line 1382 of file ps_wavelet_kernel.f90.

Referenced by kernelfft().

Here is the caller graph for this function:

subroutine ps_wavelet_kernel::realcopy ( INTEGER,intent(in)  lot,
INTEGER,intent(in)  nfft,
INTEGER,intent(in)  n2,
INTEGER,intent(in)  nk1,
INTEGER,intent(in)  nk2,
REAL(KIND=dp),dimension(2, lot, n2),intent(in)  zin,
REAL(KIND=dp),dimension(nk1, nk2),intent(inout)  zout 
) [private]

Definition at line 1348 of file ps_wavelet_kernel.f90.

Referenced by kernelfft().

Here is the caller graph for this function:

subroutine ps_wavelet_kernel::Surfaces_Kernel ( INTEGER,intent(in)  n1,
INTEGER,intent(in)  n2,
INTEGER,intent(in)  n3,
INTEGER,intent(in)  m3,
INTEGER,intent(in)  nker1,
INTEGER,intent(in)  nker2,
INTEGER,intent(in)  nker3,
REAL(KIND=dp),intent(in)  h1,
REAL(KIND=dp),intent(in)  h2,
REAL(KIND=dp),intent(in)  h3,
INTEGER,intent(in)  itype_scf,
REAL(KIND=dp),dimension(nker1, nker2, nker3/nproc),intent(out)  karray,
INTEGER,intent(in)  iproc,
INTEGER,intent(in)  nproc,
INTEGER,intent(in)  mpi_group,
TYPE(cp_error_type),intent(inout)  error 
) [private]

Build the kernel of the Poisson operator with surfaces Boundary conditions in an interpolating scaling functions basis. Beware of the fact that the nonperiodic direction is y!

Parameters:
n1,n2,n3 : Dimensions for the FFT
m3 : Actual dimension in non-periodic direction
nker1,nker2,nker3: Dimensions of the kernel (nker3=n3/2+1) nker(1,2)=n(1,2)/2+1
h1,h2,h3 : Mesh steps in the three dimensions
itype_scfOrder of the scaling function
iproc,nproc: Number of process, number of processes
karrayoutput array
Author:
L. Genovese
Date:
October 2006

Definition at line 212 of file ps_wavelet_kernel.f90.

References calculates_green_opt(), calculates_green_opt_muzero(), CPPostcondition, ctrig(), error, fftstp(), indices(), and ps_wavelet_scaling_function::scaling_function().

Referenced by createKernel().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine ps_wavelet_kernel::switch ( INTEGER  nfft,
INTEGER  n2,
INTEGER  lot,
INTEGER  n1,
INTEGER  lzt,
REAL(KIND=dp),dimension(2,lzt,n1)  zt,
REAL(KIND=dp),dimension(2,lot,n2)  zw 
) [private]

Definition at line 1366 of file ps_wavelet_kernel.f90.

Referenced by kernelfft().

Here is the caller graph for this function:


Variable Documentation

CHARACTER(len=*),parameter,private ps_wavelet_kernel::moduleN = 'ps_wavelet_kernel'

Definition at line 28 of file ps_wavelet_kernel.f90.