(git:ed6f26b)
Loading...
Searching...
No Matches
ewald_spline_util.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Setting up the Spline coefficients used to Interpolate the G-Term
10!> in Ewald sums
11!> \par History
12!> 12.2005 created [tlaino]
13!> \author Teodoro Laino
14! **************************************************************************************************
16 USE cell_methods, ONLY: cell_create
17 USE cell_types, ONLY: cell_release,&
26 USE kinds, ONLY: dp
28 USE pw_grid_types, ONLY: halfspace,&
30 USE pw_grids, ONLY: pw_grid_create
31 USE pw_methods, ONLY: pw_zero
32 USE pw_pool_types, ONLY: pw_pool_create,&
34 USE pw_spline_utils, ONLY: &
38 USE pw_types, ONLY: pw_r3d_rs_type
39!NB parallelization
40#include "./base/base_uses.f90"
41
42 IMPLICIT NONE
43 PRIVATE
44
45 LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .true.
46 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ewald_spline_util'
47 PUBLIC :: setup_ewald_spline
48
49CONTAINS
50
51! **************************************************************************************************
52!> \brief Setup of the G-space Ewald Term Spline Coefficients
53!> \param pw_grid ...
54!> \param pw_pool ...
55!> \param coeff ...
56!> \param LG ...
57!> \param gx ...
58!> \param gy ...
59!> \param gz ...
60!> \param hmat ...
61!> \param npts ...
62!> \param param_section ...
63!> \param tag ...
64!> \param print_section ...
65!> \par History
66!> 12.2005 created [tlaino]
67!> \author Teodoro Laino
68! **************************************************************************************************
69 SUBROUTINE setup_ewald_spline(pw_grid, pw_pool, coeff, LG, gx, gy, gz, hmat, npts, &
70 param_section, tag, print_section)
71 TYPE(pw_grid_type), POINTER :: pw_grid
72 TYPE(pw_pool_type), POINTER :: pw_pool
73 TYPE(pw_r3d_rs_type), POINTER :: coeff
74 REAL(kind=dp), DIMENSION(:), POINTER :: lg, gx, gy, gz
75 REAL(kind=dp), INTENT(IN) :: hmat(3, 3)
76 INTEGER, INTENT(IN) :: npts(3)
77 TYPE(section_vals_type), POINTER :: param_section
78 CHARACTER(LEN=*), INTENT(IN) :: tag
79 TYPE(section_vals_type), POINTER :: print_section
80
81 INTEGER :: bo(2, 3), iounit
82 TYPE(cell_type), POINTER :: cell
83 TYPE(cp_logger_type), POINTER :: logger
84 TYPE(pw_r3d_rs_type) :: pw
85
86!
87! Setting Up Fit Procedure
88!
89
90 cpassert(.NOT. ASSOCIATED(pw_grid))
91 cpassert(.NOT. ASSOCIATED(pw_pool))
92 cpassert(.NOT. ASSOCIATED(coeff))
93 NULLIFY (cell)
94
95 CALL cell_create(cell, hmat=hmat, periodic=(/1, 1, 1/))
96 logger => cp_get_default_logger()
97 iounit = cp_print_key_unit_nr(logger, print_section, "", &
98 extension=".Log")
99 bo(1, 1:3) = 0
100 bo(2, 1:3) = npts(1:3) - 1
101 CALL pw_grid_create(pw_grid, mp_comm_self, cell%hmat, grid_span=halfspace, bounds=bo, iounit=iounit)
102
103 CALL cp_print_key_finished_output(iounit, logger, print_section, &
104 "")
105 ! pw_pool initialized
106 CALL pw_pool_create(pw_pool, pw_grid=pw_grid)
107 ALLOCATE (coeff)
108 CALL pw_pool%create_pw(pw)
109 CALL pw_pool%create_pw(coeff)
110 ! Evaluate function on grid
111 CALL eval_pw_tablr(pw, pw_pool, coeff, lg, gx, gy, gz, hmat_mm=hmat, &
112 param_section=param_section, tag=tag)
113 CALL pw_pool%give_back_pw(pw)
114 CALL cell_release(cell)
115
116 END SUBROUTINE setup_ewald_spline
117
118! **************************************************************************************************
119!> \brief Evaluates the function G-Term in reciprocal space on the grid
120!> and find the coefficients of the Splines
121!> \param grid ...
122!> \param pw_pool ...
123!> \param TabLR ...
124!> \param Lg ...
125!> \param gx ...
126!> \param gy ...
127!> \param gz ...
128!> \param hmat_mm ...
129!> \param param_section ...
130!> \param tag ...
131!> \par History
132!> 12.2005 created [tlaino]
133!> \author Teodoro Laino
134! **************************************************************************************************
135 SUBROUTINE eval_pw_tablr(grid, pw_pool, TabLR, Lg, gx, gy, gz, hmat_mm, &
136 param_section, tag)
137 TYPE(pw_r3d_rs_type), INTENT(INOUT) :: grid
138 TYPE(pw_pool_type), POINTER :: pw_pool
139 TYPE(pw_r3d_rs_type), POINTER :: tablr
140 REAL(kind=dp), DIMENSION(:), POINTER :: lg, gx, gy, gz
141 REAL(kind=dp), DIMENSION(3, 3) :: hmat_mm
142 TYPE(section_vals_type), POINTER :: param_section
143 CHARACTER(LEN=*), INTENT(IN) :: tag
144
145 CHARACTER(len=*), PARAMETER :: routinen = 'eval_pw_TabLR'
146
147 INTEGER :: act_nx, act_ny, aint_precond, handle, i, iii, is, j, js, k, ks, lg_loc_max, &
148 lg_loc_min, max_iter, my_i, my_j, my_k, n1, n2, n3, n_extra, nlg_loc, nxlim, nylim, &
149 nzlim, precond_kind
150 INTEGER, DIMENSION(2, 3) :: gbo
151 LOGICAL :: success
152 REAL(kind=dp) :: dr1, dr2, dr3, eps_r, eps_x, xs1, xs2, &
153 xs3
154 REAL(kind=dp), ALLOCATABLE :: cos_gx(:, :), cos_gy(:, :), &
155 cos_gz(:, :), lhs(:, :), rhs(:, :), &
156 sin_gx(:, :), sin_gy(:, :), &
157 sin_gz(:, :)
158 TYPE(pw_spline_precond_type) :: precond
159 TYPE(section_vals_type), POINTER :: interp_section
160
161!NB pull expensive Cos() out of inner looop
162!NB temporaries for holding stuff so that dgemm can be used
163
164 EXTERNAL :: dgemm
165
166 CALL timeset(routinen, handle)
167 n1 = grid%pw_grid%npts(1)
168 n2 = grid%pw_grid%npts(2)
169 n3 = grid%pw_grid%npts(3)
170 dr1 = grid%pw_grid%dr(1)
171 dr2 = grid%pw_grid%dr(2)
172 dr3 = grid%pw_grid%dr(3)
173 gbo = grid%pw_grid%bounds
174 nxlim = floor(real(n1, kind=dp)/2.0_dp)
175 nylim = floor(real(n2, kind=dp)/2.0_dp)
176 nzlim = floor(real(n3, kind=dp)/2.0_dp)
177 is = 0
178 js = 0
179 ks = 0
180 IF (2*nxlim /= n1) is = 1
181 IF (2*nylim /= n2) js = 1
182 IF (2*nzlim /= n3) ks = 1
183 CALL pw_zero(grid)
184
185 ! Used the full symmetry to reduce the evaluation to 1/64th
186 !NB parallelization
187 iii = 0
188 !NB allocate temporaries for Cos refactoring
189 ALLOCATE (cos_gx(SIZE(lg), gbo(1, 1):gbo(2, 1)))
190 ALLOCATE (sin_gx(SIZE(lg), gbo(1, 1):gbo(2, 1)))
191 ALLOCATE (cos_gy(SIZE(lg), gbo(1, 2):gbo(2, 2)))
192 ALLOCATE (sin_gy(SIZE(lg), gbo(1, 2):gbo(2, 2)))
193 ALLOCATE (cos_gz(SIZE(lg), gbo(1, 3):gbo(2, 3)))
194 ALLOCATE (sin_gz(SIZE(lg), gbo(1, 3):gbo(2, 3)))
195 !NB precalculate Cos(gx*xs1) etc for Cos refactoring
196 DO k = gbo(1, 3), gbo(2, 3)
197 my_k = k - gbo(1, 3)
198 xs3 = real(my_k, dp)*dr3
199 IF (k > nzlim) cycle
200 cos_gz(1:SIZE(lg), k) = cos(gz(1:SIZE(lg))*xs3)
201 sin_gz(1:SIZE(lg), k) = sin(gz(1:SIZE(lg))*xs3)
202 END DO ! k
203 xs2 = 0.0_dp
204 DO j = gbo(1, 2), gbo(2, 2)
205 IF (j > nylim) cycle
206 cos_gy(1:SIZE(lg), j) = cos(gy(1:SIZE(lg))*xs2)
207 sin_gy(1:SIZE(lg), j) = sin(gy(1:SIZE(lg))*xs2)
208 xs2 = xs2 + dr2
209 END DO ! j
210 xs1 = 0.0_dp
211 DO i = gbo(1, 1), gbo(2, 1)
212 IF (i > nxlim) cycle
213 cos_gx(1:SIZE(lg), i) = cos(gx(1:SIZE(lg))*xs1)
214 sin_gx(1:SIZE(lg), i) = sin(gx(1:SIZE(lg))*xs1)
215 xs1 = xs1 + dr1
216 END DO ! i
217
218 !NB use DGEMM to compute sum over kg for each i, j, k
219 ! number of elements per node, round down
220 nlg_loc = SIZE(lg)/grid%pw_grid%para%group%num_pe
221 ! number of extra elements not yet accounted for
222 n_extra = mod(SIZE(lg), grid%pw_grid%para%group%num_pe)
223 ! first n_extra nodes get NLg_loc+1, remaining get NLg_loc
224 IF (grid%pw_grid%para%group%mepos < n_extra) THEN
225 lg_loc_min = (nlg_loc + 1)*grid%pw_grid%para%group%mepos + 1
226 lg_loc_max = lg_loc_min + (nlg_loc + 1) - 1
227 ELSE
228 lg_loc_min = (nlg_loc + 1)*n_extra + nlg_loc*(grid%pw_grid%para%group%mepos - n_extra) + 1
229 lg_loc_max = lg_loc_min + nlg_loc - 1
230 END IF
231 ! shouldn't be necessary
232 lg_loc_max = min(SIZE(lg), lg_loc_max)
233 nlg_loc = lg_loc_max - lg_loc_min + 1
234
235 IF (nlg_loc > 0) THEN ! some work for this node
236
237 act_nx = min(gbo(2, 1), nxlim) - gbo(1, 1) + 1
238 act_ny = min(gbo(2, 2), nylim) - gbo(1, 2) + 1
239 !NB temporaries for DGEMM use
240 ALLOCATE (lhs(act_nx, nlg_loc))
241 ALLOCATE (rhs(act_ny, nlg_loc))
242
243 ! do cos(gx) cos(gy+gz) term
244 DO i = gbo(1, 1), gbo(2, 1)
245 IF (i > nxlim) cycle
246 lhs(i - gbo(1, 1) + 1, 1:nlg_loc) = lg(lg_loc_min:lg_loc_max)*cos_gx(lg_loc_min:lg_loc_max, i)
247 END DO
248 DO k = gbo(1, 3), gbo(2, 3)
249 IF (k > nzlim) cycle
250 DO j = gbo(1, 2), gbo(2, 2)
251 IF (j > nylim) cycle
252 rhs(j - gbo(1, 2) + 1, 1:nlg_loc) = cos_gy(lg_loc_min:lg_loc_max, j)*cos_gz(lg_loc_min:lg_loc_max, k) - &
253 sin_gy(lg_loc_min:lg_loc_max, j)*sin_gz(lg_loc_min:lg_loc_max, k)
254 END DO
255 CALL dgemm('N', 'T', act_nx, act_ny, nlg_loc, 1.0d0, lhs(1, 1), act_nx, rhs(1, 1), act_ny, 0.0d0, &
256 grid%array(gbo(1, 1), gbo(1, 2), k), SIZE(grid%array, 1))
257 END DO
258
259 ! do sin(gx) sin(gy+gz) term
260 DO i = gbo(1, 1), gbo(2, 1)
261 IF (i > nxlim) cycle
262 lhs(i - gbo(1, 1) + 1, 1:nlg_loc) = -lg(lg_loc_min:lg_loc_max)*sin_gx(lg_loc_min:lg_loc_max, i)
263 END DO
264 DO k = gbo(1, 3), gbo(2, 3)
265 IF (k > nzlim) cycle
266 DO j = gbo(1, 2), gbo(2, 2)
267 IF (j > nylim) cycle
268 rhs(j - gbo(1, 2) + 1, 1:nlg_loc) = cos_gy(lg_loc_min:lg_loc_max, j)*sin_gz(lg_loc_min:lg_loc_max, k) + &
269 sin_gy(lg_loc_min:lg_loc_max, j)*cos_gz(lg_loc_min:lg_loc_max, k)
270 END DO
271 CALL dgemm('N', 'T', act_nx, act_ny, nlg_loc, 1.0d0, lhs(1, 1), act_nx, rhs(1, 1), act_ny, 1.0d0, &
272 grid%array(gbo(1, 1), gbo(1, 2), k), SIZE(grid%array, 1))
273 END DO
274
275 !NB deallocate temporaries for DGEMM use
276 DEALLOCATE (lhs)
277 DEALLOCATE (rhs)
278 !NB deallocate temporaries for Cos refactoring
279 DEALLOCATE (cos_gx)
280 DEALLOCATE (sin_gx)
281 DEALLOCATE (cos_gy)
282 DEALLOCATE (sin_gy)
283 DEALLOCATE (cos_gz)
284 DEALLOCATE (sin_gz)
285 !NB parallelization
286 ELSE ! no work for this node, just zero contribution
287 grid%array(gbo(1, 1):nxlim, gbo(1, 2):nylim, gbo(1, 3):nzlim) = 0.0_dp
288 END IF ! NLg_loc > 0
289
290 CALL grid%pw_grid%para%group%sum(grid%array(gbo(1, 1):nxlim, gbo(1, 2):nylim, gbo(1, 3):nzlim))
291
292 fake_loopongrid: DO k = gbo(1, 3), gbo(2, 3)
293 my_k = k
294 IF (k > nzlim) my_k = nzlim - abs(nzlim - k) + ks
295 DO j = gbo(1, 2), gbo(2, 2)
296 my_j = j
297 IF (j > nylim) my_j = nylim - abs(nylim - j) + js
298 DO i = gbo(1, 1), gbo(2, 1)
299 my_i = i
300 IF (i > nxlim) my_i = nxlim - abs(nxlim - i) + is
301 grid%array(i, j, k) = grid%array(my_i, my_j, my_k)
302 END DO
303 END DO
304 END DO fake_loopongrid
305 !
306 ! Solve for spline coefficients
307 !
308 interp_section => section_vals_get_subs_vals(param_section, "INTERPOLATOR")
309 CALL section_vals_val_get(interp_section, "aint_precond", i_val=aint_precond)
310 CALL section_vals_val_get(interp_section, "precond", i_val=precond_kind)
311 CALL section_vals_val_get(interp_section, "max_iter", i_val=max_iter)
312 CALL section_vals_val_get(interp_section, "eps_r", r_val=eps_r)
313 CALL section_vals_val_get(interp_section, "eps_x", r_val=eps_x)
314 !
315 ! Solve for spline coefficients
316 !
317 CALL pw_spline_precond_create(precond, precond_kind=aint_precond, &
318 pool=pw_pool, pbc=.true., transpose=.false.)
319 CALL pw_spline_do_precond(precond, grid, tablr)
320 CALL pw_spline_precond_set_kind(precond, precond_kind)
321 success = find_coeffs(values=grid, coeffs=tablr, &
322 linop=spl3_pbc, preconditioner=precond, pool=pw_pool, &
323 eps_r=eps_r, eps_x=eps_x, &
324 max_iter=max_iter)
325 cpassert(success)
326 CALL pw_spline_precond_release(precond)
327 !
328 ! Check for the interpolation Spline
329 !
330 CALL check_spline_interp_tablr(hmat_mm, lg, gx, gy, gz, tablr, param_section, &
331 tag)
332 CALL timestop(handle)
333 END SUBROUTINE eval_pw_tablr
334
335! **************************************************************************************************
336!> \brief Routine to check the accuracy for the Spline Interpolation
337!> \param hmat_mm ...
338!> \param Lg ...
339!> \param gx ...
340!> \param gy ...
341!> \param gz ...
342!> \param TabLR ...
343!> \param param_section ...
344!> \param tag ...
345!> \par History
346!> 12.2005 created [tlaino]
347!> \author Teodoro Laino
348! **************************************************************************************************
349 SUBROUTINE check_spline_interp_tablr(hmat_mm, Lg, gx, gy, gz, TabLR, &
350 param_section, tag)
351 REAL(kind=dp), DIMENSION(3, 3) :: hmat_mm
352 REAL(kind=dp), DIMENSION(:), POINTER :: lg, gx, gy, gz
353 TYPE(pw_r3d_rs_type), POINTER :: tablr
354 TYPE(section_vals_type), POINTER :: param_section
355 CHARACTER(LEN=*), INTENT(IN) :: tag
356
357 CHARACTER(len=*), PARAMETER :: routinen = 'check_spline_interp_TabLR'
358
359 INTEGER :: handle, i, iw, kg, npoints
360 REAL(kind=dp) :: dn(3), dr1, dr2, dr3, dxterm, dyterm, &
361 dzterm, errd, errf, fterm, maxerrord, &
362 maxerrorf, na, nn, term, tmp1, tmp2, &
363 vec(3), xs1, xs2, xs3
364 TYPE(cp_logger_type), POINTER :: logger
365
366 NULLIFY (logger)
367 logger => cp_get_default_logger()
368 iw = cp_print_key_unit_nr(logger, param_section, "check_spline", &
369 extension="."//trim(tag)//"Log")
370 CALL timeset(routinen, handle)
371 IF (iw > 0) THEN
372 npoints = 100
373 errf = 0.0_dp
374 maxerrorf = 0.0_dp
375 errd = 0.0_dp
376 maxerrord = 0.0_dp
377 dr1 = hmat_mm(1, 1)/real(npoints, kind=dp)
378 dr2 = hmat_mm(2, 2)/real(npoints, kind=dp)
379 dr3 = hmat_mm(3, 3)/real(npoints, kind=dp)
380 xs1 = 0.0_dp
381 xs2 = 0.0_dp
382 xs3 = 0.0_dp
383 WRITE (iw, '(A,T5,A15,4X,A17,T50,4X,A,5X,A,T80,A,T85,A15,4X,A17,T130,4X,A,5X,A)') &
384 "#", "Analytical Term", "Interpolated Term", "Error", "MaxError", &
385 "*", " Analyt Deriv ", "Interp Deriv Mod ", "Error", "MaxError"
386 DO i = 1, npoints + 1
387 term = 0.0_dp
388 dxterm = 0.0_dp
389 dyterm = 0.0_dp
390 dzterm = 0.0_dp
391 ! Sum over k vectors
392 DO kg = 1, SIZE(lg)
393 vec = (/real(gx(kg), kind=dp), real(gy(kg), kind=dp), real(gz(kg), kind=dp)/)
394 term = term + lg(kg)*cos(vec(1)*xs1 + vec(2)*xs2 + vec(3)*xs3)
395 dxterm = dxterm - lg(kg)*sin(vec(1)*xs1 + vec(2)*xs2 + vec(3)*xs3)*vec(1)
396 dyterm = dyterm - lg(kg)*sin(vec(1)*xs1 + vec(2)*xs2 + vec(3)*xs3)*vec(2)
397 dzterm = dzterm - lg(kg)*sin(vec(1)*xs1 + vec(2)*xs2 + vec(3)*xs3)*vec(3)
398 END DO
399 na = sqrt(dxterm*dxterm + dyterm*dyterm + dzterm*dzterm)
400 dn = eval_d_interp_spl3_pbc((/xs1, xs2, xs3/), tablr)
401 nn = sqrt(dot_product(dn, dn))
402 fterm = eval_interp_spl3_pbc((/xs1, xs2, xs3/), tablr)
403 tmp1 = abs(term - fterm)
404 tmp2 = sqrt(dot_product(dn - (/dxterm, dyterm, dzterm/), dn - (/dxterm, dyterm, dzterm/)))
405 errf = errf + tmp1
406 maxerrorf = max(maxerrorf, tmp1)
407 errd = errd + tmp2
408 maxerrord = max(maxerrord, tmp2)
409 WRITE (iw, '(T5,F15.10,5X,F15.10,T50,2F12.9,T80,A,T85,F15.10,5X,F15.10,T130,2F12.9)') &
410 term, fterm, tmp1, maxerrorf, "*", na, nn, tmp2, maxerrord
411 xs1 = xs1 + dr1
412 xs2 = xs2 + dr2
413 xs3 = xs3 + dr3
414 END DO
415 WRITE (iw, '(A,T5,A,T50,F12.9,T130,F12.9)') "#", "Averages", errf/real(npoints, kind=dp), &
416 errd/real(npoints, kind=dp)
417 END IF
418 CALL timestop(handle)
419 CALL cp_print_key_finished_output(iw, logger, param_section, "check_spline")
420
421 END SUBROUTINE check_spline_interp_tablr
422
423END MODULE ewald_spline_util
424
static void dgemm(const char transa, const char transb, const int m, const int n, const int k, const double alpha, const double *a, const int lda, const double *b, const int ldb, const double beta, double *c, const int ldc)
Convenient wrapper to hide Fortran nature of dgemm_, swapping a and b.
Handles all functions related to the CELL.
subroutine, public cell_create(cell, hmat, periodic, tag)
allocates and initializes a cell
Handles all functions related to the CELL.
Definition cell_types.F:15
subroutine, public cell_release(cell)
releases the given cell (see doc/ReferenceCounting.html)
Definition cell_types.F:559
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Setting up the Spline coefficients used to Interpolate the G-Term in Ewald sums.
subroutine, public setup_ewald_spline(pw_grid, pw_pool, coeff, lg, gx, gy, gz, hmat, npts, param_section, tag, print_section)
Setup of the G-space Ewald Term Spline Coefficients.
objects that represent the structure of input sections and the data contained in an input section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Interface to the message passing library MPI.
type(mp_comm_type), parameter, public mp_comm_self
computes preconditioners, and implements methods to apply them currently used in qs_ot
integer, parameter, public halfspace
This module defines the grid data type and some basic operations on it.
Definition pw_grids.F:36
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
subroutine, public pw_pool_create(pool, pw_grid, max_cache)
creates a pool for pw
different utils that are useful to manipulate splines on the regular grid of a pw
subroutine, public pw_spline_precond_release(preconditioner)
releases the preconditioner
subroutine, public pw_spline_precond_create(preconditioner, precond_kind, pool, pbc, transpose)
...
subroutine, public pw_spline_do_precond(preconditioner, in_v, out_v)
applies the preconditioner to the system of equations to find the coefficients of the spline
subroutine, public pw_spline_precond_set_kind(preconditioner, precond_kind, pbc, transpose)
switches the types of precoditioner to use
real(kind=dp) function, dimension(3), public eval_d_interp_spl3_pbc(vec, pw)
Evaluates the derivatives of the PBC interpolated Spline (pw) function on the generic input vector (v...
real(kind=dp) function, public eval_interp_spl3_pbc(vec, pw)
Evaluates the PBC interpolated Spline (pw) function on the generic input vector (vec)
logical function, public find_coeffs(values, coeffs, linop, preconditioner, pool, eps_r, eps_x, max_iter, sumtype)
solves iteratively (CG) a systmes of linear equations linOp(coeffs)=values (for example those needed ...
subroutine, public spl3_pbc(pw_in, pw_out)
...
Type defining parameters related to the simulation cell.
Definition cell_types.F:55
type of a logger, at the moment it contains just a print level starting at which level it should be l...
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
stores information for the preconditioner used to calculate the coeffs of splines