42 use,
intrinsic :: iso_fortran_env
108 integer,
parameter :: &
109 DER_BC_ZERO_F = 0, & !< function is zero at the boundaries
113 integer,
parameter,
public :: &
120 integer,
parameter :: &
128 type(boundaries_t) :: boundaries
129 type(mesh_t),
pointer :: mesh => null()
131 integer :: periodic_dim = 0
133 integer :: stencil_type = 0
136 logical,
private :: stencil_primitive_coordinates
138 class(coordinate_system_t),
private,
pointer :: coord_system
139 logical :: remove_zero_weight_points
140 logical :: symmetrize_grad
141 type(symmetries_t) :: symm
143 real(real64),
allocatable :: masses(:)
147 real(real64),
private :: lapl_cutoff =
m_zero
149 type(nl_operator_t),
allocatable,
private :: op(:)
151 type(nl_operator_t),
pointer :: lapl => null()
152 type(nl_operator_t),
pointer :: grad(:) => null()
154 integer,
allocatable :: n_ghost(:)
156 integer,
private :: comm_method = 0
158 type(derivatives_t),
pointer :: finer => null()
159 type(derivatives_t),
pointer :: coarser => null()
160 type(transfer_table_t),
pointer :: to_finer => null()
161 type(transfer_table_t),
pointer :: to_coarser => null()
168 type(par_vec_handle_batch_t) :: pv_h
170 type(derivatives_t),
pointer :: der
171 type(nl_operator_t),
pointer :: op
172 type(batch_t),
pointer :: ff
173 type(batch_t),
pointer :: opff
174 logical :: ghost_update
175 logical :: factor_present
176 real(real64) :: factor
179 type(accel_kernel_t) :: kernel_uvw_xyz, kernel_dcurl, kernel_zcurl
184 subroutine derivatives_init(der, namespace, space, coord_system, symm, order)
187 class(
space_t),
intent(in) :: space
190 integer,
optional,
intent(in) :: order
193 integer :: default_stencil
194 logical :: stencil_primitive_coordinates
195 character(len=128) :: kernel_name
200 assert(.not. coord_system%local_basis .or. coord_system%orthogonal)
204 der%periodic_dim = space%periodic_dim
205 der%coord_system => coord_system
230 default_stencil = der_star
234 call parse_variable(namespace,
'DerivativesStencil', default_stencil, der%stencil_type)
244 if (.not. coord_system%orthogonal .and. &
247 'stencil_star and stencil_variational cannot be used for non-orthogonal cells. Use stencil_stargeneral.')
281 if (
present(order))
then
293 call parse_variable(namespace,
'DerivativesRemoveZeroWeightPoints', .
true., der%remove_zero_weight_points)
306 call parse_variable(namespace,
'DerivativesSymmetrizeGradient', .
true., der%symmetrize_grad)
308 if (
allocated(symm%ops)) der%symm = symm
349 stencil_primitive_coordinates = .not. coord_system%local_basis
350 call parse_variable(namespace,
'StencilPrimitiveCoordinates', stencil_primitive_coordinates, der%stencil_primitive_coordinates)
353 safe_allocate(der%masses(1:space%dim))
357 safe_allocate(der%op(1:der%dim + 1))
359 der%lapl => der%op(der%dim + 1)
365 safe_allocate(der%n_ghost(1:der%dim))
368 der%n_ghost(idir) = maxval(abs(der%lapl%stencil%points(idir, :)))
373 nullify(der%to_coarser)
374 nullify(der%to_finer)
378 select type (coord_system)
382 if (der%dim > 3)
then
383 message(1) =
"Calculation of derivatives on the GPU with dimension > 3 are only implemented for Cartesian coordinates."
387 write(kernel_name,
'(a,i1,a)')
'uvw_to_xyz<double, Dim::D', der%dim, &
388 repeat(
', double*, int, double*, int', der%dim)//
'>'
408 assert(
allocated(der%op))
410 do idim = 1, der%dim+1
414 safe_deallocate_a(der%masses)
416 safe_deallocate_a(der%n_ghost)
418 safe_deallocate_a(der%op)
419 nullify(der%lapl, der%grad)
423 nullify(der%to_coarser)
424 nullify(der%to_finer)
436 class(
space_t),
intent(in) :: space
438 character(len=80),
optional,
intent(in) :: name
439 integer,
optional,
intent(in) :: order
441 character(len=80) :: name_
453 select case (der%stencil_type)
473 real(real64),
contiguous,
intent(out) :: lapl(:)
477 assert(ubound(lapl, dim=1) >= der%mesh%np)
493 character :: dir_label
497 assert(
associated(der%grad))
507 select case (der%stencil_type)
570 subroutine derivatives_build(der, namespace, space, mesh, stencil, qvector, regenerate, verbose)
573 class(
space_t),
intent(in) :: space
574 class(
mesh_t),
target,
intent(in) :: mesh
576 real(real64),
contiguous,
optional,
intent(in) :: qvector(:)
578 logical,
optional,
intent(in) :: regenerate
579 logical,
optional,
intent(in) :: verbose
583 integer :: np_zero_bc
591 assert(
allocated(der%op))
592 assert(der%stencil_type >= der_star .and. der%stencil_type <=
der_stargeneral)
593 assert(.not.(der%stencil_type ==
der_variational .and. mesh%use_curvilinear))
600 if (mesh%use_curvilinear) const_w_ = .false.
607 safe_deallocate_a(der%op(i)%w)
615 call nl_operator_build(space, mesh, der%op(i), der%mesh%np, const_w = const_w_, &
616 regenerate=regenerate)
620 assert(np_zero_bc > mesh%np .and. np_zero_bc <= mesh%np_part)
622 select case (der%stencil_type)
625 do i = 1, der%dim + 1
651 if (der%symmetrize_grad .and. const_w_ .and. .not. mesh%coord_system%orthogonal)
then
669 class(
space_t),
intent(in) :: space
670 class(
mesh_t),
intent(in) :: mesh
673 integer :: dim, nrot, nops, iop, idir, jdir, ip, jp, is, npoints, nsym, nkeep
674 integer :: mat(der%dim, der%dim), pt(der%dim)
675 integer,
allocatable :: mm(:,:,:), points(:,:), sym_points(:,:), keep(:)
676 real(real64) :: chi(der%dim), jac(der%dim, der%dim), jac_inv(der%dim, der%dim), tmp(der%dim, der%dim)
677 real(real64) :: wpair(der%dim), max_weight
678 real(real64),
allocatable :: rot(:,:,:), wcart(:,:), wsym(:,:), wprim(:)
679 real(real64),
parameter :: tol = 1.0e-10_real64
685 if (
allocated(der%symm%point_group)) nrot = ubound(der%symm%point_group, dim=3)
686 if (dim > 3 .or. nrot <= 1 .or. any(abs(der%masses -
m_one) >
m_epsilon))
then
694 jac = mesh%coord_system%jacobian(chi)
695 jac_inv = mesh%coord_system%jacobian_inverse(chi)
700 safe_allocate(mm(1:dim, 1:dim, 1:nrot))
701 safe_allocate(rot(1:dim, 1:dim, 1:nrot))
705 mat(:, jdir) = mesh%idx%ll(1:dim) * der%symm%point_group(1:dim, jdir, iop)
707 if (any([(mod(mat(:, jdir), mesh%idx%ll(jdir)) /= 0, jdir = 1, dim)])) cycle
709 mat(:, jdir) = mat(:, jdir) / mesh%idx%ll(jdir)
710 tmp(:, jdir) = mesh%spacing(1:dim) * mat(:, jdir) / mesh%spacing(jdir)
712 tmp = matmul(jac, matmul(tmp, jac_inv))
716 rot(:, :, nops) = tmp
720 npoints = sum([(der%grad(idir)%stencil%size, idir = 1, dim)])
721 safe_allocate(points(1:dim, 1:npoints))
722 safe_allocate(wcart(1:dim, 1:npoints))
726 do ip = 1, der%grad(idir)%stencil%size
727 call add_point(der%grad(idir)%stencil%points(:, ip), points, npoints, jp)
728 wcart(:, jp) = wcart(:, jp) + jac_inv(idir, :) * der%grad(idir)%w(ip, 1)
734 safe_allocate(sym_points(1:dim, 1:npoints*nops))
735 safe_allocate(wsym(1:dim, 1:npoints*nops))
740 pt = matmul(mm(:, :, iop), points(:, ip))
741 if (.not. any([(all(stencil%points(1:dim, is) == pt), is = 1, stencil%size)]))
then
742 message(1) =
"The symmetrized gradient does not fit in the stencil of the grid."
743 message(2) =
"The gradient is not symmetrized."
745 safe_deallocate_a(mm)
746 safe_deallocate_a(rot)
747 safe_deallocate_a(points)
748 safe_deallocate_a(wcart)
749 safe_deallocate_a(sym_points)
750 safe_deallocate_a(wsym)
755 wsym(:, jp) = wsym(:, jp) + matmul(rot(:, :, iop), wcart(:, ip)) / nops
761 call add_point(-sym_points(:, ip), sym_points, nsym, jp)
763 wpair =
m_half * (wsym(:, ip) - wsym(:, jp))
766 else if (jp == ip)
then
772 safe_allocate(wprim(1:nsym))
773 safe_allocate(keep(1:nsym))
775 wprim = matmul(jac(:, idir), wsym(:, 1:nsym))
776 max_weight = maxval(abs(wprim))
777 nkeep = count(abs(wprim) > tol * max_weight)
778 keep(1:nkeep) = pack([(ip, ip = 1, nsym)], abs(wprim) > tol * max_weight)
782 der%grad(idir)%stencil%points(:, :) = sym_points(:, keep(1:nkeep))
786 der%grad(idir)%w(:, 1) = wprim(keep(1:nkeep))
794 safe_deallocate_a(mm)
795 safe_deallocate_a(rot)
796 safe_deallocate_a(points)
797 safe_deallocate_a(wcart)
798 safe_deallocate_a(sym_points)
799 safe_deallocate_a(wsym)
800 safe_deallocate_a(wprim)
801 safe_deallocate_a(keep)
809 integer,
intent(in) :: pt(:)
810 integer,
intent(inout) :: list(:,:)
811 integer,
intent(inout) :: n
812 integer,
intent(out) :: ind
815 if (all(list(:, ind) == pt))
return
824 subroutine stencil_pol_grad(stencil_type, dim, direction, order, polynomials)
825 integer,
intent(in) :: stencil_type
826 integer,
intent(in) :: dim
827 integer,
intent(in) :: direction
828 integer,
intent(in) :: order
829 integer,
contiguous,
intent(inout) :: polynomials(:, :)
831 select case (stencil_type)
844 integer,
intent(in) :: stencil_type
846 integer,
intent(in) :: dim
847 integer,
intent(in) :: order
848 integer,
contiguous,
intent(inout) :: polynomials(:, :)
850 select case (stencil_type)
865 subroutine get_rhs_lapl(coord_system, polynomials, chi, rhs, stencil_primitive_coordinates)
867 integer,
contiguous,
intent(in) :: polynomials(:,:)
868 real(real64),
contiguous,
intent(in) :: chi(:)
869 real(real64),
contiguous,
intent(out) :: rhs(:)
870 logical,
intent(in) :: stencil_primitive_coordinates
872 integer :: i, j, k, dim
873 real(real64) :: metric_inverse(1:size(polynomials, dim=1), 1:size(polynomials, dim=1))
874 real(real64) :: hessian_trace(1:size(polynomials, dim=1))
875 integer :: powers(0:2)
879 dim =
size(polynomials, dim=1)
881 if (stencil_primitive_coordinates)
then
883 metric_inverse = coord_system%metric_inverse(chi)
884 hessian_trace = coord_system%trace_hessian(chi)
889 metric_inverse(i, i) =
m_one
896 do j = 1,
size(polynomials, dim=2)
900 if (polynomials(i, j) <= 2)
then
901 powers(polynomials(i, j)) = powers(polynomials(i, j)) + 1
907 if (powers(2) == 1 .and. powers(0) == dim - 1)
then
909 if (polynomials(i, j) == 2)
then
910 rhs(j) =
m_two*metric_inverse(i, i)
916 if (powers(1) == 2 .and. powers(0) == dim - 2)
then
918 if (polynomials(i, j) == 1)
then
920 if (polynomials(k, j) == 1)
then
921 rhs(j) = metric_inverse(i, k) + metric_inverse(k, i)
930 if (powers(1) == 1 .and. powers(0) == dim - 1)
then
932 if (polynomials(i, j) == 1)
then
933 rhs(j) = hessian_trace(i)
944 integer,
contiguous,
intent(in) :: polynomials(:,:)
945 integer,
intent(in) :: dir
946 real(real64),
contiguous,
intent(out) :: rhs(:)
953 dim =
size(polynomials, dim=1)
957 do j = 1,
size(polynomials, dim=2)
960 if (k == dir .and. polynomials(k, j) /= 1) this_one = .false.
961 if (k /= dir .and. polynomials(k, j) /= 0) this_one = .false.
963 if (this_one) rhs(j) =
m_one
972 space, name, verbose, order)
975 integer,
intent(in) :: nderiv
976 integer,
intent(in) :: ideriv
978 type(
space_t),
intent(in) :: space
979 character(len=80),
optional,
intent(in) :: name
980 logical,
optional,
intent(in) :: verbose
981 integer,
optional,
intent(in) :: order
983 integer :: p, p_max, i, j, k, pow_max, order_
984 real(real64) :: x(der%dim)
985 real(real64),
allocatable :: mat(:,:), sol(:,:), powers(:,:)
986 integer,
allocatable :: pol(:,:)
987 real(real64),
allocatable :: rhs(:,:)
988 character(len=80) :: name_
994 safe_allocate(rhs(1:op(1)%stencil%size, nderiv))
995 safe_allocate(pol(1:der%dim, 1:op(1)%stencil%size))
997 if (nderiv == 1)
then
998 if (ideriv <= der%dim)
then
1002 call stencil_pol_lapl(der%stencil_type, op(1)%stencil, der%dim, order_, pol)
1005 else if (nderiv == der%dim)
then
1012 message(1) =
"Error: derivatives_make_discretization can only be called with nderiv = 1 or der%dim."
1016 safe_allocate(mat(1:op(1)%stencil%size, 1:op(1)%stencil%size))
1017 safe_allocate(sol(1:op(1)%stencil%size, 1:nderiv))
1021 message(1) =
'Info: Generating weights for finite-difference discretization of ' // trim(name_)
1026 pow_max = maxval(pol)
1027 safe_allocate(powers(1:der%dim, 0:pow_max))
1032 if (op(1)%const_w) p_max = 1
1037 if (nderiv == 1)
then
1038 if (ideriv <= der%dim)
then
1042 call get_rhs_lapl(der%mesh%coord_system, pol, der%mesh%chi(:, p), rhs(:,1), der%stencil_primitive_coordinates)
1044 else if (nderiv == der%dim)
then
1055 do i = 1, op(1)%stencil%size
1056 if (ideriv <= der%dim)
then
1058 x = real(op(1)%stencil%points(:, i), real64)*der%mesh%spacing
1061 if (der%stencil_primitive_coordinates)
then
1062 x = real(op(1)%stencil%points(:, i), real64)*der%mesh%spacing
1064 x = der%mesh%x(:, p + op(1)%ri(i, op(1)%rimap(p))) - der%mesh%x(:, p)
1069 x = x*
sqrt(der%masses)
1074 powers(:, k) = x*powers(:, k-1)
1079 do j = 2, op(1)%stencil%size
1080 mat(j, i) = powers(1, pol(1, j))
1082 mat(j, i) = mat(j, i)*powers(k, pol(k, j))
1094 op(i)%w(:, p) = sol(:, i)
1096 if (op(i)%symmetry ==
op_antisymmetric .and. op(i)%stencil%center > 0)
then
1097 op(i)%w(op(i)%stencil%center, p) =
m_zero
1104 if (der%remove_zero_weight_points)
then
1108 if (op(i)%const_w)
then
1121 safe_deallocate_a(mat)
1122 safe_deallocate_a(sol)
1123 safe_deallocate_a(powers)
1124 safe_deallocate_a(pol)
1125 safe_deallocate_a(rhs)
1132 logical function derivatives_overlap(this)
result(overlap)
1135 push_sub(derivatives_overlap)
1137 overlap = this%comm_method /= blocking
1139 pop_sub(derivatives_overlap)
1140 end function derivatives_overlap
1148 class(
space_t),
intent(in) :: space
1149 character(len=80),
intent(in) :: name
1150 integer,
intent(in) :: order
1155 call nl_operator_build(space, this%mesh, op(1), this%mesh%np, const_w = .not. this%mesh%use_curvilinear)
1177 logical :: mask(1:this%mesh%np)
1178 integer :: ip, is, index
1182 do ip = 1, this%mesh%np
1184 do is = 1, this%lapl%stencil%size
1188 if (index > this%mesh%np + this%mesh%pv%np_ghost)
then
1211 .and. .not. this%mesh%use_curvilinear)
then
1213 do i = 1, this%lapl%stencil%size
1215 (-1)**maxval(abs(this%lapl%stencil%points(:, i)))*this%lapl%w(i, 1)
1222 m_pi**2/this%mesh%spacing(i)**2
1231 class(coordinate_system_t),
target,
intent(in) :: coord_system
1233 der%coord_system => coord_system
1238#include "derivatives_inc.F90"
1241#include "complex.F90"
1242#include "derivatives_inc.F90"
subroutine add_point(pt, list, n, ind)
Returns in ind the index of point in the list, adding it if needed.
double sqrt(double __x) __attribute__((__nothrow__
subroutine, public accel_kernel_start_call(this, file_name, kernel_name, flags)
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()
This module implements batches of mesh functions.
This module implements common operations on batches of mesh functions.
Module implementing boundary conditions in Octopus.
subroutine, public boundaries_end(this)
subroutine, public boundaries_init(this, namespace, space, mesh, qvector)
initialize the boundary contitions
This module implements the curvilinear coordinates given in E.L. Briggs, D.J. Sullivan,...
This module implements the curvilinear coordinates given in F. Gygi and G. Galli, PRB 52 R2229 (1996)...
This module implements the curvilinear coordinates given in N. A. Modine, G. Zumbach,...
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
subroutine, public zderivatives_curl(der, ff, op_ff, ghost_update, set_bc)
apply the curl operator to a vector of mesh functions
subroutine, public dderivatives_perform(op, der, ff, op_ff, ghost_update, set_bc, factor)
apply a nl_operator to a mesh function
subroutine, public derivatives_build(der, namespace, space, mesh, stencil, qvector, regenerate, verbose)
build the derivatives object:
subroutine, public derivatives_lapl_diag(der, lapl)
Returns the diagonal elements of the Laplacian, needed for preconditioning.
integer, parameter, public der_cube
subroutine, public dderivatives_batch_curl_from_gradient(der, ffb, gradb)
calculate the curl from a batch and its gradient
subroutine derivatives_make_discretization(namespace, der, nderiv, ideriv, op, space, name, verbose, order)
subroutine, public dderivatives_batch_grad(der, ffb, opffb, ghost_update, set_bc, to_cartesian, factor)
apply the gradient to a batch of mesh functions
subroutine stencil_pol_grad(stencil_type, dim, direction, order, polynomials)
subroutine stencil_pol_lapl(stencil_type, stencil, dim, order, polynomials)
subroutine, public zderivatives_batch_curl_from_gradient(der, ffb, gradb)
calculate the curl from a batch and its gradient
subroutine, public zderivatives_batch_div(der, ffb, opffb, ghost_update, set_bc, to_cartesian)
calculate the divergence of a vector of batches
subroutine, public dderivatives_partial(der, ff, op_ff, dir, ghost_update, set_bc)
apply the partial derivative along dir to a mesh function
subroutine get_rhs_lapl(coord_system, polynomials, chi, rhs, stencil_primitive_coordinates)
subroutine, public dderivatives_batch_perform(op, der, ff, opff, ghost_update, set_bc, factor, async)
apply an operator to a bach of mesh functions
subroutine, public zderivatives_div(der, ff, op_ff, ghost_update, set_bc, to_cartesian)
apply the divergence operator to a vector of mesh functions
integer, parameter der_bc_period
boundary is periodic
subroutine, public dderivatives_batch_finish(handle, async)
apply a non-local operator to a batch (2nd part)
subroutine, public dderivatives_curl(der, ff, op_ff, ghost_update, set_bc)
apply the curl operator to a vector of mesh functions
subroutine derivatives_get_stencil_grad(der)
subroutine derivatives_symmetrize_grad(der, space, mesh, stencil)
Symmetrizes the gradient operators over the point group of the structure.
subroutine, public dderivatives_grad(der, ff, op_ff, ghost_update, set_bc, to_cartesian)
apply the gradient to a mesh function
subroutine derivatives_get_stencil_lapl(der, lapl, space, coord_system, name, order)
subroutine, public derivatives_end(der)
integer, parameter der_bc_zero_df
first derivative of the function is zero
subroutine, public zderivatives_batch_grad(der, ffb, opffb, ghost_update, set_bc, to_cartesian, factor)
apply the gradient to a batch of mesh functions
subroutine, public dderivatives_batch_div(der, ffb, opffb, ghost_update, set_bc, to_cartesian)
calculate the divergence of a vector of batches
subroutine, public derivatives_get_lapl(this, namespace, op, space, name, order)
subroutine, public zderivatives_batch_perform(op, der, ff, opff, ghost_update, set_bc, factor, async)
apply an operator to a bach of mesh functions
subroutine, public dderivatives_batch_start(op, der, ff, opff, handle, ghost_update, set_bc, factor)
apply a non-local operator to a batch (1st part)
subroutine get_rhs_grad(polynomials, dir, rhs)
subroutine, public dderivatives_lapl(der, ff, op_ff, ghost_update, set_bc, factor)
apply the Laplacian to a mesh function
real(real64) function, public derivatives_lapl_get_max_eigenvalue(this)
Get maximum eigenvalue of discrete Laplacian. For the star and star_general stencils,...
subroutine, public dderivatives_batch_curl(der, ffb, ghost_update, set_bc)
apply the curl to a batch of mesh functions
subroutine, public zderivatives_grad(der, ff, op_ff, ghost_update, set_bc, to_cartesian)
apply the gradient to a mesh function
subroutine, public derivatives_init(der, namespace, space, coord_system, symm, order)
subroutine, public zderivatives_partial(der, ff, op_ff, dir, ghost_update, set_bc)
apply the partial derivative along dir to a mesh function
subroutine, public zderivatives_batch_start(op, der, ff, opff, handle, ghost_update, set_bc, factor)
apply a non-local operator to a batch (1st part)
logical function, dimension(1:this%mesh%np), public derivatives_get_inner_boundary_mask(this)
This function tells whether a point in the grid is contained in a layer of the width of the stencil b...
integer, parameter, public der_starplus
subroutine, public zderivatives_perform(op, der, ff, op_ff, ghost_update, set_bc, factor)
apply a nl_operator to a mesh function
subroutine, public zderivatives_batch_curl(der, ffb, ghost_update, set_bc)
apply the curl to a batch of mesh functions
integer, parameter, public der_variational
subroutine, public zderivatives_lapl(der, ff, op_ff, ghost_update, set_bc, factor)
apply the Laplacian to a mesh function
subroutine, public derivates_set_coordinates_system(der, coord_system)
subroutine, public zderivatives_batch_finish(handle, async)
apply a non-local operator to a batch (2nd part)
subroutine, public dderivatives_div(der, ff, op_ff, ghost_update, set_bc, to_cartesian)
apply the divergence operator to a vector of mesh functions
integer, parameter non_blocking
integer, parameter, public der_stargeneral
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_pi
some mathematical constants
real(real64), parameter, public m_epsilon
real(real64), parameter, public m_half
real(real64), parameter, public m_one
This module is intended to contain "only mathematical" functions and procedures.
This module defines the meshes, which are used in Octopus.
subroutine, public messages_warning(no_lines, all_nodes, 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_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_input_error(namespace, var, details, row, column)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
This module defines non-local operators.
subroutine, public dnl_operator_operate_diag(op, fo)
subroutine, public nl_operator_init(op, label, symm)
initialize an instance of a non-local operator by setting the label
subroutine, public nl_operator_build_symmetric_weights(op, max_size)
Builds (or rebuild) the necessary arrays for symmetric and antisymmetric stencils.
subroutine, public nl_operator_update_gpu_buffers(op)
subroutine, public nl_operator_output_weights(this)
subroutine, public nl_operator_end(op)
subroutine, public nl_operator_remove_zero_weight_points(op, space, mesh)
Removes the zero-weight points for constant weight stencils.
integer, parameter, public op_symmetric
subroutine, public nl_operator_build(space, mesh, op, np, const_w, regenerate)
Creates the nonlocal operators for the stencils used for finite differences.
integer pure function, public nl_operator_np_zero_bc(op)
integer, parameter, public op_antisymmetric
integer pure function, public nl_operator_get_index(op, is, ip)
subroutine, public nl_operator_allocate_gpu_buffers(op)
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 defines routines, generating operators for a cubic stencil.
subroutine, public stencil_cube_get_lapl(this, dim, order)
subroutine, public stencil_cube_polynomials_lapl(dim, order, pol)
subroutine, public stencil_cube_get_grad(this, dim, order)
This module defines stencils used in Octopus.
subroutine, public stencil_allocate(this, dim, size)
subroutine, public stencil_init_center(this)
set the index of the central point of the stencil
This module defines routines, generating operators for a star stencil.
subroutine, public stencil_star_get_grad(this, dim, dir, order)
subroutine, public stencil_star_get_lapl(this, dim, order)
subroutine, public stencil_star_polynomials_grad(dir, order, pol)
subroutine, public stencil_star_polynomials_lapl(dim, order, pol)
This module defines routines, generating operators for a generalized star stencil.
subroutine, public stencil_stargeneral_get_arms(this, dim, coord_system)
Finds the direction of the arms of the star-general stencil as described in Natan et al....
subroutine, public stencil_stargeneral_pol_lapl(this, dim, order, pol)
subroutine, public stencil_stargeneral_get_lapl(this, dim, order)
This module defines routines, generating operators for a stencil consisting of a star and a cross....
subroutine, public stencil_starplus_pol_grad(dim, dir, order, pol)
subroutine, public stencil_starplus_pol_lapl(dim, order, pol)
subroutine, public stencil_starplus_get_lapl(this, dim, order)
subroutine, public stencil_starplus_get_grad(this, dim, dir, order)
Implements the variational discretization of the Laplacian as proposed by P. Maragakis,...
subroutine, public stencil_variational_coeff_lapl(dim, order, h, lapl, alpha)
real(real64), public symprec
This module is intended to contain simple general-purpose utility functions and procedures.
character pure function, public index2axis(idir)
abstract class to describe coordinate systems
handle to transfer data from the start() to finish() calls.
class representing derivatives
Describes mesh distribution to nodes.
data type for non local operators
The class representing the stencil, which is used for non-local mesh operations.