8 #include "sll_memory.h"
9 #include "sll_working_precision.h"
12 use iso_c_binding,
only: &
44 complex(c_double_complex),
dimension(:),
pointer :: in
45 complex(c_double_complex),
dimension(:),
pointer :: out
46 integer(c_size_t) :: sz_in
47 integer(c_size_t) :: sz_out
52 sll_real64,
dimension(:),
allocatable :: coordinate
53 sll_int32,
dimension(:),
allocatable :: parent
55 sll_int32,
dimension(:),
allocatable :: children
56 sll_int32,
dimension(:),
allocatable :: function_type
57 sll_int32,
dimension(:),
allocatable :: level
58 sll_int32,
dimension(:),
allocatable :: index_on_level
69 sll_real64,
dimension(:),
pointer :: eta_min
70 sll_real64,
dimension(:),
pointer :: eta_max
71 sll_real64,
dimension(:),
pointer :: length
73 sll_int32 :: max_level
74 sll_int32,
dimension(:),
pointer :: levels
76 sll_int32 :: interpolation
77 sll_int32 :: no_basis_functions
78 sll_int32 :: size_basis
87 sll_real64,
dimension(:),
pointer :: stripe, stripe_out
88 sll_real64,
dimension(:),
pointer :: hs_weights
89 sll_int32,
dimension(:),
pointer :: hs_weights_index
97 sll_int32,
dimension(:),
pointer :: level_mapping
143 interpolation_type, &
148 sll_real64,
dimension(:),
intent(in) :: eta_min
149 sll_real64,
dimension(:),
intent(in) :: eta_max
150 sll_int32,
dimension(:),
intent(in) :: levels
151 sll_int32,
intent(in) :: order
152 sll_int32,
intent(in) :: interpolation
153 sll_int32,
intent(in) :: interpolation_type
158 sll_allocate(interpolator%eta_min(interpolator%dim), ierr);
159 sll_allocate(interpolator%eta_max(interpolator%dim), ierr);
160 sll_allocate(interpolator%length(interpolator%dim), ierr);
161 sll_allocate(interpolator%levels(interpolator%dim), ierr);
163 interpolator%volume = 1.0_f64;
164 do j = 1, interpolator%dim
165 interpolator%eta_min(j) = eta_min(j);
166 interpolator%eta_max(j) = eta_max(j);
167 interpolator%length(j) = eta_max(j) - eta_min(j);
168 interpolator%volume = interpolator%volume*interpolator%length(j);
170 interpolator%levels = levels;
171 sll_allocate(interpolator%level_mapping(0:interpolator%max_level + 1), ierr);
172 interpolator%order = order
173 interpolator%interpolation = interpolation;
175 interpolator%no_basis_functions = 2
176 elseif (order == 2)
then
177 interpolator%no_basis_functions = 3
178 elseif (order == 3)
then
179 interpolator%no_basis_functions = 7
180 elseif (order == 4)
then
181 interpolator%no_basis_functions = 15
184 print *,
"Size of the basis: ", interpolator%size_basis
185 sll_allocate(interpolator%hierarchy(interpolator%size_basis), ierr)
186 do j = 1, interpolator%size_basis
187 sll_allocate(interpolator%hierarchy(j)%coordinate(interpolator%dim), ierr);
188 sll_allocate(interpolator%hierarchy(j)%parent(2*interpolator%dim), ierr);
189 sll_allocate(interpolator%hierarchy(j)%children(2*interpolator%dim), ierr);
190 sll_allocate(interpolator%hierarchy(j)%level(interpolator%dim), ierr);
191 sll_allocate(interpolator%hierarchy(j)%index_on_level(interpolator%dim), ierr);
192 sll_allocate(interpolator%hierarchy(j)%function_type(interpolator%dim), ierr);
195 sll_allocate(interpolator%stripe(2**interpolator%max_level + 1), ierr)
196 sll_allocate(interpolator%stripe_out(2**interpolator%max_level + 1), ierr)
198 do j = 1, interpolator%size_basis
199 interpolator%hierarchy(j)%children = -1
202 if (interpolator%order > 1)
then
203 sll_allocate(interpolator%hs_weights_index(interpolator%order + 1), ierr)
204 interpolator%hs_weights_index(1) = 1
205 interpolator%hs_weights_index(2) = 1
206 interpolator%hs_weights_index(3) = 3
207 if (interpolator%order == 2)
then
208 sll_allocate(interpolator%hs_weights(2), ierr)
209 elseif (interpolator%order == 3)
then
210 interpolator%hs_weights_index(4) = 7
211 sll_allocate(interpolator%hs_weights(6), ierr)
212 interpolator%hs_weights(3) = -0.125_f64
213 interpolator%hs_weights(4) = -interpolator%hs_weights(3)
214 interpolator%hs_weights(5) = interpolator%hs_weights(4)
215 interpolator%hs_weights(6) = interpolator%hs_weights(3)
216 elseif (interpolator%order == 4)
then
217 interpolator%hs_weights_index(4) = 7
218 interpolator%hs_weights_index(5) = 15
219 sll_allocate(interpolator%hs_weights(14), ierr)
220 interpolator%hs_weights(3) = -0.125_f64
221 interpolator%hs_weights(4) = -interpolator%hs_weights(3)
222 interpolator%hs_weights(5) = interpolator%hs_weights(4)
223 interpolator%hs_weights(6) = interpolator%hs_weights(3)
224 interpolator%hs_weights(7) = -1.0_f64/16.0_f64
225 interpolator%hs_weights(8) = 5.0_f64/112.0_f64
226 interpolator%hs_weights(9) = interpolator%hs_weights(7)
227 interpolator%hs_weights(10) = 7.0_f64/80.0_f64
228 interpolator%hs_weights(11) = 7.0_f64/80.0_f64
229 interpolator%hs_weights(12) = interpolator%hs_weights(7)
230 interpolator%hs_weights(13) = interpolator%hs_weights(8)
231 interpolator%hs_weights(14) = interpolator%hs_weights(7)
233 interpolator%hs_weights(1) = -0.25_f64
234 interpolator%hs_weights(2) = interpolator%hs_weights(1)
237 sll_allocate(interpolator%interp_per(interpolator%dim, interpolator%max_level), ierr);
240 sll_allocate(interpolator%interp(interpolator%dim, interpolator%max_level), ierr);
241 do i = 1, interpolator%max_level
242 do j = 1, interpolator%dim
243 if (interpolation_type == 0)
then
244 call interpolator%interp_per(j, i)%init(2**i + 1, &
245 interpolator%eta_min(j), &
246 interpolator%eta_max(j), &
254 call interpolator%interp_per(j, i)%init(2**i + 1, &
255 interpolator%eta_min(j), &
256 interpolator%eta_max(j), &
270 ALLOCATE (interpolator%fft_object(interpolator%max_level + 1))
271 call fft_initialize(interpolator%fft_object, interpolator%max_level)
284 sll_real64,
dimension(:),
intent(inout) :: data_array
288 do i = 2, interpolator%order
296 sll_real64,
dimension(:),
intent(inout) :: data_array
304 sll_real64,
dimension(:),
intent(inout) :: data_array
307 do i = interpolator%order, 2, -1
327 sll_real64,
intent(in) :: x
328 sll_real64,
intent(inout) :: fx
329 sll_int32,
intent(in) ::
type
334 if ((x >= -1.0_f64) .AND. (x < 0.0_f64))
then
336 elseif ((x >= 0.0_f64) .AND. (x < 1.0_f64))
then
352 if ((x > -1.0_f64) .AND. (x < 1.0_f64))
then
353 fx = (1.0_f64 - x)*(x + 1.0_f64)
358 if ((x > -1.0_f64) .AND. (x < 1.0_f64))
then
359 fx = (1.0_f64 - x)*(x + 1.0_f64)*(1.0_f64 - x/3.0_f64)
364 if ((x > -1.0_f64) .AND. (x < 1.0_f64))
then
365 fx = (1.0_f64 - x)*(x + 1.0_f64)*(1.0_f64 + x/3.0_f64)
370 if ((x > -1.0_f64) .AND. (x < 1.0_f64))
then
371 fx = (1.0_f64 - x)*(1.0_f64 + x)*(1.0_f64 - x/3.0_f64)*(1.0_f64 - x/7.0_f64)
376 if ((x > -1.0_f64) .AND. (x < 1.0_f64))
then
377 fx = (1.0_f64 - x)*(1.0_f64 + x)*(1.0_f64 + x/3.0_f64)*(1.0_f64 - x/5.0_f64)
382 if ((x > -1.0_f64) .AND. (x < 1.0_f64))
then
383 fx = (1.0_f64 - x)*(1.0_f64 + x)*(1.0_f64 - x/3.0_f64)*(1.0_f64 + x/5.0_f64)
388 if ((x > -1.0_f64) .AND. (x < 1.0_f64))
then
389 fx = (1.0_f64 - x)*(1.0_f64 + x)*(1.0_f64 + x/3.0_f64)*(1.0_f64 + x/7.0_f64)
397 sll_real64,
intent(in) :: x
398 sll_real64,
intent(inout) :: fx
399 sll_int32,
intent(in) ::
type
412 if ((x >= -1.0_f64) .AND. (x < 1.0_f64))
then
418 if ((x >= -1.0_f64) .AND. (x < 1.0_f64))
then
419 fx = -1.0_f64/3.0_f64 - 2.0_f64*x + x*x
424 if ((x >= -1.0_f64) .AND. (x < 1.0_f64))
then
425 fx = 1.0_f64/3.0_f64 - 2.0_f64*x - x*x
442 sll_real64,
intent(in) :: displacement
443 sll_int32,
intent(in) :: max_level, max_level_neighbor, dim
444 sll_int32 :: cell, size_fraction, size_neighbor
448 size_neighbor = 2**max_level_neighbor
449 size_fraction = 2**max_level/size_neighbor
451 do cell = 1, size_neighbor
452 interpolator%stripe_out(cell) = interpolator%stripe_out(1 + (cell - 1)*size_fraction)
461 sll_real64,
intent(in) :: displacement
462 sll_int32,
intent(in) :: max_level, dim
465 size = 2**max_level + 1;
466 if (max_level == 0)
then
467 interpolator%stripe_out(1) = interpolator%stripe(1)
469 interpolator%stripe(size) = interpolator%stripe(1);
470 call interpolator%interp_per(dim,max_level)%interpolate_array_disp(
size, interpolator%stripe(1:size), displacement, interpolator%stripe_out(1:size))
480 sll_real64,
dimension(:),
intent(in) :: data_in
481 sll_real64,
dimension(:),
intent(out) :: data_out
482 sll_real64,
intent(in) :: displacement
483 sll_int32,
intent(in) :: dim, max_level, index
484 logical,
intent(in) :: hiera
487 index, data_in, interpolator%stripe)
490 interpolator%stripe, max_level)
496 interpolator%stripe_out, max_level);
500 index, interpolator%stripe_out, data_out)
506 sll_real64,
intent(in) :: displacement
507 sll_real64,
dimension(:),
intent(in) :: data_in
508 sll_real64,
dimension(:),
intent(out) :: data_out
509 sll_int32,
intent(in) :: dim, no_dims
510 sll_int32,
intent(in) :: node_index
511 logical,
intent(in) :: hiera
512 sll_int32 :: j, child_index, max_level
514 max_level = interpolator%max_level
517 max_level = max_level - interpolator%hierarchy(node_index)%level(j);
520 max_level = min(max_level, interpolator%levels(dim))
523 max_level, node_index, data_in, data_out, hiera)
526 if ((j + 1)/2 .NE. dim)
then
527 child_index = interpolator%hierarchy(node_index)%children(j);
528 if (child_index > 0)
then
530 child_index, displacement, data_in, data_out, hiera)
540 sll_real64,
dimension(:),
intent(inout) :: data_in
541 sll_real64,
dimension(:),
intent(out) :: data_out
542 sll_int32,
intent(in) :: dim
543 sll_real64,
intent(in) ::displacement
545 sll_int32,
dimension(:),
allocatable :: dorder
546 logical,
intent(in) :: hiera
548 sll_allocate(dorder(interpolator%dim), j);
551 do j = 1, interpolator%dim
559 displacement, data_in, data_out, hiera);
560 if (hiera .EQV. .false.)
then
562 do j = interpolator%order, 2, -1
564 (interpolator, data_out, &
565 interpolator%dim, 2, dorder, j)
569 interpolator%dim, 2, dorder)
603 sll_real64,
dimension(:),
intent(in) :: data_in
604 sll_real64,
dimension(:),
intent(out) :: data_out
605 sll_real64,
intent(in) :: displacement, factor
606 sll_int32,
intent(in) :: dim, max_level, index, index_neighbor, max_level_neighbor
609 index, data_in, interpolator%stripe)
614 max_level, max_level_neighbor)
623 index_neighbor, interpolator%stripe_out, data_out)
629 sll_real64,
dimension(:),
intent(in) :: data_in
630 sll_real64,
dimension(:),
intent(out) :: data_out
631 sll_real64,
intent(in) :: displacement
632 sll_int32,
intent(in) :: dim, max_level, index
635 index, data_in, interpolator%stripe)
642 index, interpolator%stripe_out, data_out)
650 sll_int32,
intent(in) :: dim, max_level, index
651 sll_int32 :: n_points, index_running
652 sll_real64,
dimension(:),
intent(in) :: data_in
653 sll_real64,
dimension(:),
intent(out) :: data_out
655 n_points = 2**(max_level)
656 data_out(1) = data_in(index)
657 if (max_level > 0)
then
658 index_running = sparsegrid%hierarchy(index)%children(dim*2)
659 data_out(n_points/2 + 1) = data_in(index_running)
660 if (max_level > 1)
then
662 index_running, dim, data_in, data_out)
668 recursive subroutine extract_recursive(sparsegrid, index_stripe, stride, index_sg, dim, data_in, data_out)
670 sll_int32,
intent(in) :: index_stripe, stride, index_sg, dim
671 sll_real64,
dimension(:),
intent(in) :: data_in
672 sll_real64,
dimension(:),
intent(inout) :: data_out
675 data_out(index_stripe - stride) = &
676 data_in(sparsegrid%hierarchy(index_sg)%children(dim*2 - 1))
677 data_out(index_stripe + stride) = &
678 data_in(sparsegrid%hierarchy(index_sg)%children(dim*2))
681 sparsegrid%hierarchy(index_sg)%children(dim*2 - 1), dim, &
684 sparsegrid%hierarchy(index_sg)%children(dim*2), dim, &
693 sll_int32,
intent(in) :: dim, max_level, index
694 sll_int32 :: n_points, index_running
695 sll_real64,
dimension(:),
intent(in) :: data_in
696 sll_real64,
dimension(:),
intent(inout) :: data_out
698 n_points = 2**(max_level)
699 data_out(index) = data_in(1)
700 if (max_level > 0)
then
701 index_running = sparsegrid%hierarchy(index)%children(dim*2)
703 data_out(index_running) = data_in(n_points/2 + 1)
704 if (max_level > 1)
then
706 call insert_recursive(sparsegrid, n_points/2 + 1, n_points/4, index_running, &
707 dim, data_in, data_out)
713 recursive subroutine insert_recursive(sparsegrid, index_stripe, stride, index_sg, dim, data_in, data_out)
715 sll_int32,
intent(in) :: index_stripe, stride, index_sg, dim
716 sll_real64,
dimension(:),
intent(in) :: data_in
717 sll_real64,
dimension(:),
intent(inout) :: data_out
719 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2 - 1)) = &
720 (data_in(index_stripe - stride))
721 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2)) = &
722 (data_in(index_stripe + stride))
725 sparsegrid%hierarchy(index_sg)%children(dim*2 - 1), dim, &
728 sparsegrid%hierarchy(index_sg)%children(dim*2), dim, &
735 sll_real64,
intent(in) :: factor
736 sll_int32,
intent(in) :: dim, max_level, index
737 sll_int32 :: n_points, index_running
738 sll_real64,
dimension(:),
intent(in) :: data_in
739 sll_real64,
dimension(:),
intent(inout) :: data_out
741 n_points = 2**(max_level)
742 data_out(index) = data_out(index) + data_in(1)*factor
743 if (max_level > 0)
then
744 index_running = sparsegrid%hierarchy(index)%children(dim*2)
746 data_out(index_running) = data_out(index_running) + data_in(n_points/2 + 1)*factor
747 if (max_level > 1)
then
750 dim, data_in, data_out)
758 sll_real64,
intent(in) :: factor
759 sll_int32,
intent(in) :: index_stripe, stride, index_sg, dim
760 sll_real64,
dimension(:),
intent(in) :: data_in
761 sll_real64,
dimension(:),
intent(inout) :: data_out
763 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2 - 1)) = &
764 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2 - 1)) + (data_in(index_stripe - stride))*factor
767 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2)) = &
768 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2)) + (data_in(index_stripe + stride))*factor
772 sparsegrid%hierarchy(index_sg)%children(dim*2 - 1), dim, &
775 sparsegrid%hierarchy(index_sg)%children(dim*2), dim, &
791 sll_real64,
dimension(:),
intent(inout) ::
data
796 do counter = interpolator%size_basis, 1, -1
801 (interpolator,
data(counter), &
802 data, interpolator%hierarchy(counter)%level, factor, counter, 0)
809 sll_real64,
dimension(:),
intent(inout) ::
data
810 sll_int32,
intent(in) :: order
811 sll_int32 :: counter, start_level, order_level_size, j
812 sll_int32,
dimension(:),
allocatable :: k
815 start_level = order - 1
816 order_level_size = 2**(order - 1)
817 sll_allocate(k(interpolator%dim), j);
818 do counter = interpolator%size_basis, 1, -1
821 do j = 1, interpolator%dim
822 k(j) = modulo(interpolator%hierarchy(counter)%function_type(j) - &
823 interpolator%hs_weights_index(order), &
824 order_level_size) + interpolator%hs_weights_index(order);
827 (interpolator,
data(counter), &
829 interpolator%hierarchy(counter)%level, &
839 sll_real64,
dimension(:),
intent(inout) ::
data
844 do counter = 1, interpolator%size_basis
849 (interpolator,
data(counter), &
850 data, interpolator%hierarchy(counter)%level, factor, counter, 0)
857 sll_real64,
dimension(:),
intent(inout) ::
data
858 sll_int32,
intent(in) :: order
859 sll_int32 :: counter, start_level, order_level_size, j
860 sll_int32,
dimension(:),
allocatable :: k
863 start_level = order - 1
864 order_level_size = 2**(order - 1)
865 sll_allocate(k(interpolator%dim), j);
866 do counter = 1, interpolator%size_basis
869 do j = 1, interpolator%dim
870 k(j) = modulo(interpolator%hierarchy(counter)%function_type(j) - &
871 interpolator%hs_weights_index(order), &
872 order_level_size) + interpolator%hs_weights_index(order);
875 (interpolator,
data(counter), &
877 interpolator%hierarchy(counter)%level, &
887 sll_real64,
intent(inout) :: surplus
888 sll_real64,
dimension(:),
intent(in) :: data_array
889 sll_int32,
dimension(:),
intent(in) :: level
890 sll_real64,
intent(in) :: factor
891 sll_int32,
intent(in) :: index
892 sll_int32,
intent(in) :: d
895 if (index .NE. -1)
then
898 surplus = surplus + data_array(index)*factor
900 do j = d + 1, interpolator%dim
901 if (level(j) > 0)
then
904 -0.5_f64*factor, interpolator%hierarchy(index)%parent(2*j - 1), j)
907 -0.5_f64*factor, interpolator%hierarchy(index)%parent(2*j), j)
917 sll_real64,
intent(inout) :: surplus
918 sll_real64,
dimension(:),
intent(in) :: data_array
919 sll_int32,
intent(in) :: start_level
921 sll_int32,
dimension(:),
intent(in) :: level, k
922 sll_real64,
intent(in) :: factor
923 sll_int32,
intent(in) :: index
924 sll_int32,
intent(in) :: d
925 sll_int32 :: j, father
928 surplus = surplus + data_array(index)*factor
930 do j = d + 1, interpolator%dim
931 if (level(j) > start_level)
then
932 father = max(interpolator%hierarchy(index)%parent(2*j - 1), &
933 interpolator%hierarchy(index)%parent(2*j))
934 if (father .NE. -1)
then
936 interpolator, surplus, data_array, start_level, level, k, &
937 interpolator%hs_weights(k(j))*factor, father, j)
948 sll_real64,
dimension(:),
intent(inout) ::
data
949 sll_int32,
intent(in) :: max_level
950 sll_int32 :: index, stride, index_run, j, upper, od, level, weights_index, weights_number, factor
954 upper = 2**max_level;
955 do level = max_level, 1, -1
957 do j = 1, 2**(level - 1)
958 data(index_run) =
data(index_run) - &
959 data(index_run - stride)*0.5_f64 - &
960 data(modulo(index_run + stride - 1, upper) + 1)*0.5_f64
961 index_run = index_run + 2*stride
963 index = index + stride
967 do od = 2, sparsegrid%order
968 weights_index = sparsegrid%hs_weights_index(od);
969 weights_number = sparsegrid%hs_weights_index(od + 1) - &
970 sparsegrid%hs_weights_index(od)
973 do level = max_level, od, -1
976 do j = 1, 2**(level - 1)
977 data(index_run) =
data(index_run) + &
978 data(index_run + factor*stride)* &
979 sparsegrid%hs_weights(weights_index + modulo(j - 1, weights_number))
980 index_run = index_run + 2*stride
983 index = index + stride
992 sll_real64,
dimension(:),
intent(inout) ::
data
993 sll_int32,
intent(in) :: max_level
994 sll_int32 :: index_stripe, stride, od, weights_index, weights_number, index, factor, level, j, index_run
996 do od = sparsegrid%order, 2, -1
997 weights_index = sparsegrid%hs_weights_index(od);
998 weights_number = sparsegrid%hs_weights_index(od + 1) - sparsegrid%hs_weights_index(od)
999 stride = 2**(max_level - od);
1001 do level = od, max_level
1004 do j = 1, 2**(level - 1)
1005 data(index_run) =
data(index_run) - &
1006 data(index_run + factor*stride)* &
1007 sparsegrid%hs_weights(weights_index + modulo(j - 1, weights_number))
1008 index_run = index_run + 2*stride
1012 index = index - stride
1016 if (max_level > 0)
then
1017 index_stripe = 2**(max_level - 1)
1019 data(index_stripe + 1) =
data(index_stripe + 1) +
data(1)
1020 if (max_level > 1)
then
1021 index_stripe = index_stripe/2
1031 sll_int32,
intent(in) :: index, stride
1032 sll_real64,
dimension(:),
intent(inout) :: data_out
1034 data_out(index - stride) = data_out(index - stride) + 0.25_f64*data_out(index)
1035 data_out(index + stride) = data_out(index + stride) + 0.25_f64*data_out(index)
1037 if (stride > 1)
then
1045 sll_int32,
intent(in) :: index, stride, upper
1046 sll_real64,
dimension(:),
intent(inout) :: data_out
1048 data_out(index) = data_out(index) + 0.5_f64*data_out(index - stride) &
1049 + 0.5_f64*data_out(modulo(index + stride - 1, upper) + 1);
1050 if (stride > 1)
then
1063 sll_real64,
intent(inout) :: surplus
1064 sll_real64,
dimension(:),
intent(in) :: data_array
1065 sll_int32,
dimension(:),
intent(in) :: level
1066 sll_real64,
intent(in) :: factor
1067 sll_int32,
intent(in) :: index
1068 sll_int32,
intent(in) :: dmax, dmin, dim
1069 sll_int32,
dimension(:),
intent(in) :: dorder
1072 if (index .NE. -1)
then
1073 if (dim > dmin - 1)
then
1074 surplus = surplus + data_array(index)*factor
1076 do j = dim + 1, dmax
1078 if (level(jj) > 0)
then
1081 -0.5_f64*factor, interpolator%hierarchy(index)%parent(2*jj - 1), &
1082 dmax, dmin, j, dorder)
1085 -0.5_f64*factor, interpolator%hierarchy(index)%parent(2*jj), &
1086 dmax, dmin, j, dorder)
1094 recursive subroutine dehierarchical_part_order_d_dimension(interpolator,surplus,data_array,start_level,level,k,factor,index,dmax,dmin,d,dorder)
1096 sll_real64,
intent(inout) :: surplus
1097 sll_real64,
dimension(:),
intent(in) :: data_array
1098 sll_int32,
intent(in) :: start_level
1099 sll_int32,
dimension(:),
intent(in) :: level, k, dorder
1100 sll_real64,
intent(in) :: factor
1101 sll_int32,
intent(in) :: index
1102 sll_int32,
intent(in) :: dmax, dmin, d
1103 sll_int32 :: j, father, jj
1105 if (d > dmin - 1)
then
1106 surplus = surplus + data_array(index)*factor
1110 if (level(jj) > start_level)
then
1111 father = max(interpolator%hierarchy(index)%parent(2*jj - 1), &
1112 interpolator%hierarchy(index)%parent(2*jj))
1113 if (father .NE. -1)
then
1115 interpolator, surplus, data_array, start_level, level, k, &
1116 interpolator%hs_weights(k(jj))*factor, father, dmax, dmin, j, dorder)
1127 sll_real64,
dimension(:),
intent(inout) ::
data
1128 sll_int32,
intent(in) :: dmax, dmin
1129 sll_int32,
dimension(:),
intent(in) :: dorder
1131 sll_int32 :: counter
1132 sll_real64 :: factor
1134 do counter = 1, interpolator%size_basis
1137 (interpolator,
data(counter), &
1138 data, interpolator%hierarchy(counter)%level, &
1139 factor, counter, dmax, dmin, dmin - 1, dorder)
1147 sll_real64,
dimension(:),
intent(inout) ::
data
1148 sll_int32,
intent(in) :: dmax, dmin, order
1149 sll_int32,
dimension(:),
intent(in) :: dorder
1151 sll_int32 :: counter, j, start_level, order_level_size
1152 sll_int32,
dimension(:),
allocatable :: k
1153 sll_real64 :: factor
1155 sll_allocate(k(interpolator%dim), j);
1156 start_level = order - 1
1157 order_level_size = 2**start_level
1159 do counter = 1, interpolator%size_basis
1162 do j = 1, interpolator%dim
1163 k(j) = modulo(interpolator%hierarchy(counter)%function_type(j) - &
1164 interpolator%hs_weights_index(order), &
1165 order_level_size) + interpolator%hs_weights_index(order);
1168 (interpolator,
data(counter), &
1169 data, start_level, interpolator%hierarchy(counter)%level, k, &
1170 factor, counter, dmax, dmin, dmin - 1, dorder)
1179 sll_real64,
dimension(:),
intent(inout) ::
data
1180 sll_int32,
intent(in) :: dmax, dmin
1181 sll_int32,
dimension(:),
intent(in) :: dorder
1183 sll_int32 :: counter
1184 sll_real64 :: factor
1186 do counter = interpolator%size_basis, 1, -1
1189 (interpolator,
data(counter), &
1190 data, interpolator%hierarchy(counter)%level, &
1191 factor, counter, dmax, dmin, dmin - 1, dorder)
1200 sll_real64,
dimension(:),
intent(inout) ::
data
1201 sll_int32,
intent(in) :: dmax, dmin, order
1202 sll_int32,
dimension(:),
intent(in) :: dorder
1204 sll_int32 :: counter, j
1205 sll_int32 :: start_level, order_level_size
1206 sll_int32,
dimension(:),
allocatable :: k
1207 sll_real64 :: factor
1209 sll_allocate(k(interpolator%dim), j);
1210 start_level = order - 1
1211 order_level_size = 2**start_level
1213 do counter = interpolator%size_basis, 1, -1
1214 do j = 1, interpolator%dim
1215 k(j) = modulo(interpolator%hierarchy(counter)%function_type(j) - &
1216 interpolator%hs_weights_index(order), &
1217 order_level_size) + interpolator%hs_weights_index(order);
1221 (interpolator,
data(counter), &
1222 data, start_level, &
1223 interpolator%hierarchy(counter)%level, k, factor, counter, dmax, dmin, &
1236 sll_real64,
intent(inout) :: val
1237 sll_real64,
dimension(:),
intent(in) :: data_in
1241 do i = 0, interpolator%max_level
1242 if (interpolator%boundary == 0)
then
1243 phix1 = 1.0_f64/(real((2**(i)), f64))
1245 phix1 = 1.0_f64/(real(max(2**(i), 2), f64))
1247 do j = interpolator%level_mapping(i), interpolator%level_mapping(i + 1) - 1
1248 val = val + data_in(j)*phix1
1251 val = val*interpolator%volume
1260 sll_real64,
intent(inout) :: val
1261 sll_real64,
dimension(:),
intent(inout) :: data_in
1262 sll_int32,
dimension(:),
intent(in) :: dorder
1265 val = sum(data_in)*interpolator%volume/(real((2**(interpolator%levels(dorder(1)))), f64));
1274 sll_int32,
intent(in) :: dim, max_level, index
1275 sll_int32 :: n_points, index_running
1276 sll_real64,
dimension(:),
intent(in) :: data_in
1277 sll_comp64,
dimension(:),
intent(out) :: data_out
1279 n_points = 2**(max_level)
1280 data_out(1) = cmplx(data_in(index), 0.0_f64, kind=f64)
1281 if (max_level > 0)
then
1282 index_running = sparsegrid%hierarchy(index)%children(dim*2)
1284 data_out(n_points/2 + 1) = cmplx(data_in(index_running), 0.0_f64, kind=f64)
1285 if (max_level > 1)
then
1288 dim, data_in, data_out)
1296 sll_int32,
intent(in) :: index_stripe, stride, index_sg, dim
1297 sll_real64,
dimension(:),
intent(in) :: data_in
1298 sll_comp64,
dimension(:),
intent(inout) :: data_out
1300 data_out(index_stripe - stride) = &
1301 cmplx(data_in(sparsegrid%hierarchy(index_sg)%children(dim*2 - 1)), 0.0_f64, kind=f64)
1302 data_out(index_stripe + stride) = &
1303 cmplx(data_in(sparsegrid%hierarchy(index_sg)%children(dim*2)), 0.0_f64, kind=f64)
1304 if (stride > 1)
then
1306 sparsegrid%hierarchy(index_sg)%children(dim*2 - 1), dim, &
1309 sparsegrid%hierarchy(index_sg)%children(dim*2), dim, &
1314 subroutine extract_comp(sparsegrid, dim, max_level, index, data_in, data_out)
1316 sll_int32,
intent(in) :: dim, max_level, index
1317 sll_int32 :: n_points, index_running
1318 sll_comp64,
dimension(:),
intent(in) :: data_in
1319 sll_comp64,
dimension(:),
intent(out) :: data_out
1321 n_points = 2**(max_level)
1322 data_out(1) = data_in(index)
1323 if (max_level > 0)
then
1324 index_running = sparsegrid%hierarchy(index)%children(dim*2)
1326 data_out(n_points/2 + 1) = data_in(index_running)
1327 if (max_level > 1)
then
1330 dim, data_in, data_out)
1338 sll_int32,
intent(in) :: index_stripe, stride, index_sg, dim
1339 sll_comp64,
dimension(:),
intent(in) :: data_in
1340 sll_comp64,
dimension(:),
intent(inout) :: data_out
1342 data_out(index_stripe - stride) = &
1343 data_in(sparsegrid%hierarchy(index_sg)%children(dim*2 - 1))
1344 data_out(index_stripe + stride) = &
1345 data_in(sparsegrid%hierarchy(index_sg)%children(dim*2))
1346 if (stride > 1)
then
1348 sparsegrid%hierarchy(index_sg)%children(dim*2 - 1), dim, &
1351 sparsegrid%hierarchy(index_sg)%children(dim*2), dim, &
1358 sll_int32,
intent(in) :: dim, max_level, index
1359 sll_int32 :: n_points, index_running
1360 sll_comp64,
dimension(:),
intent(in) :: data_in
1361 sll_comp64,
dimension(:),
intent(out) :: data_out
1363 n_points = 2**(max_level)
1364 data_out(1) = data_in(index)
1365 if (max_level > 0)
then
1366 index_running = sparsegrid%hierarchy(index)%children(dim*2)
1367 data_out(2) = data_in(index_running)
1368 if (max_level > 1)
then
1370 2, max_level, dim, data_in, data_out)
1377 sll_int32,
intent(in) :: level, max_level, index_sg, dim, ind
1378 sll_comp64,
dimension(:),
intent(in) :: data_in
1379 sll_comp64,
dimension(:),
intent(inout) :: data_out
1381 data_out(2**(level - 1) + 1 + 2*ind) = &
1382 data_in(sparsegrid%hierarchy(index_sg)%children(dim*2 - 1))
1383 data_out(2**(level - 1) + 1 + 2*ind + 1) = &
1384 data_in(sparsegrid%hierarchy(index_sg)%children(dim*2))
1385 if (level < max_level)
then
1387 sparsegrid%hierarchy(index_sg)%children(dim*2 - 1), 2*ind, &
1388 level + 1, max_level, dim, data_in, data_out)
1390 sparsegrid%hierarchy(index_sg)%children(dim*2), 2*ind + 1, &
1391 level + 1, max_level, dim, data_in, data_out)
1397 sll_int32,
intent(in) :: dim, max_level, index
1398 sll_int32 :: n_points, index_running
1399 sll_comp64,
dimension(:),
intent(in) :: data_in
1400 sll_comp64,
dimension(:),
intent(out) :: data_out
1402 n_points = 2**(max_level)
1403 data_out(index) = data_in(1)
1404 if (max_level > 0)
then
1405 index_running = sparsegrid%hierarchy(index)%children(dim*2)
1406 data_out(index_running) = data_in(2)
1407 if (max_level > 1)
then
1409 2, max_level, dim, data_in, data_out)
1416 sll_int32,
intent(in) :: level, max_level, index_sg, dim, ind
1417 sll_comp64,
dimension(:),
intent(in) :: data_in
1418 sll_comp64,
dimension(:),
intent(inout) :: data_out
1420 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2 - 1)) = &
1421 data_in(2**(level - 1) + 1 + 2*ind)
1422 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2)) = &
1423 data_in(2**(level - 1) + 1 + 2*ind + 1)
1424 if (level < max_level)
then
1426 sparsegrid%hierarchy(index_sg)%children(dim*2 - 1), 2*ind, &
1427 level + 1, max_level, dim, data_in, data_out)
1429 sparsegrid%hierarchy(index_sg)%children(dim*2), 2*ind + 1, &
1430 level + 1, max_level, dim, data_in, data_out)
1463 sll_int32,
intent(in) :: dim, max_level, index
1464 sll_int32 :: n_points, index_running
1465 sll_comp64,
dimension(:),
intent(in) :: data_in
1466 sll_real64,
dimension(:),
intent(out) :: data_out
1468 n_points = 2**(max_level)
1469 data_out(index) = real(data_in(1))
1470 if (max_level > 0)
then
1471 index_running = sparsegrid%hierarchy(index)%children(dim*2)
1473 data_out(index_running) = real(data_in(n_points/2 + 1))
1474 if (max_level > 1)
then
1477 dim, data_in, data_out)
1485 sll_int32,
intent(in) :: index_stripe, stride, index_sg, dim
1486 sll_comp64,
dimension(:),
intent(in) :: data_in
1487 sll_real64,
dimension(:),
intent(inout) :: data_out
1489 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2 - 1)) = &
1490 real(data_in(index_stripe - stride))
1491 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2)) = &
1492 real(data_in(index_stripe + stride))
1493 if (stride > 1)
then
1495 sparsegrid%hierarchy(index_sg)%children(dim*2 - 1), dim, &
1498 sparsegrid%hierarchy(index_sg)%children(dim*2), dim, &
1503 subroutine insert_comp(sparsegrid, dim, max_level, index, data_in, data_out)
1505 sll_int32,
intent(in) :: dim, max_level, index
1506 sll_int32 :: n_points, index_running
1507 sll_comp64,
dimension(:),
intent(in) :: data_in
1508 sll_comp64,
dimension(:),
intent(out) :: data_out
1510 n_points = 2**(max_level)
1511 data_out(index) = data_in(1)
1512 if (max_level > 0)
then
1513 index_running = sparsegrid%hierarchy(index)%children(dim*2)
1515 data_out(index_running) = data_in(n_points/2 + 1)
1516 if (max_level > 1)
then
1519 dim, data_in, data_out)
1527 sll_int32,
intent(in) :: index_stripe, stride, index_sg, dim
1528 sll_comp64,
dimension(:),
intent(in) :: data_in
1529 sll_comp64,
dimension(:),
intent(inout) :: data_out
1531 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2 - 1)) = &
1532 data_in(index_stripe - stride)
1533 data_out(sparsegrid%hierarchy(index_sg)%children(dim*2)) = &
1534 data_in(index_stripe + stride)
1535 if (stride > 1)
then
1537 sparsegrid%hierarchy(index_sg)%children(dim*2 - 1), dim, &
1540 sparsegrid%hierarchy(index_sg)%children(dim*2), dim, &
1546 sll_comp64,
dimension(:),
intent(inout) ::
data
1547 sll_int32,
intent(in) :: max_level
1550 do l = max_level, 1, -1
1551 do i = 2**l, 2**(l - 1) + 1, -1
1552 data(2**l + 1 - i) =
data(2**l + 1 - i) +
data(i)
1559 sll_comp64,
dimension(:),
intent(inout) ::
data
1560 sll_int32,
intent(in) :: max_level
1564 do i = 2**(l - 1) + 1, 2**l
1565 data(2**l + 1 - i) =
data(2**l + 1 - i) -
data(i)
1573 sll_int32,
intent(in) ::level
1574 sll_int32 :: i, no_points
1576 no_points = 2**level
1579 interpolator%fft_object(level + 1)%in, interpolator%fft_object(level + 1)%out)
1582 interpolator%fft_object(level + 1)%out(i) = &
1583 interpolator%fft_object(level + 1)%out(i)/cmplx(no_points, 0.0_f64, f64)
1590 sll_int32,
intent(in) :: level
1593 interpolator%fft_object(level + 1)%out, interpolator%fft_object(level + 1)%in)
1599 sll_int32,
intent(in) :: levels
1600 sll_int32 :: l,
size
1603 do l = 1, levels + 1
1605 fft_object(l)%sz_in = int(
size, c_size_t)
1606 fft_object(l)%sz_out = int(
size, c_size_t)
1624 sll_int32,
intent(in) :: levels
1627 do l = 1, levels + 1
1638 call fft_finalize(interpolator%fft_object, interpolator%max_level)
1639 deallocate (interpolator%hierarchy)
1640 deallocate (interpolator%stripe)
1641 deallocate (interpolator%stripe_out)
1642 deallocate (interpolator%hs_weights)
1643 deallocate (interpolator%hs_weights_index)
1644 deallocate (interpolator%interp)
1645 deallocate (interpolator%level_mapping)
1646 deallocate (interpolator%eta_min)
1647 deallocate (interpolator%eta_max)
1648 deallocate (interpolator%length)
1655 sll_real64,
dimension(:),
intent(in) :: data_in
1656 sll_comp64,
dimension(:),
intent(out) :: data_out
1657 sll_int32,
intent(in) :: dim, max_level, index
1660 index, data_in, interpolator%fft_object(max_level + 1)%in)
1663 call fft_to_centered(2**max_level, interpolator%fft_object(max_level + 1)%out, &
1664 interpolator%fft_object(max_level + 1)%in)
1666 call hira(interpolator%fft_object(max_level + 1)%in, max_level)
1669 index, interpolator%fft_object(max_level + 1)%in, data_out)
1675 sll_comp64,
dimension(:),
intent(inout) ::
data
1676 sll_int32,
intent(in) :: dim, max_level, index
1679 index,
data, interpolator%fft_object(max_level + 1)%in)
1682 call fft_to_centered(2**max_level, interpolator%fft_object(max_level + 1)%out, &
1683 interpolator%fft_object(max_level + 1)%in)
1684 call hira(interpolator%fft_object(max_level + 1)%in, max_level)
1686 index, interpolator%fft_object(max_level + 1)%in, data)
1690 subroutine tohira1d(interpolator, dim, max_level, index, data)
1692 sll_comp64,
dimension(:),
intent(inout) ::
data
1693 sll_int32,
intent(in) :: dim, max_level, index
1696 data, interpolator%fft_object(max_level + 1)%in)
1697 call hira(interpolator%fft_object(max_level + 1)%in, max_level)
1699 interpolator%fft_object(max_level + 1)%in, data)
1704 subroutine tonodal1d(interpolator, dim, max_level, index, data_in, data_out)
1706 sll_comp64,
dimension(:),
intent(in) :: data_in
1707 sll_real64,
dimension(:),
intent(out) :: data_out
1708 sll_int32,
intent(in) :: dim, max_level, index
1711 max_level, index, data_in, interpolator%fft_object(max_level + 1)%in)
1712 call dehi(interpolator%fft_object(max_level + 1)%in, max_level)
1713 call fft_to_inorder(2**max_level, interpolator%fft_object(max_level + 1)%in, &
1714 interpolator%fft_object(max_level + 1)%out)
1718 interpolator%fft_object(max_level + 1)%in, data_out)
1725 sll_comp64,
dimension(:),
intent(inout) ::
data
1726 sll_int32,
intent(in) :: dim, max_level, index
1729 max_level, index,
data, interpolator%fft_object(max_level + 1)%in)
1730 call dehi(interpolator%fft_object(max_level + 1)%in, max_level)
1733 call fft_to_inorder(2**max_level, interpolator%fft_object(max_level + 1)%in, &
1734 interpolator%fft_object(max_level + 1)%out)
1737 call insert_comp(interpolator, dim, max_level, index, &
1738 interpolator%fft_object(max_level + 1)%in, data)
1742 subroutine todehi1d(interpolator, dim, max_level, index, data_array)
1744 sll_comp64,
dimension(:),
intent(inout) :: data_array
1745 sll_int32,
intent(in) :: dim, max_level, index
1748 data_array, interpolator%fft_object(max_level + 1)%out)
1749 call dehi(interpolator%fft_object(max_level + 1)%out, max_level)
1751 interpolator%fft_object(max_level + 1)%out, data_array)
1756 sll_int32,
intent(in) :: length
1757 sll_comp64,
dimension(:),
intent(in) :: data_in
1758 sll_comp64,
dimension(:),
intent(out) :: data_out
1761 data_out(1) = data_in(1)
1762 data_out(length) = data_in(length/2 + 1)
1764 do k = 1, length/2 - 1
1765 data_out(2*k) = data_in(k + 1)
1766 data_out(2*k + 1) = data_in(length - k + 1)
1772 sll_int32,
intent(in) :: length
1773 sll_comp64,
dimension(:),
intent(in) :: data_in
1774 sll_comp64,
dimension(:),
intent(out) :: data_out
1777 data_out(1) = data_in(1)
1778 data_out(length/2 + 1) = data_in(length)
1780 do k = 1, length/2 - 1
1781 data_out(k + 1) = data_in(2*k)
1782 data_out(length - k + 1) = data_in(2*k + 1)
1788 sll_comp64,
dimension(:),
intent(inout) ::
data
1790 sll_real64,
intent(in) :: d_scale
1791 sll_int32,
intent(in) ::
size
1793 sll_real64 :: sin_val, cos_val
1796 sin_val = sin(-real(k, f64)*d_scale)
1797 cos_val = cos(-real(k, f64)*d_scale)
1798 data(2*k) = cmplx(real(
data(2*k))*cos_val - aimag(
data(2*k))*sin_val, &
1799 real(data(2*k))*sin_val + aimag(data(2*k))*cos_val, kind=f64)
1800 if (k < size/2)
then
1803 data(2*k + 1) = cmplx(real(
data(2*k + 1))*cos_val - aimag(
data(2*k + 1))*sin_val, &
1804 real(data(2*k + 1))*sin_val + aimag(data(2*k + 1))*cos_val, kind=f64)
1810 subroutine displace1d(interpolator, dim, max_level, index, displacement, data)
1812 sll_comp64,
dimension(:),
intent(inout) ::
data
1813 sll_int32,
intent(in) :: dim, max_level, index
1814 sll_real64,
intent(in) :: displacement
1817 index,
data, interpolator%fft_object(max_level + 1)%in)
1819 interpolator%fft_object(max_level + 1)%in)
1821 index, interpolator%fft_object(max_level + 1)%in, data)
subroutine, public sll_s_fft_free(plan)
Delete a plan.
integer, parameter, public sll_p_fft_forward
Flag to specify forward FFT (negative sign) [value -1].
subroutine, public sll_s_fft_exec_c2c_1d(plan, array_in, array_out)
Compute fast Fourier transform in complex to complex mode.
subroutine, public sll_s_fft_init_c2c_1d(plan, nx, array_in, array_out, direction, normalized, aligned, optimization)
Create new 1d complex to complex plan.
integer, parameter, public sll_p_fft_backward
Flag to specify backward FFT (positive sign) [value 1].
integer(c_int), parameter, public sll_p_fft_measure
FFTW planning-rigor flag FFTW_MEASURE (optimized plan) NOTE: planner overwrites the input array durin...
complex(c_double_complex) function, dimension(:), pointer, public sll_f_fft_allocate_aligned_complex(n)
Function to allocate an aligned complex array.
Module for 1D interpolation and reconstruction.
Interpolator with periodic boundary conditions.
Dimension-independent functions for sparse grid with polynomial basis functions.
subroutine fft_to_inorder(length, data_in, data_out)
subroutine dehierarchical_part(interpolator, data, dmax, dmin, dorder)
subroutine fft_on_stripe(interpolator, level)
recursive subroutine dehierarchical_stripe_order_recursive(index, stride, data_out)
recursive subroutine dehierarchical_part_d_dimension(interpolator, surplus, data_array, level, factor, index, dmax, dmin, dim, dorder)
recursive subroutine extract_recursive_real_to_comp(sparsegrid, index_stripe, stride, index_sg, dim, data_in, data_out)
recursive subroutine insert_recursive(sparsegrid, index_stripe, stride, index_sg, dim, data_in, data_out)
subroutine tonodal1d_comp(interpolator, dim, max_level, index, data)
recursive subroutine dehierarchical_order_d_dimension(interpolator, surplus, data_array, start_level, level, k, factor, index, d)
recursive subroutine interpolate_disp_recursive(interpolator, no_dims, dim, node_index, displacement, data_in, data_out, hiera)
subroutine dehi(data, max_level)
subroutine displace_on_stripe_periodic(interpolator, displacement, dim, max_level)
subroutine hierarchical_stripe(sparsegrid, data, max_level)
subroutine free_sparse_grid(interpolator)
Finalize sparse grid.
recursive subroutine insert_recursive_fourier(sparsegrid, index_sg, ind, level, max_level, dim, data_in, data_out)
subroutine displace_fourier_coeffs(d_scale, size, data)
subroutine ifft_on_stripe(interpolator, level)
subroutine fft_to_centered(length, data_in, data_out)
subroutine hierarchical(interpolator, data)
subroutine initialize_sg(interpolator, levels, order, interpolation, interpolation_type, eta_min, eta_max)
subroutine extract_fourier(sparsegrid, dim, max_level, index, data_in, data_out)
subroutine hierarchical_order(interpolator, data, order)
subroutine integrate_trapezoidal2(interpolator, dorder, data_in, val)
subroutine insert_periodic(sparsegrid, dim, max_level, index, data_in, data_out)
subroutine dehierarchical_order(interpolator, data, order)
subroutine insert_periodic_additive(sparsegrid, factor, dim, max_level, index, data_in, data_out)
subroutine hierarchical_part(interpolator, data, dmax, dmin, dorder)
subroutine tonodal1d(interpolator, dim, max_level, index, data_in, data_out)
recursive subroutine insert_recursive_comp(sparsegrid, index_stripe, stride, index_sg, dim, data_in, data_out)
subroutine compute_hierarchical_surplus(interpolator, data_array)
recursive subroutine extract_recursive(sparsegrid, index_stripe, stride, index_sg, dim, data_in, data_out)
subroutine compute_linear_hierarchical_surplus(interpolator, data_array)
subroutine insert_comp(sparsegrid, dim, max_level, index, data_in, data_out)
subroutine extract_real_to_comp(sparsegrid, dim, max_level, index, data_in, data_out)
subroutine tohierarchical1d_comp(interpolator, dim, max_level, index, data)
Complex version of ToHierarchical1d_comp.
subroutine hira(data, max_level)
subroutine compute_dehierarchical(interpolator, data_array)
subroutine interpolate_disp_1d_periodic_self(interpolator, displacement, dim, max_level, index, data_in, data_out)
subroutine fft_finalize(fft_object, levels)
subroutine basis_function(x, fx, type)
subroutine displace1d(interpolator, dim, max_level, index, displacement, data)
recursive subroutine insert_additive_recursive(sparsegrid, factor, index_stripe, stride, index_sg, dim, data_in, data_out)
subroutine tohira1d(interpolator, dim, max_level, index, data)
subroutine basis_function_derivative(x, fx, type)
subroutine hierarchical_part_order(interpolator, data, dmax, dmin, dorder, order)
subroutine interpolate_disp_1d_periodic_for_neighbor(interpolator, displacement, factor, dim, max_level, max_level_neighbor, index, index_neighbor, data_in, data_out)
recursive subroutine dehierarchical_part_order_d_dimension(interpolator, surplus, data_array, start_level, level, k, factor, index, dmax, dmin, d, dorder)
subroutine dehierarchical(interpolator, data)
subroutine extract_periodic(sparsegrid, dim, max_level, index, data_in, data_out)
subroutine insert_fourier(sparsegrid, dim, max_level, index, data_in, data_out)
subroutine fft_initialize(fft_object, levels)
subroutine interpolate_disp_1d_periodic(interpolator, displacement, dim, max_level, index, data_in, data_out, hiera)
subroutine extract_comp(sparsegrid, dim, max_level, index, data_in, data_out)
subroutine displace_on_stripe_periodic_for_neighbor(interpolator, displacement, dim, max_level, max_level_neighbor)
recursive subroutine insert_recursive_comp_to_real(sparsegrid, index_stripe, stride, index_sg, dim, data_in, data_out)
recursive subroutine extract_recursive_comp(sparsegrid, index_stripe, stride, index_sg, dim, data_in, data_out)
subroutine integrate_trapezoidal(interpolator, data_in, val)
subroutine dehierarchical_stripe(sparsegrid, data, max_level)
subroutine interpolate_disp(interpolator, dim, displacement, data_in, data_out, hiera)
recursive subroutine dehierarchical_d_dimension(interpolator, surplus, data_array, level, factor, index, d)
subroutine insert_comp_to_real(sparsegrid, dim, max_level, index, data_in, data_out)
subroutine dehierarchical_part_order(interpolator, data, dmax, dmin, dorder, order)
subroutine tohierarchical1d(interpolator, dim, max_level, index, data_in, data_out)
Compute Fourier coefficients on sparse grid along dimension dim.
recursive subroutine dehierarchical_stripe_recursive(index, stride, upper, data_out)
subroutine todehi1d(interpolator, dim, max_level, index, data_array)
recursive subroutine extract_recursive_fourier(sparsegrid, index_sg, ind, level, max_level, dim, data_in, data_out)
Type for FFT plan in SeLaLib.
Abstract class for 1D interpolation and reconstruction.
class to hold values for hierarchical fft computations
Class defining the sparse grid data structure.
Data type for sparse grid node.