81 integer,
allocatable :: imin(:)
82 integer,
allocatable :: imax(:)
83 integer,
allocatable :: ri(:, :)
84 integer,
allocatable :: ri_pos(:,:,:)
85 integer,
allocatable :: ri_neg(:,:,:)
88 integer,
public,
parameter :: &
96 type(stencil_t),
public :: stencil
97 type(mesh_t),
pointer :: mesh => null()
98 integer,
allocatable :: nn(:)
99 integer,
public :: np = 0
101 real(real64),
allocatable,
public :: w(:,:)
103 logical,
public :: const_w = .
true.
105 type(accel_mem_t),
public :: buff_weights
106 type(accel_mem_t),
public :: buff_half_weights
108 integer,
public :: symmetry = op_general
110 character(len=40) :: label
113 integer,
public :: nri = 0
114 integer,
allocatable,
public :: ri(:,:)
115 integer,
allocatable,
public :: rimap(:)
116 integer,
allocatable,
public :: rimap_inv(:)
119 integer :: npairs = 0
120 real(real64),
allocatable :: wpair(:)
121 real(real64) :: wcenter
122 integer,
allocatable :: ri_pos(:,:,:)
123 integer,
allocatable :: ri_neg(:,:,:)
124 integer :: max_allocated_ri_pair = 0
126 integer :: ninner = 0
127 integer :: nouter = 0
129 type(nl_operator_index_t) :: inner
130 type(nl_operator_index_t) :: outer
132 type(accel_kernel_t) :: kernel
133 type(accel_mem_t) :: buff_imin
134 type(accel_mem_t) :: buff_imax
135 type(accel_mem_t) :: buff_ri
136 type(accel_mem_t) :: buff_map
137 type(accel_mem_t) :: buff_all
138 type(accel_mem_t) :: buff_inner
139 type(accel_mem_t) :: buff_outer
142 type(accel_mem_t),
public :: buff_wpair
143 type(accel_mem_t),
public :: buff_half_wpair
144 type(accel_mem_t),
public :: buff_ri_pos
145 type(accel_mem_t),
public :: buff_ri_neg
146 type(accel_mem_t),
public :: buff_map_sym
147 integer :: max_allocated_ri_pair_gpu = 0
150 type(nl_operator_t),
public,
pointer :: coarser => null()
154 integer,
parameter :: &
160 integer,
parameter :: &
169 integer,
intent(in) :: opid, type
271 character(len=*),
intent(in) :: label
272 integer,
optional,
intent(in) :: symm
277 op%symmetry = op_general
296 class(
space_t),
intent(in) :: space
297 type(
mesh_t),
target,
intent(in) :: mesh
299 integer,
intent(in) :: np
300 logical,
optional,
intent(in) :: const_w
301 logical,
optional,
intent(in) :: regenerate
303 integer :: ii, jj, p1(space%dim), time, current
304 integer,
allocatable :: st1(:), st2(:), st1r(:)
305 integer :: ir, maxp, iinner, iouter
306 logical :: change, force_change
307 character(len=200) :: flags
308 character(len=32) :: indirect_arg
309 integer,
allocatable :: inner_points(:), outer_points(:), all_points(:)
314 if (mesh%parallel_in_domains .and. .not. op%const_w)
then
328 if (.not. op%const_w) op%symmetry = op_general
332 safe_allocate(op%w(1:op%stencil%size, 1))
333 message(1) =
'Debug: nl_operator_build: working with constant weights.'
336 safe_allocate(op%w(1:op%stencil%size, 1:op%np))
337 message(1) =
'Debug: nl_operator_build: working with non-constant weights.'
345 safe_allocate(st1(1:op%stencil%size))
346 safe_allocate(st1r(1:op%stencil%size))
347 safe_allocate(st2(1:op%stencil%size))
356 do jj = 1, op%stencil%size
363 st1(1:op%stencil%size) = st1(1:op%stencil%size) - ii
365 change = any(st1 /= st2)
369 force_change = any(st1 + ii > mesh%np) .and. all(st2 + ii - 1 <= mesh%np)
372 if (change .or. force_change)
then
377 if (time == 1) op%nri = op%nri + 1
381 current = current + 1
382 op%ri(1:op%stencil%size, current) = st1(1:op%stencil%size)
386 if (time == 2) op%rimap(ii) = current
392 safe_deallocate_a(op%ri)
393 safe_deallocate_a(op%rimap)
394 safe_deallocate_a(op%rimap_inv)
396 safe_allocate(op%ri(1:op%stencil%size, 1:op%nri))
397 safe_allocate(op%rimap(1:op%np))
398 safe_allocate(op%rimap_inv(1:op%nri + 1))
405 if (mesh%use_curvilinear)
then
406 safe_allocate(op%nn(1:op%nri))
408 op%nn = op%stencil%size
417 op%rimap_inv(op%rimap(jj) + 1) = jj
419 op%rimap_inv(op%nri + 1) = op%np
421 safe_deallocate_a(st1)
422 safe_deallocate_a(st1r)
423 safe_deallocate_a(st2)
425 if (op%mesh%parallel_in_domains)
then
432 maxp = op%rimap_inv(ir + 1) + maxval(op%ri(1:op%stencil%size, ir))
435 op%inner%nri = op%inner%nri + 1
436 assert(op%inner%nri <= op%nri)
439 op%outer%nri = op%outer%nri + 1
440 assert(op%outer%nri <= op%nri)
444 assert(op%inner%nri + op%outer%nri == op%nri)
447 safe_deallocate_a(op%inner%imin)
448 safe_deallocate_a(op%inner%imax)
449 safe_deallocate_a(op%inner%ri)
450 safe_deallocate_a(op%outer%imin)
451 safe_deallocate_a(op%outer%imax)
452 safe_deallocate_a(op%outer%ri)
454 safe_allocate(op%inner%imin(1:op%inner%nri + 1))
455 safe_allocate(op%inner%imax(1:op%inner%nri))
456 safe_allocate(op%inner%ri(1:op%stencil%size, 1:op%inner%nri))
458 safe_allocate(op%outer%imin(1:op%outer%nri + 1))
459 safe_allocate(op%outer%imax(1:op%outer%nri))
460 safe_allocate(op%outer%ri(1:op%stencil%size, 1:op%outer%nri))
468 maxp = op%rimap_inv(ir + 1) + maxval(op%ri(1:op%stencil%size, ir))
472 op%inner%imin(iinner) = op%rimap_inv(ir)
473 op%inner%imax(iinner) = op%rimap_inv(ir + 1)
474 op%inner%np = op%inner%np + op%rimap_inv(ir + 1) - op%rimap_inv(ir)
475 op%inner%ri(1:op%stencil%size, iinner) = op%ri(1:op%stencil%size, ir)
479 op%outer%imin(iouter) = op%rimap_inv(ir)
480 op%outer%imax(iouter) = op%rimap_inv(ir + 1)
481 op%outer%np = op%outer%np + op%rimap_inv(ir + 1) - op%rimap_inv(ir)
482 op%outer%ri(1:op%stencil%size, iouter) = op%ri(1:op%stencil%size, ir)
487 do ir = 1, op%inner%nri
488 do ii = op%inner%imin(ir) + 1, op%inner%imax(ir)
489 assert(all(ii + op%inner%ri(1:op%stencil%size, ir) <= mesh%np))
497 write(flags,
'(i5)') op%stencil%size
498 flags=
'-DSTENCIL_SIZE='//trim(adjustl(flags))
502 if (op%symmetry /= op_general)
then
507 if (op%mesh%parallel_in_domains)
then
508 indirect_arg =
'Indexing::Indirect'
510 indirect_arg =
'Indexing::Direct'
512 select case (op%symmetry)
515 'operate_map<double, '//trim(indirect_arg)//
'>', flags)
518 'operate_map<double, '//trim(indirect_arg)//
', Symmetry::Symmetric>', flags)
521 'operate_map<double, '//trim(indirect_arg)//
', Symmetry::Antisymmetric>', flags)
541 if (op%symmetry /= op_general)
then
543 call accel_write_buffer(op%buff_map_sym, op%mesh%np, (op%rimap - 1)*(op%stencil%size/2))
546 if (op%mesh%parallel_in_domains)
then
548 safe_allocate(inner_points(1:op%mesh%np))
549 safe_allocate(outer_points(1:op%mesh%np))
550 safe_allocate(all_points(1:op%mesh%np))
555 do ii = 1, op%mesh%np
556 all_points(ii) = ii - 1
557 maxp = ii + maxval(op%ri(1:op%stencil%size, op%rimap(ii)))
558 if (maxp <= op%mesh%np)
then
559 op%ninner = op%ninner + 1
560 inner_points(op%ninner) = ii - 1
562 op%nouter = op%nouter + 1
563 outer_points(op%nouter) = ii - 1
576 safe_deallocate_a(inner_points)
577 safe_deallocate_a(outer_points)
578 safe_deallocate_a(all_points)
592 integer :: istencil, idir
596 write(
message(1),
'(3a)')
'Debug info: Finite difference weights for ', trim(this%label),
'.'
597 write(
message(2),
'(a)')
' Spacing:'
598 do idir = 1, this%mesh%box%dim
599 write(
message(2),
'(a,f16.8)') trim(
message(2)), this%mesh%spacing(idir)
603 do istencil = 1, this%stencil%size
604 select case(this%mesh%box%dim)
606 write(
message(1),
'(a,i3,1i4,f25.10)')
' ', istencil, this%stencil%points(1:1, istencil), this%w(istencil, 1)
608 write(
message(1),
'(a,i3,2i4,f25.10)')
' ', istencil, this%stencil%points(1:2, istencil), this%w(istencil, 1)
610 write(
message(1),
'(a,i3,3i4,f25.10)')
' ', istencil, this%stencil%points(1:3, istencil), this%w(istencil, 1)
629 safe_deallocate_a(op%inner%imin)
630 safe_deallocate_a(op%inner%imax)
631 safe_deallocate_a(op%inner%ri)
632 safe_deallocate_a(op%outer%imin)
633 safe_deallocate_a(op%outer%imax)
634 safe_deallocate_a(op%outer%ri)
636 safe_deallocate_a(op%w)
638 safe_deallocate_a(op%ri)
639 safe_deallocate_a(op%rimap)
640 safe_deallocate_a(op%rimap_inv)
641 safe_deallocate_a(op%nn)
643 safe_deallocate_a(op%wpair)
644 safe_deallocate_a(op%ri_pos)
645 safe_deallocate_a(op%ri_neg)
647 safe_deallocate_a(op%inner%ri_pos)
648 safe_deallocate_a(op%inner%ri_neg)
649 safe_deallocate_a(op%outer%ri_pos)
650 safe_deallocate_a(op%outer%ri_neg)
670 if (op%symmetry /= op_general)
then
673 if (op%mesh%parallel_in_domains)
then
683 if (op%symmetry /= op_general)
then
686 if (op%max_allocated_ri_pair_gpu > 0)
then
689 op%max_allocated_ri_pair_gpu = 0
699 integer,
intent(in) :: is
700 integer,
intent(in) :: ip
702 res = ip + op%ri(is, op%rimap(ip))
713 if (accel_is_enabled() .and. op%const_w)
then
714 call accel_create_buffer(op%buff_weights, accel_mem_read_only, type_float, op%stencil%size)
715 call accel_create_buffer(op%buff_half_weights, accel_mem_read_only, type_float, op%stencil%size)
717 call accel_create_buffer(op%buff_wpair, accel_mem_read_only, type_float, op%stencil%size/2)
718 call accel_create_buffer(op%buff_half_wpair, accel_mem_read_only, type_float, op%stencil%size/2)
731 integer(int64) :: buf_size
736 if (accel_is_enabled() .and. op%const_w)
then
737 call accel_write_buffer(op%buff_weights, op%stencil%size, op%w(:, 1))
738 call accel_write_buffer(op%buff_half_weights, op%stencil%size, -m_half*op%w(:, 1))
741 call accel_write_buffer(op%buff_wpair, op%npairs, op%wpair)
742 call accel_write_buffer(op%buff_half_wpair, op%npairs, -m_half*op%wpair)
745 if (op%max_allocated_ri_pair > op%max_allocated_ri_pair_gpu)
then
746 if (op%max_allocated_ri_pair_gpu > 0)
then
747 call accel_free_buffer(op%buff_ri_pos)
748 call accel_free_buffer(op%buff_ri_neg)
750 buf_size = int(op%npairs, int64)*op%nri*op%max_allocated_ri_pair
751 call accel_create_buffer(op%buff_ri_pos, accel_mem_read_only, type_integer, buf_size)
752 call accel_create_buffer(op%buff_ri_neg, accel_mem_read_only, type_integer, buf_size)
753 op%max_allocated_ri_pair_gpu = op%max_allocated_ri_pair
756 if (op%max_allocated_ri_pair > 0)
then
757 call accel_write_buffer(op%buff_ri_pos, op%npairs, op%nri, op%max_allocated_ri_pair, op%ri_pos)
758 call accel_write_buffer(op%buff_ri_neg, op%npairs, op%nri, op%max_allocated_ri_pair, op%ri_neg)
768 integer pure function nl_operator_np_zero_bc(op) result(np_bc)
775 ii = op%rimap_inv(jj + 1) + maxval(op%ri(1:op%stencil%size, jj))
776 np_bc = max(np_bc, ii)
786 type(space_t),
intent(in) :: space
787 class(mesh_t),
intent(in) :: mesh
790 real(real64),
parameter :: tol = 1.0e-14_real64
791 real(real64) :: max_weight, new_w(op%stencil%size)
792 integer :: new_points(space%dim, op%stencil%size)
794 if (.not. op%const_w)
return
798 max_weight = maxval(abs(op%w(:, 1)))
800 do ip = 1, op%stencil%size
803 if (max(abs(op%w(ip, 1)), abs(
partner_weight(ip))) > tol * max_weight)
then
805 new_w(size) = op%w(ip, 1)
806 new_points(:,size) = op%stencil%points(:, ip)
811 op%stencil%size =
size
812 safe_deallocate_a(op%stencil%points)
813 safe_allocate(op%stencil%points(space%dim, op%stencil%size))
814 op%stencil%points(:, :) = new_points(:, 1:size)
815 safe_deallocate_a(op%w)
818 op%w(1:
size, 1) = new_w(1:size)
821 call stencil_init_center(op%stencil)
829 integer,
intent(in) :: ip
835 do jp = 1, op%stencil%size
836 if (all(op%stencil%points(:, jp) + op%stencil%points(:, ip) == 0))
then
845 subroutine group_by_pairs_sym(size, ldf, offsets, wre, ri, nri, npairs, wpair, pair_pos, pair_neg, wcenter)
846 integer,
intent(in) :: size
847 integer,
intent(in) :: ldf
848 integer,
contiguous,
intent(in) :: offsets(:, :)
849 real(real64),
contiguous,
intent(in) :: wre(:)
850 integer,
contiguous,
intent(in) :: ri(:, :)
851 integer,
intent(in) :: nri
852 integer,
intent(out) :: npairs
853 real(real64),
contiguous,
intent(inout) :: wpair(:)
854 integer,
contiguous,
intent(inout) :: pair_pos(:,:), pair_neg(:,:)
855 real(real64),
intent(out) :: wcenter
857 logical,
allocatable :: used(:)
858 integer :: i, j, ndim, s
860 integer,
allocatable :: idx(:)
861 real(real64) :: max_mismatch
863 real(real64),
parameter :: tol = 1.0e-11_real64
867 assert(mod(
size,2) == 1)
869 safe_allocate(used(1:size))
872 max_mismatch = m_zero
874 ndim = ubound(offsets, dim=1)
876 safe_allocate(idx(1:size))
877 call robust_sort_by_abs(wre, offsets, idx)
882 if (all(offsets(:, idx(i))==0))
then
883 wcenter = wre(idx(i))
895 if (any(offsets(:,idx(j))+offsets(:, idx(i)) /= 0)) cycle
898 same = abs(wre(idx(i)) - wre(idx(j))) <= tol*max(m_one, abs(wre(idx(i))))
899 if (.not. same) max_mismatch = max(max_mismatch, abs(wre(idx(i)) - wre(idx(j))))
903 pair_pos(npairs, s) = ri(idx(i), s) * 2**ldf
904 pair_neg(npairs, s) = ri(idx(j), s) * 2**ldf
906 wpair(npairs) = m_half*(wre(idx(i)) + wre(idx(j)))
914 assert(npairs == size/2)
916 if (max_mismatch > m_zero)
then
917 write(message(1),
'(a,es10.3)')
'Symmetric stencil weights differ between partner points by up to ', max_mismatch
918 message(2) =
'They have been averaged. The stencil weights may be ill-conditioned (try a lower DerivativesOrder).'
919 call messages_warning(2)
922 safe_deallocate_a(idx)
929 integer,
intent(in) :: size
930 integer,
intent(in) :: ldf
931 integer,
contiguous,
intent(in) :: offsets(:, :)
932 real(real64),
contiguous,
intent(in) :: wre(:)
933 integer,
contiguous,
intent(in) :: ri(:, :)
934 integer,
intent(in) :: nri
935 integer,
intent(out) :: npairs
936 real(real64),
contiguous,
intent(inout) :: wpair(:)
937 integer,
contiguous,
intent(inout) :: pair_pos(:,:), pair_neg(:,:)
939 logical,
allocatable :: used(:)
940 integer :: i, j, ndim, s
942 integer,
allocatable :: idx(:)
943 real(real64) :: max_mismatch
945 real(real64),
parameter :: tol = 1.0e-11_real64
949 assert(mod(
size,2) == 0)
951 safe_allocate(used(1:size))
954 max_mismatch = m_zero
956 ndim = ubound(offsets, dim=1)
958 safe_allocate(idx(1:size))
959 call robust_sort_by_abs(wre, offsets, idx)
971 if (any(offsets(:,idx(j))+offsets(:, idx(i)) /= 0)) cycle
974 same = abs(wre(idx(i)) + wre(idx(j))) <= tol*max(m_one, abs(wre(idx(i))))
975 if (.not. same) max_mismatch = max(max_mismatch, abs(wre(idx(i)) + wre(idx(j))))
979 pair_pos(npairs, s) = ri(idx(i), s) * 2**ldf
980 pair_neg(npairs, s) = ri(idx(j), s) * 2**ldf
982 wpair(npairs) = m_half*(wre(idx(i)) - wre(idx(j)))
990 assert(npairs == size/2)
992 if (max_mismatch > m_zero)
then
993 write(message(1),
'(a,es10.3)')
'Antisymmetric stencil weights differ between partner points by up to ', max_mismatch
994 message(2) =
'They have been averaged. The stencil weights may be ill-conditioned (try a lower DerivativesOrder).'
995 call messages_warning(2)
998 safe_deallocate_a(idx)
1005 integer,
optional,
intent(in) :: max_size
1007 integer :: ldf, start, end, ipair
1015 if(
present(max_size))
then
1016 start = op%max_allocated_ri_pair + 1
1018 call reallocate_array(op%ri_pos, op%stencil%size/2, op%nri, op%max_allocated_ri_pair,
end)
1019 call reallocate_array(op%ri_neg, op%stencil%size/2, op%nri, op%max_allocated_ri_pair,
end)
1020 if (op%mesh%parallel_in_domains)
then
1021 call reallocate_array(op%inner%ri_pos, op%stencil%size/2, op%inner%nri, op%max_allocated_ri_pair,
end)
1022 call reallocate_array(op%inner%ri_neg, op%stencil%size/2, op%inner%nri, op%max_allocated_ri_pair,
end)
1023 call reallocate_array(op%outer%ri_pos, op%stencil%size/2, op%outer%nri, op%max_allocated_ri_pair,
end)
1024 call reallocate_array(op%outer%ri_neg, op%stencil%size/2, op%outer%nri, op%max_allocated_ri_pair,
end)
1026 else if (
allocated(op%wpair))
then
1029 end = op%max_allocated_ri_pair
1032 safe_allocate(op%wpair(1:op%stencil%size/2))
1035 if (conf%target_states_block_size > 0)
then
1036 end = log2(conf%target_states_block_size)+1
1041 safe_allocate(op%ri_pos(1:op%stencil%size/2, 1:op%nri, 1:
end))
1042 safe_allocate(op%ri_neg(1:op%stencil%size/2, 1:op%nri, 1:
end))
1043 if (op%mesh%parallel_in_domains)
then
1044 safe_allocate(op%inner%ri_pos(1:op%stencil%size/2, 1:op%inner%nri, 1:
end))
1045 safe_allocate(op%inner%ri_neg(1:op%stencil%size/2, 1:op%inner%nri, 1:
end))
1046 safe_allocate(op%outer%ri_pos(1:op%stencil%size/2, 1:op%outer%nri, 1:
end))
1047 safe_allocate(op%outer%ri_neg(1:op%stencil%size/2, 1:op%outer%nri, 1:
end))
1050 op%max_allocated_ri_pair =
end
1052 do ldf = start-1,
end-1
1053 select case(op%symmetry)
1055 call group_by_pairs_sym(op%stencil%size, ldf, op%stencil%points, op%w(:,1), op%ri, op%nri, &
1056 op%npairs, op%wpair, op%ri_pos(:,:,ldf+1), op%ri_neg(:,:,ldf+1), op%wcenter)
1057 if (op%mesh%parallel_in_domains)
then
1058 call group_by_pairs_sym(op%stencil%size, ldf, op%stencil%points, op%w(:,1), op%inner%ri, op%inner%nri, &
1059 op%npairs, op%wpair, op%inner%ri_pos(:,:,ldf+1), op%inner%ri_neg(:,:,ldf+1), op%wcenter)
1060 call group_by_pairs_sym(op%stencil%size, ldf, op%stencil%points, op%w(:,1), op%outer%ri, op%outer%nri, &
1061 op%npairs, op%wpair, op%outer%ri_pos(:,:,ldf+1), op%outer%ri_neg(:,:,ldf+1), op%wcenter)
1065 op%npairs, op%wpair, op%ri_pos(:,:,ldf+1), op%ri_neg(:,:,ldf+1))
1066 if (op%mesh%parallel_in_domains)
then
1067 call group_by_pairs_antisym(op%stencil%size, ldf, op%stencil%points, op%w(:,1), op%inner%ri, op%inner%nri, &
1068 op%npairs, op%wpair, op%inner%ri_pos(:,:,ldf+1), op%inner%ri_neg(:,:,ldf+1))
1069 call group_by_pairs_antisym(op%stencil%size, ldf, op%stencil%points, op%w(:,1), op%outer%ri, op%outer%nri, &
1070 op%npairs, op%wpair, op%outer%ri_pos(:,:,ldf+1), op%outer%ri_neg(:,:,ldf+1))
1075 if (.not.
present(max_size))
then
1076 write(message(1),
'(3a)')
'Debug info: Sorted weights for ', trim(op%label),
'.'
1077 call messages_info(1, debug_only=.
true.)
1079 do ipair = 1, op%npairs
1080 write(message(1),
'(a,i3,f25.10,2(1x,i8))')
' ', ipair, op%wpair(ipair), op%ri_pos(ipair,1,1), op%ri_neg(ipair,1,1)
1081 call messages_info(1, debug_only=.
true.)
1090 integer,
allocatable,
intent(inout) :: ri(:,:,:)
1091 integer,
intent(in) :: stencil_size, nri
1092 integer,
intent(in) :: old_size, new_size
1094 integer,
allocatable :: tmp(:,:,:)
1096 safe_allocate_source_a(tmp, ri)
1097 safe_deallocate_a(ri)
1098 safe_allocate(ri(1:stencil_size, 1:nri, 1:new_size))
1099 ri(:,:,1:old_size) = tmp
1100 safe_deallocate_a(tmp)
1105#include "nl_operator_inc.F90"
1108#include "complex.F90"
1109#include "nl_operator_inc.F90"
subroutine, public accel_free_buffer(this, async)
subroutine, public accel_kernel_build(this, file_name, kernel_name, flags)
Compile the program that contains a given kernel.
pure logical function, public accel_is_enabled()
integer, parameter, public accel_mem_read_only
integer pure function, public accel_max_block_size()
This module implements batches of mesh functions.
Module implementing boundary conditions in Octopus.
real(real64), parameter, public m_zero
This module implements the index, used for the mesh points.
This module is intended to contain "only mathematical" functions and procedures.
This module defines the meshes, which are used in Octopus.
integer function, public mesh_local_index_from_coords(mesh, ix)
This function returns the local index of the point for a given vector of integer coordinates.
subroutine, public mesh_local_index_to_coords(mesh, ip, ix)
Given a local point index, this function returns the set of integer coordinates of the point.
subroutine, public messages_not_implemented(feature, namespace)
subroutine, public messages_obsolete_variable(namespace, name, rep)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_input_error(namespace, var, details, row, column)
subroutine, public messages_experimental(name, namespace)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
This module handles the communicators for the various parallelization strategies.
This module defines non-local operators.
subroutine, public dnl_operator_operate_diag(op, fo)
integer, parameter op_map
integer, parameter op_max
integer, parameter op_vec
subroutine, public nl_operator_init(op, label, symm)
initialize an instance of a non-local operator by setting the label
subroutine, public dnl_operator_operate_batch(op, fi, fo, ghost_update, profile, points, factor, async)
subroutine nl_operator_clear_gpu_buffers(op)
subroutine, public nl_operator_build_symmetric_weights(op, max_size)
Builds (or rebuild) the necessary arrays for symmetric and antisymmetric stencils.
integer, parameter, public op_all
subroutine group_by_pairs_sym(size, ldf, offsets, wre, ri, nri, npairs, wpair, pair_pos, pair_neg, wcenter)
Take a list of weights and offsets and build pairs of symmetric points with common weights.
subroutine group_by_pairs_antisym(size, ldf, offsets, wre, ri, nri, npairs, wpair, pair_pos, pair_neg)
Take a list of weights and offsets and build pairs of symmetric points with common weights.
subroutine, public dnl_operator_operate(op, fi, fo, ghost_update, profile, points)
subroutine, public nl_operator_update_gpu_buffers(op)
subroutine, public nl_operator_global_init(namespace)
initialize global settings for non-local operators
subroutine, public nl_operator_output_weights(this)
integer, parameter, public op_general
subroutine, public nl_operator_end(op)
integer, parameter, public op_inner
subroutine, public znl_operator_operate(op, fi, fo, ghost_update, profile, points)
subroutine, public nl_operator_remove_zero_weight_points(op, space, mesh)
Removes the zero-weight points for constant weight stencils.
integer, parameter op_invmap
integer, parameter, public op_symmetric
subroutine, public nl_operator_global_end()
integer, parameter, public op_outer
subroutine, public nl_operator_build(space, mesh, op, np, const_w, regenerate)
Creates the nonlocal operators for the stencils used for finite differences.
subroutine, public znl_operator_operate_batch(op, fi, fo, ghost_update, profile, points, factor, async)
integer pure function, public nl_operator_np_zero_bc(op)
integer, parameter, public op_antisymmetric
subroutine, public znl_operator_operate_diag(op, fo)
integer, parameter op_fortran
subroutine reallocate_array(ri, stencil_size, nri, old_size, new_size)
Reallocate an ri array.
integer pure function, public nl_operator_get_index(op, is, ip)
subroutine, public nl_operator_allocate_gpu_buffers(op)
integer, parameter op_min
This module contains interfaces for routines in operate.c.
Some general things and nomenclature:
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
This module is intended to contain "only mathematical" functions and procedures.
This module defines stencils used in Octopus.
subroutine, public stencil_end(this)
type(type_t), parameter, public type_integer
real(real64) function partner_weight(ip)
Weight of the point with the opposite offset (the point itself for general operators)
Describes mesh distribution to nodes.
index type for non-local operators
data type for non local operators