28 #include "../base/base_uses.f90"
33 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_spline_utils'
54 SUBROUTINE pw_restrict_s3(pw_fine_in, pw_coarse_out, coarse_pool, param_section)
56 TYPE(pw_r3d_rs_type),
INTENT(IN) :: pw_fine_in
57 TYPE(pw_r3d_rs_type),
INTENT(INOUT) :: pw_coarse_out
58 TYPE(pw_pool_type),
POINTER :: coarse_pool
59 TYPE(section_vals_type),
POINTER :: param_section
61 CHARACTER(len=*),
PARAMETER :: routinen =
'pw_restrict_s3'
63 INTEGER :: aint_precond, handle, interp_kind, &
64 max_iter, precond_kind
65 INTEGER,
DIMENSION(2, 3) :: bo
66 INTEGER,
SAVE :: ifile = 0
67 LOGICAL ::
pbc, safe_computation, success
68 REAL(kind=
dp) :: eps_r, eps_x
69 TYPE(pw_r3d_rs_type) :: coeffs, values
70 TYPE(pw_spline_precond_type) :: precond
73 CALL timeset(routinen, handle)
75 l_val=safe_computation)
91 bo = pw_coarse_out%pw_grid%bounds_local
92 CALL coarse_pool%create_pw(values)
96 coarse_coeffs_pw=values, &
99 safe_computation=safe_computation)
101 CALL coarse_pool%create_pw(coeffs)
103 pool=coarse_pool,
pbc=
pbc, transpose=.true.)
107 success =
find_coeffs(values=values, coeffs=coeffs, &
111 success =
find_coeffs(values=values, coeffs=coeffs, &
117 CALL pw_zero(pw_coarse_out)
118 CALL pw_axpy(coeffs, pw_coarse_out)
120 CALL coarse_pool%give_back_pw(values)
121 CALL coarse_pool%give_back_pw(coeffs)
122 CALL timestop(handle)
138 TYPE(pw_r3d_rs_type),
INTENT(IN) :: pw_coarse_in, pw_fine_out
139 TYPE(pw_pool_type),
POINTER :: coarse_pool
140 TYPE(section_vals_type),
POINTER :: param_section
142 CHARACTER(len=*),
PARAMETER :: routinen =
'pw_prolongate_s3'
144 INTEGER :: aint_precond, handle, interp_kind, &
145 max_iter, precond_kind
146 INTEGER,
DIMENSION(2, 3) :: bo
147 INTEGER,
SAVE :: ifile = 0
148 LOGICAL ::
pbc, safe_computation, success
149 REAL(kind=
dp) :: eps_r, eps_x
150 TYPE(pw_r3d_rs_type) :: coeffs
151 TYPE(pw_spline_precond_type) :: precond
154 CALL timeset(routinen, handle)
155 CALL coarse_pool%create_pw(coeffs)
156 bo = pw_coarse_in%pw_grid%bounds_local
158 l_val=safe_computation)
175 pool=coarse_pool,
pbc=
pbc, transpose=.false.)
179 success =
find_coeffs(values=pw_coarse_in, coeffs=coeffs, &
181 eps_r=eps_r, eps_x=eps_x, &
184 success =
find_coeffs(values=pw_coarse_in, coeffs=coeffs, &
186 eps_r=eps_r, eps_x=eps_x, &
193 fine_values_pw=pw_fine_out, &
197 pbc=
pbc, safe_computation=safe_computation)
199 CALL coarse_pool%give_back_pw(coeffs)
201 CALL timestop(handle)
subroutine pbc(r, r_pbc, s, s_pbc, a, b, c, alpha, beta, gamma, debug, info, pbc0, h, hinv)
...
utils to manipulate splines on the regular grid of a pw
integer, parameter, public pw_interp
integer, parameter, public spline3_nopbc_interp
subroutine, public pw_prolongate_s3(pw_coarse_in, pw_fine_out, coarse_pool, param_section)
prolongates a function from a coarse grid into a fine one
integer, parameter, public spline3_pbc_interp
subroutine, public pw_restrict_s3(pw_fine_in, pw_coarse_out, coarse_pool, param_section)
restricts the function from a fine grid to a coarse one
Defines the basic variable types.
integer, parameter, public dp
computes preconditioners, and implements methods to apply them currently used in qs_ot
integer, parameter, public do_standard_sum
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
different utils that are useful to manipulate splines on the regular grid of a pw
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 add_fine2coarse(fine_values_pw, coarse_coeffs_pw, weights_1d, w_border0, w_border1, pbc, safe_computation)
low level function that adds a coarse grid (without boundary) to a fine grid.
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), dimension(4), parameter, public spl3_1d_transf_coeffs
real(kind=dp), dimension(3), parameter, public spl3_1d_transf_border1
subroutine, public add_coarse2fine(coarse_coeffs_pw, fine_values_pw, weights_1d, w_border0, w_border1, pbc, safe_computation)
low level function that adds a coarse grid to a fine grid. If pbc is true periodic boundary condition...
subroutine, public spl3_nopbc(pw_in, pw_out)
...
subroutine, public spl3_nopbct(pw_in, pw_out)
...
subroutine, public spl3_pbc(pw_in, pw_out)
...