Octopus
|
This module calculates the derivatives (gradients, Laplacians, etc.) of a function. More...
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
Data Types | |
type | derivatives_handle_batch_t |
handle to transfer data from the start() to finish() calls. More... | |
type | derivatives_t |
class representing derivatives More... | |
Functions/Subroutines | |
subroutine, public | derivatives_init (der, namespace, space, coord_system, order) |
subroutine, public | derivatives_end (der) |
subroutine | derivatives_get_stencil_lapl (der, space, coord_system) |
subroutine, public | derivatives_lapl_diag (der, lapl) |
Returns the diagonal elements of the Laplacian, needed for preconditioning. More... | |
subroutine | derivatives_get_stencil_grad (der) |
subroutine, public | derivatives_build (der, namespace, space, mesh, qvector, regenerate, verbose) |
build the derivatives object: More... | |
subroutine | get_rhs_lapl (der, polynomials, rhs) |
subroutine | get_rhs_grad (der, polynomials, dir, rhs) |
subroutine | derivatives_make_discretization (namespace, dim, periodic_dim, mesh, masses, pol, rhs, nderiv, op, name, verbose) |
logical function | derivatives_overlap (this) |
subroutine, public | derivatives_get_lapl (this, namespace, op, space, name, order) |
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 between the last row of points in the grid. More... | |
real(real64) function, public | derivatives_lapl_get_max_eigenvalue (this) |
Get maximum eigenvalue of discrete Laplacian. For the star and star_general stencils, use the Fourier transform of the stencil evaluated at the maximum phase to get an upper bound on the spectrum. For all other stencils, use the upper bound from the continuum. More... | |
subroutine, public | dderivatives_perform (op, der, ff, op_ff, ghost_update, set_bc, factor) |
apply a nl_operator to a mesh function More... | |
subroutine, public | dderivatives_lapl (der, ff, op_ff, ghost_update, set_bc, factor) |
apply the Laplacian to a mesh function More... | |
subroutine, public | dderivatives_grad (der, ff, op_ff, ghost_update, set_bc, to_cartesian) |
apply the gradient to a mesh function More... | |
subroutine, public | dderivatives_partial (der, ff, op_ff, dir, ghost_update, set_bc) |
apply the partial derivative along dir to a mesh function More... | |
subroutine, public | dderivatives_div (der, ff, op_ff, ghost_update, set_bc, to_cartesian) |
apply the divergence operator to a vector of mesh functions More... | |
subroutine, public | dderivatives_curl (der, ff, op_ff, ghost_update, set_bc) |
apply the curl operator to a vector of mesh functions More... | |
subroutine, public | dderivatives_test (this, namespace, repetitions, min_blocksize, max_blocksize) |
unit test for derivatives More... | |
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) More... | |
subroutine, public | dderivatives_batch_finish (handle, async) |
apply a non-local operator to a batch (2nd part) More... | |
subroutine, public | dderivatives_batch_perform (op, der, ff, opff, ghost_update, set_bc, factor, async) |
apply an operator to a bach of mesh functions More... | |
subroutine, public | dderivatives_batch_grad (der, ffb, opffb, ghost_update, set_bc, to_cartesian, metric, factor) |
apply the gradient to a batch of mesh functions More... | |
subroutine | dbatch_vector_uvw_to_xyz (der, coord_system, uvw, xyz, metric) |
transform a vector of batches from affine to cartesian coordinates More... | |
subroutine, public | dderivatives_batch_curl (der, ffb, ghost_update, set_bc) |
apply the curl to a batch of mesh functions More... | |
subroutine, public | dderivatives_batch_curl_from_gradient (der, ffb, gradb) |
calculate the curl from a batch and its gradient More... | |
subroutine, public | dderivatives_batch_div (der, ffb, opffb, ghost_update, set_bc, to_cartesian) |
calculate the divergence of a vector of batches More... | |
subroutine, public | zderivatives_perform (op, der, ff, op_ff, ghost_update, set_bc, factor) |
apply a nl_operator to a mesh function More... | |
subroutine, public | zderivatives_lapl (der, ff, op_ff, ghost_update, set_bc, factor) |
apply the Laplacian to a mesh function More... | |
subroutine, public | zderivatives_grad (der, ff, op_ff, ghost_update, set_bc, to_cartesian) |
apply the gradient to a mesh function More... | |
subroutine, public | zderivatives_partial (der, ff, op_ff, dir, ghost_update, set_bc) |
apply the partial derivative along dir to a mesh function More... | |
subroutine, public | zderivatives_div (der, ff, op_ff, ghost_update, set_bc, to_cartesian) |
apply the divergence operator to a vector of mesh functions More... | |
subroutine, public | zderivatives_curl (der, ff, op_ff, ghost_update, set_bc) |
apply the curl operator to a vector of mesh functions More... | |
subroutine, public | zderivatives_test (this, namespace, repetitions, min_blocksize, max_blocksize) |
unit test for derivatives More... | |
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) More... | |
subroutine, public | zderivatives_batch_finish (handle, async) |
apply a non-local operator to a batch (2nd part) More... | |
subroutine, public | zderivatives_batch_perform (op, der, ff, opff, ghost_update, set_bc, factor, async) |
apply an operator to a bach of mesh functions More... | |
subroutine, public | zderivatives_batch_grad (der, ffb, opffb, ghost_update, set_bc, to_cartesian, metric, factor) |
apply the gradient to a batch of mesh functions More... | |
subroutine | zbatch_vector_uvw_to_xyz (der, coord_system, uvw, xyz, metric) |
transform a vector of batches from affine to cartesian coordinates More... | |
subroutine, public | zderivatives_batch_curl (der, ffb, ghost_update, set_bc) |
apply the curl to a batch of mesh functions More... | |
subroutine, public | zderivatives_batch_curl_from_gradient (der, ffb, gradb) |
calculate the curl from a batch and its gradient More... | |
subroutine, public | zderivatives_batch_div (der, ffb, opffb, ghost_update, set_bc, to_cartesian) |
calculate the divergence of a vector of batches More... | |
Variables | |
integer, parameter | der_bc_zero_f = 0 |
function is zero at the boundaries More... | |
integer, parameter | der_bc_zero_df = 1 |
first derivative of the function is zero More... | |
integer, parameter | der_bc_period = 2 |
boundary is periodic More... | |
integer, parameter, public | der_star = 1 |
integer, parameter, public | der_variational = 2 |
integer, parameter, public | der_cube = 3 |
integer, parameter, public | der_starplus = 4 |
integer, parameter, public | der_stargeneral = 5 |
integer, parameter | blocking = 1 |
integer, parameter | non_blocking = 2 |
type(accel_kernel_t) | kernel_uvw_xyz |
type(accel_kernel_t) | kernel_dcurl |
type(accel_kernel_t) | kernel_zcurl |
subroutine, public derivatives_oct_m::derivatives_init | ( | type(derivatives_t), intent(inout), target | der, |
type(namespace_t), intent(in) | namespace, | ||
class(space_t), intent(in) | space, | ||
class(coordinate_system_t), intent(in) | coord_system, | ||
integer, intent(in), optional | order | ||
) |
Definition at line 278 of file derivatives.F90.
subroutine, public derivatives_oct_m::derivatives_end | ( | type(derivatives_t), intent(inout) | der | ) |
Definition at line 431 of file derivatives.F90.
|
private |
Definition at line 463 of file derivatives.F90.
subroutine, public derivatives_oct_m::derivatives_lapl_diag | ( | type(derivatives_t), intent(in) | der, |
real(real64), dimension(:), intent(out) | lapl | ||
) |
Returns the diagonal elements of the Laplacian, needed for preconditioning.
[out] | lapl | lapl(meshnp) |
Definition at line 494 of file derivatives.F90.
|
private |
Definition at line 511 of file derivatives.F90.
subroutine, public derivatives_oct_m::derivatives_build | ( | type(derivatives_t), intent(inout) | der, |
type(namespace_t), intent(in) | namespace, | ||
class(space_t), intent(in) | space, | ||
class(mesh_t), intent(in), target | mesh, | ||
real(real64), dimension(:), intent(in), optional | qvector, | ||
logical, intent(in), optional | regenerate, | ||
logical, intent(in), optional | verbose | ||
) |
build the derivatives object:
This routine initializes the boundary conditions and builds the actual nl_operator_oct_m::nl_operator_t objects for the derivative operators.
The stencil weights are computed by imposing that the action of the discrete Laplacian or gradient is exact on a set of polynomials. The set of polynomials needs to be chosen such that it yields linearly independent vectors when evaluated on the points of the stencil.
More specifically, the weights are the solution of the equation
\[ mat * weights = rhs, \]
where \( mat_{i,j} \) is the value of the \(i\)-th polynomial on the \(j\)-the point of the stencil and \(rhs\) is the solution of applying the operator to the polynomial and evaluating it at 0.
Let \(u_1,u_2,u_3\) be the primitive coordinates and \(F=BB^T\), with \(B\) the change-of-coordinates matrix (see Natan et al. (2008), PRB 78, 075109, eqs. 10 and 11). The polynomials are given as \(u_1^{\alpha_1}u_2^{\alpha_2}u_3^{\alpha_3}\), and the right-hand side for the gradient is
The method has been tested for the default and cube stencils on all 14 Bravais lattices in 3D and yields acceptable errors for the derivatives.
[in] | space | space (spatial and periodic dimensions) |
[in] | mesh | the underlying mesh |
[in] | qvector | momentum transfer for spiral BC (pass through to boundaries_oct_m::boundaries_init()) |
Definition at line 579 of file derivatives.F90.
|
private |
Definition at line 738 of file derivatives.F90.
|
private |
Definition at line 806 of file derivatives.F90.
|
private |
Definition at line 833 of file derivatives.F90.
|
private |
Definition at line 952 of file derivatives.F90.
subroutine, public derivatives_oct_m::derivatives_get_lapl | ( | type(derivatives_t), intent(in) | this, |
type(namespace_t), intent(in) | namespace, | ||
type(nl_operator_t), dimension(:), intent(inout) | op, | ||
class(space_t), intent(in) | space, | ||
character(len=32), intent(in) | name, | ||
integer, intent(in) | order | ||
) |
Definition at line 964 of file derivatives.F90.
logical function, dimension(1:this%mesh%np), public derivatives_oct_m::derivatives_get_inner_boundary_mask | ( | type(derivatives_t), intent(in) | this | ) |
This function tells whether a point in the grid is contained in a layer of the width of the stencil between the last row of points in the grid.
E.g. if stencil = 2, then: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 So the innermost points of the grid will not be masked, while the one between the innermost and the boundary will be masked
Definition at line 1016 of file derivatives.F90.
real(real64) function, public derivatives_oct_m::derivatives_lapl_get_max_eigenvalue | ( | type(derivatives_t), intent(in) | this | ) |
Get maximum eigenvalue of discrete Laplacian. For the star and star_general stencils, use the Fourier transform of the stencil evaluated at the maximum phase to get an upper bound on the spectrum. For all other stencils, use the upper bound from the continuum.
Definition at line 1044 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_perform | ( | type(nl_operator_t), intent(in), target | op, |
type(derivatives_t), intent(in) | der, | ||
real(real64), dimension(:), intent(inout), contiguous | ff, | ||
real(real64), dimension(:), intent(out), contiguous | op_ff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
real(real64), intent(in), optional | factor | ||
) |
apply a nl_operator to a mesh function
[in] | op | operator to apply |
[in] | der | the derivatives object |
[in,out] | ff | initial mesh function (1:dermeshnp_part) |
[out] | op_ff | final mesh function (1:dermeshnp) |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to apply the boundary conditions (default .true.) |
[in] | factor | optional scaling factor |
Definition at line 1153 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_lapl | ( | type(derivatives_t), intent(in) | der, |
real(real64), dimension(:), intent(inout), contiguous | ff, | ||
real(real64), dimension(:), intent(out), contiguous | op_ff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
real(real64), intent(in), optional | factor | ||
) |
apply the Laplacian to a mesh function
[in] | der | derivatives object |
[in,out] | ff | initial mesh function (1:dermeshnp_part) |
[out] | op_ff | final mesh function (1:dermeshnp) |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to apply the boundary conditions (default .true.) |
[in] | factor | optional scaling factor |
Definition at line 1191 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_grad | ( | type(derivatives_t), intent(in) | der, |
real(real64), dimension(:), intent(inout), contiguous | ff, | ||
real(real64), dimension(:, :), intent(out), contiguous | op_ff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
logical, intent(in), optional | to_cartesian | ||
) |
apply the gradient to a mesh function
[in] | der | derivatives object |
[in,out] | ff | initial mesh function ff(1:dermeshnp_part) |
[out] | op_ff | final mesh function op_ff(1:dermeshnp, 1:derdim) |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to apply the boundary conditions (default .true.) |
[in] | to_cartesian | flag whether conversion to cartesian coords in needed |
Definition at line 1213 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_partial | ( | type(derivatives_t), intent(in) | der, |
real(real64), dimension(:), intent(inout), contiguous | ff, | ||
real(real64), dimension(:), intent(out), contiguous | op_ff, | ||
integer, intent(in) | dir, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc | ||
) |
apply the partial derivative along dir to a mesh function
[in] | der | derivatives object |
[in,out] | ff | initial mesh function (1:dermeshnp_part) |
[out] | op_ff | final mesh function (1:dermeshnp) |
[in] | dir | direction along which to calculate the partial derivative |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to set the boundary conditions (default .true.) |
Definition at line 1256 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_div | ( | type(derivatives_t), intent(in) | der, |
real(real64), dimension(:,:), intent(inout), target, contiguous | ff, | ||
real(real64), dimension(:), intent(out), contiguous | op_ff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
logical, intent(in), optional | to_cartesian | ||
) |
apply the divergence operator to a vector of mesh functions
[in] | der | derivatives object |
[in,out] | ff | initial mesh function vector ff(1:dermeshnp_part, 1:derdim) |
[out] | op_ff | final mesh function op_ff(1:dermeshnp) |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to apply the boundary conditions (default .true.) |
[in] | to_cartesian | flag whether conversion to cartesian coords in needed |
Definition at line 1283 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_curl | ( | type(derivatives_t), intent(in) | der, |
real(real64), dimension(:,:), intent(inout), contiguous | ff, | ||
real(real64), dimension(:,:), intent(out), contiguous | op_ff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc | ||
) |
apply the curl operator to a vector of mesh functions
[in] | der | derivatives object |
[in,out] | ff | initial mesh function vector ff(1:dermeshnp_part, 1:derdim) |
[out] | op_ff | final mesh function vector op_ff(1:dermeshnp, 1:derdim) |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to apply the boundary conditions (default .true.) |
Definition at line 1350 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_test | ( | type(derivatives_t), intent(in) | this, |
type(namespace_t), intent(in) | namespace, | ||
integer, intent(in) | repetitions, | ||
integer, intent(in) | min_blocksize, | ||
integer, intent(in) | max_blocksize | ||
) |
unit test for derivatives
This will be called from the test run mode.
Definition at line 1432 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_batch_start | ( | type(nl_operator_t), intent(in), target | op, |
type(derivatives_t), intent(in), target | der, | ||
class(batch_t), intent(inout), target | ff, | ||
class(batch_t), intent(inout), target | opff, | ||
type(derivatives_handle_batch_t), intent(out) | handle, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
real(real64), intent(in), optional | factor | ||
) |
apply a non-local operator to a batch (1st part)
This 1st part stores important data in the handle, sets the boundaries (if requested) and starts the communication for the ghost update (if requested)
[in] | op | the operator to be applied |
[in] | der | the derivatives object |
[in,out] | ff | initial batch |
[in,out] | opff | finial batch (after application of the operator) |
[out] | handle | handle for start/finish calls |
[in] | ghost_update | whether to perform ghost updates (default=.true.) |
[in] | set_bc | whether to set the boundary conditions (default=.true.) |
[in] | factor | optional scaling factor |
Definition at line 1699 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_batch_finish | ( | type(derivatives_handle_batch_t), intent(inout) | handle, |
logical, intent(in), optional | async | ||
) |
apply a non-local operator to a batch (2nd part)
This 2nd part finished the communication and applies the operator. Here, the operator is applied to the inner points before the communication is finished, to overlap calculation and communication, if possible. After the communication is complete, the operator is applied to the outer points.
Definition at line 1752 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_batch_perform | ( | type(nl_operator_t), intent(in) | op, |
type(derivatives_t), intent(in) | der, | ||
class(batch_t), intent(inout) | ff, | ||
class(batch_t), intent(inout) | opff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
real(real64), intent(in), optional | factor, | ||
logical, intent(in), optional | async | ||
) |
apply an operator to a bach of mesh functions
This is a wrapper of the corresponding start and finish routines.
[in] | op | the operator to be applied |
[in] | der | the derivatives object |
[in,out] | ff | initial batch |
[in,out] | opff | finial batch (after application of the operator) |
[in] | ghost_update | whether to perform ghost updates (default=.true.) |
[in] | set_bc | whether to set the boundary conditions (default=.true.) |
[in] | factor | optional scaling factor |
Definition at line 1803 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_batch_grad | ( | type(derivatives_t), intent(in) | der, |
class(batch_t), intent(inout) | ffb, | ||
class(batch_t), dimension(:), intent(inout) | opffb, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
logical, intent(in), optional | to_cartesian, | ||
real(real64), dimension(:,:), intent(in), optional | metric, | ||
real(real64), intent(in), optional | factor | ||
) |
apply the gradient to a batch of mesh functions
[in] | der | derivatives object |
[in,out] | ffb | initial batch |
[in,out] | opffb | final vector of batches |
[in] | ghost_update | optional flag whether to perform the ghost update (default .true.) |
[in] | set_bc | optional flag whether to set the boundary conditions (default .true.) |
[in] | to_cartesian | optional flag whether to convert to cartesian coods (currently unused!) |
[in] | metric | optional metric for affine coordinate systems |
[in] | factor | optional scaling factor |
Definition at line 1830 of file derivatives.F90.
|
private |
transform a vector of batches from affine to cartesian coordinates
[in] | metric | Transpose of the matrix |
Definition at line 1872 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_batch_curl | ( | type(derivatives_t), intent(in) | der, |
class(batch_t), intent(inout) | ffb, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc | ||
) |
apply the curl to a batch of mesh functions
This routine computes first a gradient. If the gradient is known, consider using derivatives_batch_curl_from_gradient instead.
[in] | der | the derivatives object |
[in,out] | ffb | the initial batch; ffb will be overwritten by its curl |
[in] | ghost_update | optional flag whether to perform the ghost update (default .true.) |
[in] | set_bc | optional flag whether to set the boundary conditions (default .true.) |
Definition at line 2007 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_batch_curl_from_gradient | ( | type(derivatives_t), intent(in) | der, |
class(batch_t), intent(inout) | ffb, | ||
class(batch_t), dimension(:), intent(in) | gradb | ||
) |
calculate the curl from a batch and its gradient
If the gradient of the batch already has been calculated, this routine is reuses it to get the curl
[in] | der | the derivatives object |
[in,out] | ffb | on output: batch of the curl |
[in] | gradb | batch of the gradients of the mesh functions |
Definition at line 2037 of file derivatives.F90.
subroutine, public derivatives_oct_m::dderivatives_batch_div | ( | type(derivatives_t), intent(in) | der, |
class(batch_t), dimension(:), intent(inout) | ffb, | ||
class(batch_t), intent(inout) | opffb, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
logical, intent(in), optional | to_cartesian | ||
) |
calculate the divergence of a vector of batches
[in] | der | the derivatives object |
[in,out] | ffb | vector of initial batches |
[in,out] | opffb | batch containing the divergence |
[in] | ghost_update | optional flag whether to perform the ghost update (default .true.) |
[in] | set_bc | optional flag whether to set the boundary conditions (default .true.) |
[in] | to_cartesian | optional flag whether to convert to cartesian coords (default .true.) |
Definition at line 2102 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_perform | ( | type(nl_operator_t), intent(in), target | op, |
type(derivatives_t), intent(in) | der, | ||
complex(real64), dimension(:), intent(inout), contiguous | ff, | ||
complex(real64), dimension(:), intent(out), contiguous | op_ff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
real(real64), intent(in), optional | factor | ||
) |
apply a nl_operator to a mesh function
[in] | op | operator to apply |
[in] | der | the derivatives object |
[in,out] | ff | initial mesh function (1:dermeshnp_part) |
[out] | op_ff | final mesh function (1:dermeshnp) |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to apply the boundary conditions (default .true.) |
[in] | factor | optional scaling factor |
Definition at line 2235 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_lapl | ( | type(derivatives_t), intent(in) | der, |
complex(real64), dimension(:), intent(inout), contiguous | ff, | ||
complex(real64), dimension(:), intent(out), contiguous | op_ff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
real(real64), intent(in), optional | factor | ||
) |
apply the Laplacian to a mesh function
[in] | der | derivatives object |
[in,out] | ff | initial mesh function (1:dermeshnp_part) |
[out] | op_ff | final mesh function (1:dermeshnp) |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to apply the boundary conditions (default .true.) |
[in] | factor | optional scaling factor |
Definition at line 2273 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_grad | ( | type(derivatives_t), intent(in) | der, |
complex(real64), dimension(:), intent(inout), contiguous | ff, | ||
complex(real64), dimension(:, :), intent(out), contiguous | op_ff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
logical, intent(in), optional | to_cartesian | ||
) |
apply the gradient to a mesh function
[in] | der | derivatives object |
[in,out] | ff | initial mesh function ff(1:dermeshnp_part) |
[out] | op_ff | final mesh function op_ff(1:dermeshnp, 1:derdim) |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to apply the boundary conditions (default .true.) |
[in] | to_cartesian | flag whether conversion to cartesian coords in needed |
Definition at line 2295 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_partial | ( | type(derivatives_t), intent(in) | der, |
complex(real64), dimension(:), intent(inout), contiguous | ff, | ||
complex(real64), dimension(:), intent(out), contiguous | op_ff, | ||
integer, intent(in) | dir, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc | ||
) |
apply the partial derivative along dir to a mesh function
[in] | der | derivatives object |
[in,out] | ff | initial mesh function (1:dermeshnp_part) |
[out] | op_ff | final mesh function (1:dermeshnp) |
[in] | dir | direction along which to calculate the partial derivative |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to set the boundary conditions (default .true.) |
Definition at line 2338 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_div | ( | type(derivatives_t), intent(in) | der, |
complex(real64), dimension(:,:), intent(inout), target, contiguous | ff, | ||
complex(real64), dimension(:), intent(out), contiguous | op_ff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
logical, intent(in), optional | to_cartesian | ||
) |
apply the divergence operator to a vector of mesh functions
[in] | der | derivatives object |
[in,out] | ff | initial mesh function vector ff(1:dermeshnp_part, 1:derdim) |
[out] | op_ff | final mesh function op_ff(1:dermeshnp) |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to apply the boundary conditions (default .true.) |
[in] | to_cartesian | flag whether conversion to cartesian coords in needed |
Definition at line 2365 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_curl | ( | type(derivatives_t), intent(in) | der, |
complex(real64), dimension(:,:), intent(inout), contiguous | ff, | ||
complex(real64), dimension(:,:), intent(out), contiguous | op_ff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc | ||
) |
apply the curl operator to a vector of mesh functions
[in] | der | derivatives object |
[in,out] | ff | initial mesh function vector ff(1:dermeshnp_part, 1:derdim) |
[out] | op_ff | final mesh function vector op_ff(1:dermeshnp, 1:derdim) |
[in] | ghost_update | flag whether to perform the ghost update (default .true.) |
[in] | set_bc | flag whether to apply the boundary conditions (default .true.) |
Definition at line 2432 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_test | ( | type(derivatives_t), intent(in) | this, |
type(namespace_t), intent(in) | namespace, | ||
integer, intent(in) | repetitions, | ||
integer, intent(in) | min_blocksize, | ||
integer, intent(in) | max_blocksize | ||
) |
unit test for derivatives
This will be called from the test run mode.
Definition at line 2514 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_batch_start | ( | type(nl_operator_t), intent(in), target | op, |
type(derivatives_t), intent(in), target | der, | ||
class(batch_t), intent(inout), target | ff, | ||
class(batch_t), intent(inout), target | opff, | ||
type(derivatives_handle_batch_t), intent(out) | handle, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
real(real64), intent(in), optional | factor | ||
) |
apply a non-local operator to a batch (1st part)
This 1st part stores important data in the handle, sets the boundaries (if requested) and starts the communication for the ghost update (if requested)
[in] | op | the operator to be applied |
[in] | der | the derivatives object |
[in,out] | ff | initial batch |
[in,out] | opff | finial batch (after application of the operator) |
[out] | handle | handle for start/finish calls |
[in] | ghost_update | whether to perform ghost updates (default=.true.) |
[in] | set_bc | whether to set the boundary conditions (default=.true.) |
[in] | factor | optional scaling factor |
Definition at line 2789 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_batch_finish | ( | type(derivatives_handle_batch_t), intent(inout) | handle, |
logical, intent(in), optional | async | ||
) |
apply a non-local operator to a batch (2nd part)
This 2nd part finished the communication and applies the operator. Here, the operator is applied to the inner points before the communication is finished, to overlap calculation and communication, if possible. After the communication is complete, the operator is applied to the outer points.
Definition at line 2842 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_batch_perform | ( | type(nl_operator_t), intent(in) | op, |
type(derivatives_t), intent(in) | der, | ||
class(batch_t), intent(inout) | ff, | ||
class(batch_t), intent(inout) | opff, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
real(real64), intent(in), optional | factor, | ||
logical, intent(in), optional | async | ||
) |
apply an operator to a bach of mesh functions
This is a wrapper of the corresponding start and finish routines.
[in] | op | the operator to be applied |
[in] | der | the derivatives object |
[in,out] | ff | initial batch |
[in,out] | opff | finial batch (after application of the operator) |
[in] | ghost_update | whether to perform ghost updates (default=.true.) |
[in] | set_bc | whether to set the boundary conditions (default=.true.) |
[in] | factor | optional scaling factor |
Definition at line 2893 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_batch_grad | ( | type(derivatives_t), intent(in) | der, |
class(batch_t), intent(inout) | ffb, | ||
class(batch_t), dimension(:), intent(inout) | opffb, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
logical, intent(in), optional | to_cartesian, | ||
real(real64), dimension(:,:), intent(in), optional | metric, | ||
real(real64), intent(in), optional | factor | ||
) |
apply the gradient to a batch of mesh functions
[in] | der | derivatives object |
[in,out] | ffb | initial batch |
[in,out] | opffb | final vector of batches |
[in] | ghost_update | optional flag whether to perform the ghost update (default .true.) |
[in] | set_bc | optional flag whether to set the boundary conditions (default .true.) |
[in] | to_cartesian | optional flag whether to convert to cartesian coods (currently unused!) |
[in] | metric | optional metric for affine coordinate systems |
[in] | factor | optional scaling factor |
Definition at line 2920 of file derivatives.F90.
|
private |
transform a vector of batches from affine to cartesian coordinates
[in] | metric | Transpose of the matrix |
Definition at line 2962 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_batch_curl | ( | type(derivatives_t), intent(in) | der, |
class(batch_t), intent(inout) | ffb, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc | ||
) |
apply the curl to a batch of mesh functions
This routine computes first a gradient. If the gradient is known, consider using derivatives_batch_curl_from_gradient instead.
[in] | der | the derivatives object |
[in,out] | ffb | the initial batch; ffb will be overwritten by its curl |
[in] | ghost_update | optional flag whether to perform the ghost update (default .true.) |
[in] | set_bc | optional flag whether to set the boundary conditions (default .true.) |
Definition at line 3097 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_batch_curl_from_gradient | ( | type(derivatives_t), intent(in) | der, |
class(batch_t), intent(inout) | ffb, | ||
class(batch_t), dimension(:), intent(in) | gradb | ||
) |
calculate the curl from a batch and its gradient
If the gradient of the batch already has been calculated, this routine is reuses it to get the curl
[in] | der | the derivatives object |
[in,out] | ffb | on output: batch of the curl |
[in] | gradb | batch of the gradients of the mesh functions |
Definition at line 3127 of file derivatives.F90.
subroutine, public derivatives_oct_m::zderivatives_batch_div | ( | type(derivatives_t), intent(in) | der, |
class(batch_t), dimension(:), intent(inout) | ffb, | ||
class(batch_t), intent(inout) | opffb, | ||
logical, intent(in), optional | ghost_update, | ||
logical, intent(in), optional | set_bc, | ||
logical, intent(in), optional | to_cartesian | ||
) |
calculate the divergence of a vector of batches
[in] | der | the derivatives object |
[in,out] | ffb | vector of initial batches |
[in,out] | opffb | batch containing the divergence |
[in] | ghost_update | optional flag whether to perform the ghost update (default .true.) |
[in] | set_bc | optional flag whether to set the boundary conditions (default .true.) |
[in] | to_cartesian | optional flag whether to convert to cartesian coords (default .true.) |
Definition at line 3192 of file derivatives.F90.
|
private |
function is zero at the boundaries
Definition at line 210 of file derivatives.F90.
|
private |
first derivative of the function is zero
Definition at line 210 of file derivatives.F90.
|
private |
boundary is periodic
Definition at line 210 of file derivatives.F90.
integer, parameter, public derivatives_oct_m::der_star = 1 |
Definition at line 215 of file derivatives.F90.
integer, parameter, public derivatives_oct_m::der_variational = 2 |
Definition at line 215 of file derivatives.F90.
integer, parameter, public derivatives_oct_m::der_cube = 3 |
Definition at line 215 of file derivatives.F90.
integer, parameter, public derivatives_oct_m::der_starplus = 4 |
Definition at line 215 of file derivatives.F90.
integer, parameter, public derivatives_oct_m::der_stargeneral = 5 |
Definition at line 215 of file derivatives.F90.
|
private |
Definition at line 222 of file derivatives.F90.
|
private |
Definition at line 222 of file derivatives.F90.
|
private |
Definition at line 273 of file derivatives.F90.
|
private |
Definition at line 273 of file derivatives.F90.
|
private |
Definition at line 273 of file derivatives.F90.