(git:9111030)
Loading...
Searching...
No Matches
ps_wavelet_util.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Performs a wavelet based solution of the Poisson equation.
10!> \author Florian Schiffmann (09.2007,fschiff)
11! **************************************************************************************************
13
14 USE kinds, ONLY: dp
15 USE mathconstants, ONLY: fourpi
21#include "../base/base_uses.f90"
22
23 IMPLICIT NONE
24
25 PRIVATE
26
27 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ps_wavelet_util'
28
29 ! *** Public data types ***
30
31 PUBLIC :: psolver, &
35
36CONTAINS
37
38! **************************************************************************************************
39!> \brief Calculate the Poisson equation $\nabla^2 V(x,y,z)=-4 \pi \rho(x,y,z)$
40!> from a given $\rho$, for different boundary conditions an for different data distributions.
41!> Following the boundary conditions, it applies the Poisson Kernel previously calculated.
42!> \param geocode Indicates the boundary conditions (BC) of the problem:
43!> 'F' free BC, isolated systems.
44!> The program calculates the solution as if the given density is
45!> "alone" in R^3 space.
46!> 'S' surface BC, isolated in y direction, periodic in xz plane
47!> The given density is supposed to be periodic in the xz plane,
48!> so the dimensions in these direction mus be compatible with the FFT
49!> Beware of the fact that the isolated direction is y!
50!> 'P' periodic BC.
51!> The density is supposed to be periodic in all the three directions,
52!> then all the dimensions must be compatible with the FFT.
53!> No need for setting up the kernel.
54!> \param iproc label of the process,from 0 to nproc-1
55!> \param nproc number of processors
56!> \param n01 global dimension in the three directions.
57!> \param n02 global dimension in the three directions.
58!> \param n03 global dimension in the three directions.
59!> \param hx grid spacings. For the isolated BC case for the moment they are supposed to
60!> be equal in the three directions
61!> \param hy grid spacings. For the isolated BC case for the moment they are supposed to
62!> be equal in the three directions
63!> \param hz grid spacings. For the isolated BC case for the moment they are supposed to
64!> be equal in the three directions
65!> \param rhopot main input/output array.
66!> On input, it represents the density values on the grid points
67!> On output, it is the Hartree potential, namely the solution of the Poisson
68!> equation PLUS (when ixc/=0) the XC potential PLUS (again for ixc/=0) the
69!> pot_ion array. The output is non overlapping, in the sense that it does not
70!> consider the points that are related to gradient and WB calculation
71!> \param karray kernel of the poisson equation. It is provided in distributed case, with
72!> dimensions that are related to the output of the PS_dim4allocation routine
73!> it MUST be created by following the same geocode as the Poisson Solver.
74!> \param pw_grid ...
75!> \date February 2007
76!> \author Luigi Genovese
77!> \note The dimensions of the arrays must be compatible with geocode, nproc,
78!> ixc and iproc. Since the arguments of these routines are indicated with the *, it
79!> is IMPERATIVE to use the PS_dim4allocation routine for calculation arrays sizes.
80! **************************************************************************************************
81 SUBROUTINE psolver(geocode, iproc, nproc, n01, n02, n03, hx, hy, hz, &
82 rhopot, karray, pw_grid)
83 CHARACTER(len=1), INTENT(in) :: geocode
84 INTEGER, INTENT(in) :: iproc, nproc, n01, n02, n03
85 REAL(kind=dp), INTENT(in) :: hx, hy, hz
86 REAL(kind=dp), DIMENSION(*), INTENT(inout) :: rhopot
87 REAL(kind=dp), DIMENSION(*), INTENT(in) :: karray
88 TYPE(pw_grid_type), POINTER :: pw_grid
89
90 INTEGER :: i1, i2, i3, iend, istart, j2, m1, m2, &
91 m3, md1, md2, md3, n1, n2, n3, nd1, &
92 nd2, nd3, nlim, nwb, nwbl, nwbr, nxc, &
93 nxcl, nxcr, nxt
94 REAL(kind=dp) :: factor, hgrid, red_fact, scal
95 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: zf
96
97!the order of the finite-difference gradient (fixed)
98!calculate the dimensions wrt the geocode
99
100 IF (geocode == 'P') THEN
101 CALL p_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
102 ELSE IF (geocode == 'S') THEN
103 CALL s_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
104 ELSE IF (geocode == 'F') THEN
105 CALL f_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
106 ELSE
107 cpabort("PSolver: geometry code not admitted")
108 END IF
109 !array allocations
110 ALLOCATE (zf(md1, md3, md2/nproc))
111
112 ! CALL timing(iproc,'Exchangecorr ','ON')
113 !dimension for exchange-correlation (different in the global or distributed case)
114 !let us calculate the dimension of the portion of the rhopot array to be passed
115 !to the xc routine
116 !this portion will depend on the need of calculating the gradient or not,
117 !and whether the White-Bird correction must be inserted or not
118 !(absent only in the LB ixc=13 case)
119
120 !nxc is the effective part of the third dimension that is being processed
121 !nxt is the dimension of the part of rhopot that must be passed to the gradient routine
122 !nwb is the dimension of the part of rhopot in the wb-postprocessing routine
123 !note: nxc <= nwb <= nxt
124 !the dimension are related by the values of nwbl and nwbr
125 ! nxc+nxcl+nxcr-2 = nwb
126 ! nwb+nwbl+nwbr = nxt
127 istart = iproc*(md2/nproc)
128 iend = min((iproc + 1)*md2/nproc, m2)
129
130 nxc = iend - istart
131 nwbl = 0
132 nwbr = 0
133 nxcl = 1
134 nxcr = 1
135
136 nwb = nxcl + nxc + nxcr - 2
137 nxt = nwbr + nwb + nwbl
138
139 !calculate the actual limit of the array for the zero padded FFT
140 IF (geocode == 'P') THEN
141 nlim = n2
142 ELSE IF (geocode == 'S') THEN
143 nlim = n2
144 ELSE IF (geocode == 'F') THEN
145 nlim = n2/2
146 END IF
147
148 !!$ print *,'density must go from',min(istart+1,m2),'to',iend,'with n2/2=',n2/2
149 !!$ print *,' it goes from',i3start+nwbl+nxcl-1,'to',i3start+nxc-1
150
151 IF (istart + 1 <= m2) THEN
152 red_fact = 1._dp
153 CALL scale_and_distribute(m1, m3, md1, md2, md3, nxc, rhopot, zf, nproc, red_fact)
154 ELSE IF (istart + 1 <= nlim) THEN !this condition assures that we have perform good zero padding
155 DO i2 = istart + 1, min(nlim, istart + md2/nproc)
156 j2 = i2 - istart
157 DO i3 = 1, md3
158 DO i1 = 1, md1
159 zf(i1, i3, j2) = 0._dp
160 END DO
161 END DO
162 END DO
163 END IF
164
165 !this routine builds the values for each process of the potential (zf), multiplying by scal
166 IF (geocode == 'P') THEN
167 !no powers of hgrid because they are incorporated in the plane wave treatment
168 scal = 1._dp/real(n1*n2*n3, kind=dp)
169 CALL p_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, zf, &
170 scal, hx, hy, hz, pw_grid%para%group)
171 ELSE IF (geocode == 'S') THEN
172 !only one power of hgrid
173 scal = hy/real(n1*n2*n3, kind=dp)
174 CALL s_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, karray, zf, &
175 scal, pw_grid%para%group)
176 ELSE IF (geocode == 'F') THEN
177 hgrid = max(hx, hy, hz)
178 scal = hgrid**3/real(n1*n2*n3, kind=dp)
179 CALL f_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, karray, zf, &
180 scal, pw_grid%para%group)
181 factor = 0.5_dp*hgrid**3
182 END IF
183
184 ! call timing(iproc,'PSolv_comput ','ON')
185
186 !the value of the shift depends on the distributed i/o or not
187 IF (geocode == 'F') THEN
188 red_fact = 1._dp
189 ELSE
190 red_fact = -fourpi
191 END IF
192
193 CALL scale_and_distribute(m1, m3, md1, md2, md3, nxc, zf, rhopot, nproc, red_fact)
194
195 DEALLOCATE (zf)
196
197 END SUBROUTINE psolver
198
199! **************************************************************************************************
200!> \brief Calculate four sets of dimension needed for the calculation of the
201!> convolution for the periodic system
202!> \param n01 original real dimensions (input)
203!> \param n02 original real dimensions (input)
204!> \param n03 original real dimensions (input)
205!> \param m1 original real dimension, with m2 and m3 exchanged
206!> \param m2 original real dimension, with m2 and m3 exchanged
207!> \param m3 original real dimension, with m2 and m3 exchanged
208!> \param n1 the first FFT dimensions, for the moment supposed to be even
209!> \param n2 the first FFT dimensions, for the moment supposed to be even
210!> \param n3 the first FFT dimensions, for the moment supposed to be even
211!> \param md1 the n1,n2,n3 dimensions. They contain the real unpadded space,
212!> properly enlarged to be compatible with the FFT dimensions n_i.
213!> md2 is further enlarged to be a multiple of nproc
214!> \param md2 the n1,n2,n3 dimensions. They contain the real unpadded space,
215!> properly enlarged to be compatible with the FFT dimensions n_i.
216!> md2 is further enlarged to be a multiple of nproc
217!> \param md3 the n1,n2,n3 dimensions. They contain the real unpadded space,
218!> properly enlarged to be compatible with the FFT dimensions n_i.
219!> md2 is further enlarged to be a multiple of nproc
220!> \param nd1 fourier dimensions for which the kernel is injective,
221!> formally 1/8 of the fourier grid. Here the dimension nd3 is
222!> enlarged to be a multiple of nproc
223!> \param nd2 fourier dimensions for which the kernel is injective,
224!> formally 1/8 of the fourier grid. Here the dimension nd3 is
225!> enlarged to be a multiple of nproc
226!> \param nd3 fourier dimensions for which the kernel is injective,
227!> formally 1/8 of the fourier grid. Here the dimension nd3 is
228!> enlarged to be a multiple of nproc
229!> \param nproc ...
230!> \date October 2006
231!> \author Luigi Genovese
232!> \note This four sets of dimensions are actually redundant (mi=n0i),
233!> due to the backward-compatibility
234!> with the other geometries of the Poisson Solver.
235!> The dimensions 2 and 3 are exchanged.
236! **************************************************************************************************
237 SUBROUTINE p_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
238 INTEGER, INTENT(in) :: n01, n02, n03
239 INTEGER, INTENT(out) :: m1, m2, m3, n1, n2, n3, md1, md2, md3, &
240 nd1, nd2, nd3
241 INTEGER, INTENT(in) :: nproc
242
243 CHARACTER(len=80) :: err
244 INTEGER :: l1, l2, l3
245
246!dimensions of the density in the real space
247
248 m1 = n01
249 m2 = n03
250 m3 = n02
251
252 ! real space grid dimension (suitable for number of processors)
253 l1 = m1
254 l2 = m2
255 l3 = m3 !beware of the half dimension
256 CALL fourier_dim(l1, n1)
257 IF (n1 == m1) THEN
258 ELSE
259 WRITE (err, *) 'the FFT in the x direction is not allowed; n01 dimension ', n01
260 cpabort(trim(err))
261 END IF
262 l1 = l1 + 1
263 CALL fourier_dim(l2, n2)
264 IF (n2 == m2) THEN
265 ELSE
266 WRITE (err, *) 'the FFT in the z direction is not allowed; n03 dimension ', n03
267 cpabort(trim(err))
268 END IF
269 CALL fourier_dim(l3, n3)
270 IF (n3 == m3) THEN
271 ELSE
272 WRITE (err, *) 'the FFT in the y direction is not allowed; n02 dimension ', n02
273 cpabort(trim(err))
274 END IF
275
276 !dimensions that contain the unpadded real space,
277 ! compatible with the number of processes
278 md1 = n1
279 md2 = n2
280 md3 = n3
281 DO WHILE (nproc*(md2/nproc) < n2)
282 md2 = md2 + 1
283 END DO
284
285 !dimensions of the kernel, 1/8 of the total volume,
286 !compatible with nproc
287 nd1 = n1/2 + 1
288 nd2 = n2/2 + 1
289 nd3 = n3/2 + 1
290 DO WHILE (modulo(nd3, nproc) /= 0)
291 nd3 = nd3 + 1
292 END DO
293
294 END SUBROUTINE p_fft_dimensions
295
296! **************************************************************************************************
297!> \brief Calculate four sets of dimension needed for the calculation of the
298!> convolution for the surface system
299!> \param n01 original real dimensions (input)
300!> \param n02 original real dimensions (input)
301!> \param n03 original real dimensions (input)
302!> \param m1 original real dimension, with 2 and 3 exchanged
303!> \param m2 original real dimension, with 2 and 3 exchanged
304!> \param m3 original real dimension, with 2 and 3 exchanged
305!> \param n1 the first FFT dimensions, for the moment supposed to be even
306!> \param n2 the first FFT dimensions, for the moment supposed to be even
307!> \param n3 the double of the first FFT even dimension greater than m3
308!> (improved for the HalFFT procedure)
309!> \param md1 the n1,n2 dimensions.
310!> \param md2 the n1,n2,n3 dimensions.
311!> \param md3 the half of n3 dimension. They contain the real unpadded space,
312!> properly enlarged to be compatible with the FFT dimensions n_i.
313!> md2 is further enlarged to be a multiple of nproc
314!> \param nd1 fourier dimensions for which the kernel is injective,
315!> formally 1/8 of the fourier grid. Here the dimension nd3 is
316!> enlarged to be a multiple of nproc
317!> \param nd2 fourier dimensions for which the kernel is injective,
318!> formally 1/8 of the fourier grid. Here the dimension nd3 is
319!> enlarged to be a multiple of nproc
320!> \param nd3 fourier dimensions for which the kernel is injective,
321!> formally 1/8 of the fourier grid. Here the dimension nd3 is
322!> enlarged to be a multiple of nproc
323!> \param nproc ...
324!> \date October 2006
325!> \author Luigi Genovese
326!> \note This four sets of dimensions are actually redundant (mi=n0i),
327!> due to the backward-compatibility
328!> with the Poisson Solver with other geometries.
329!> Dimensions n02 and n03 were exchanged
330! **************************************************************************************************
331 SUBROUTINE s_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
332 INTEGER, INTENT(in) :: n01, n02, n03
333 INTEGER, INTENT(out) :: m1, m2, m3, n1, n2, n3, md1, md2, md3, &
334 nd1, nd2, nd3
335 INTEGER, INTENT(in) :: nproc
336
337 CHARACTER(len=*), PARAMETER :: routinen = 'S_FFT_dimensions'
338
339 CHARACTER(len=80) :: err
340 INTEGER :: handle, l1, l2, l3
341
342!dimensions of the density in the real space
343
344 CALL timeset(routinen, handle)
345 m1 = n01
346 m2 = n03
347 m3 = n02
348
349 ! real space grid dimension (suitable for number of processors)
350 l1 = m1
351 l2 = m2
352 l3 = m3 !beware of the half dimension
353 CALL fourier_dim(l1, n1)
354 IF (n1 == m1) THEN
355 ELSE
356 WRITE (err, *) 'the FFT in the x direction is not allowed; n01 dimension', n01
357 cpabort(trim(err))
358 END IF
359 l1 = l1 + 1
360 CALL fourier_dim(l2, n2)
361 IF (n2 == m2) THEN
362 ELSE
363 WRITE (err, *) 'the FFT in the z direction is not allowed; n03 dimension', n03
364 cpabort(trim(err))
365 END IF
366 DO
367 CALL fourier_dim(l3, n3)
368 IF (modulo(n3, 2) == 0) THEN
369 EXIT
370 END IF
371 l3 = l3 + 1
372 END DO
373 n3 = 2*n3
374
375 !dimensions that contain the unpadded real space,
376 ! compatible with the number of processes
377 md1 = n1
378 md2 = n2
379 md3 = n3/2
380 DO WHILE (nproc*(md2/nproc) < n2)
381 md2 = md2 + 1
382 END DO
383
384 !dimensions of the kernel, 1/8 of the total volume,
385 !compatible with nproc
386
387 !these two dimensions are like that since they are even
388 nd1 = n1/2 + 1
389 nd2 = n2/2 + 1
390
391 nd3 = n3/2 + 1
392 DO WHILE (modulo(nd3, nproc) /= 0)
393 nd3 = nd3 + 1
394 END DO
395 CALL timestop(handle)
396
397 END SUBROUTINE s_fft_dimensions
398
399! **************************************************************************************************
400!> \brief Calculate four sets of dimension needed for the calculation of the
401!> zero-padded convolution
402!> \param n01 original real dimensions (input)
403!> \param n02 original real dimensions (input)
404!> \param n03 original real dimensions (input)
405!> \param m1 original real dimension with the dimension 2 and 3 exchanged
406!> \param m2 original real dimension with the dimension 2 and 3 exchanged
407!> \param m3 original real dimension with the dimension 2 and 3 exchanged
408!> \param n1 ...
409!> \param n2 ...
410!> \param n3 the double of the first FFT even dimension greater than m3
411!> (improved for the HalFFT procedure)
412!> \param md1 half of n1,n2,n3 dimension. They contain the real unpadded space,
413!> properly enlarged to be compatible with the FFT dimensions n_i.
414!> md2 is further enlarged to be a multiple of nproc
415!> \param md2 half of n1,n2,n3 dimension. They contain the real unpadded space,
416!> properly enlarged to be compatible with the FFT dimensions n_i.
417!> md2 is further enlarged to be a multiple of nproc
418!> \param md3 half of n1,n2,n3 dimension. They contain the real unpadded space,
419!> properly enlarged to be compatible with the FFT dimensions n_i.
420!> md2 is further enlarged to be a multiple of nproc
421!> \param nd1 fourier dimensions for which the kernel FFT is injective,
422!> formally 1/8 of the fourier grid. Here the dimension nd3 is
423!> enlarged to be a multiple of nproc
424!> \param nd2 fourier dimensions for which the kernel FFT is injective,
425!> formally 1/8 of the fourier grid. Here the dimension nd3 is
426!> enlarged to be a multiple of nproc
427!> \param nd3 fourier dimensions for which the kernel FFT is injective,
428!> formally 1/8 of the fourier grid. Here the dimension nd3 is
429!> enlarged to be a multiple of nproc
430!> \param nproc ...
431!> \date February 2006
432!> \author Luigi Genovese
433!> \note The dimension m2 and m3 correspond to n03 and n02 respectively
434!> this is needed since the convolution routine manage arrays of dimension
435!> (md1,md3,md2/nproc)
436! **************************************************************************************************
437 SUBROUTINE f_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
438 INTEGER, INTENT(in) :: n01, n02, n03
439 INTEGER, INTENT(out) :: m1, m2, m3, n1, n2, n3, md1, md2, md3, &
440 nd1, nd2, nd3
441 INTEGER, INTENT(in) :: nproc
442
443 INTEGER :: l1, l2, l3
444
445!dimensions of the density in the real space, inverted for convenience
446
447 m1 = n01
448 m2 = n03
449 m3 = n02
450 ! real space grid dimension (suitable for number of processors)
451 l1 = 2*m1
452 l2 = 2*m2
453 l3 = m3 !beware of the half dimension
454 DO
455 CALL fourier_dim(l1, n1)
456 IF (modulo(n1, 2) == 0) THEN
457 EXIT
458 END IF
459 l1 = l1 + 1
460 END DO
461 DO
462 CALL fourier_dim(l2, n2)
463 IF (modulo(n2, 2) == 0) THEN
464 EXIT
465 END IF
466 l2 = l2 + 1
467 END DO
468 DO
469 CALL fourier_dim(l3, n3)
470 IF (modulo(n3, 2) == 0) THEN
471 EXIT
472 END IF
473 l3 = l3 + 1
474 END DO
475 n3 = 2*n3
476
477 !dimensions that contain the unpadded real space,
478 ! compatible with the number of processes
479 md1 = n1/2
480 md2 = n2/2
481 md3 = n3/2
482 DO WHILE (nproc*(md2/nproc) < n2/2)
483 md2 = md2 + 1
484 END DO
485
486 !dimensions of the kernel, 1/8 of the total volume,
487 !compatible with nproc
488 nd1 = n1/2 + 1
489 nd2 = n2/2 + 1
490 nd3 = n3/2 + 1
491
492 DO WHILE (modulo(nd3, nproc) /= 0)
493 nd3 = nd3 + 1
494 END DO
495
496 END SUBROUTINE f_fft_dimensions
497
498! **************************************************************************************************
499!> \brief ...
500!> \param m1 ...
501!> \param m3 ...
502!> \param md1 ...
503!> \param md2 ...
504!> \param md3 ...
505!> \param nxc ...
506!> \param rhopot ...
507!> \param zf ...
508!> \param nproc ...
509!> \param factor ...
510! **************************************************************************************************
511 SUBROUTINE scale_and_distribute(m1, m3, md1, md2, md3, nxc, &
512 rhopot, zf, nproc, factor)
513
514 !Arguments----------------------
515 INTEGER, INTENT(in) :: m1, m3, md1, md2, md3, nxc, nproc
516 REAL(kind=dp), DIMENSION(md1, md3, md2/nproc), &
517 INTENT(inout) :: zf, rhopot
518 REAL(kind=dp), INTENT(in) :: factor
519
520 CHARACTER(len=*), PARAMETER :: routinen = 'scale_and_distribute'
521
522 INTEGER :: handle, j1, j3, jp2
523
524 CALL timeset(routinen, handle)
525
526 IF (nxc >= 1) THEN
527 DO jp2 = 1, nxc
528 DO j3 = 1, m3
529 DO j1 = 1, m1
530 zf(j1, j3, jp2) = factor*rhopot(j1, j3, jp2)
531 END DO
532 DO j1 = m1 + 1, md1
533 zf(j1, j3, jp2) = 0._dp
534 END DO
535 END DO
536 DO j3 = m3 + 1, md3
537 DO j1 = 1, md1
538 zf(j1, j3, jp2) = 0._dp
539 END DO
540 END DO
541 END DO
542 DO jp2 = nxc + 1, md2/nproc
543 DO j3 = 1, md3
544 DO j1 = 1, md1
545 zf(j1, j3, jp2) = 0._dp
546 END DO
547 END DO
548 END DO
549 ELSE
550 zf = 0._dp
551 END IF
552 CALL timestop(handle)
553
554 END SUBROUTINE scale_and_distribute
555END MODULE ps_wavelet_util
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Definition of mathematical constants and functions.
real(kind=dp), parameter, public fourpi
Creates the wavelet kernel for the wavelet based poisson solver.
subroutine, public s_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, pot, zf, scal, mpi_group)
!HERE POT MUST BE THE KERNEL (BEWARE THE HALF DIMENSION) ****h* BigDFT/S_PoissonSolver (Based on suit...
subroutine, public f_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, pot, zf, scal, mpi_group)
(Based on suitable modifications of S.Goedecker routines) Applies the local FFT space Kernel to the d...
subroutine, public p_poissonsolver(n1, n2, n3, nd1, nd2, nd3, md1, md2, md3, nproc, iproc, zf, scal, hx, hy, hz, mpi_group)
...
subroutine, public fourier_dim(n, n_next)
Give a number n_next > n compatible for the FFT.
Performs a wavelet based solution of the Poisson equation.
subroutine, public p_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
Calculate four sets of dimension needed for the calculation of the convolution for the periodic syste...
subroutine, public psolver(geocode, iproc, nproc, n01, n02, n03, hx, hy, hz, rhopot, karray, pw_grid)
Calculate the Poisson equation $\nabla^2 V(x,y,z)=-4 \pi \rho(x,y,z)$ from a given $\rho$,...
subroutine, public s_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
Calculate four sets of dimension needed for the calculation of the convolution for the surface system...
subroutine, public f_fft_dimensions(n01, n02, n03, m1, m2, m3, n1, n2, n3, md1, md2, md3, nd1, nd2, nd3, nproc)
Calculate four sets of dimension needed for the calculation of the zero-padded convolution.