![]() |
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, symm, order) |
| subroutine, public | derivatives_end (der) |
| subroutine | derivatives_get_stencil_lapl (der, lapl, space, coord_system, name, order) |
| 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, stencil, qvector, regenerate, verbose) |
| build the derivatives object: More... | |
| subroutine | derivatives_symmetrize_grad (der, space, mesh, stencil) |
| Symmetrizes the gradient operators over the point group of the structure. More... | |
| subroutine | stencil_pol_grad (stencil_type, dim, direction, order, polynomials) |
| subroutine | stencil_pol_lapl (stencil_type, stencil, dim, order, polynomials) |
| subroutine | get_rhs_lapl (coord_system, polynomials, chi, rhs, stencil_primitive_coordinates) |
| subroutine | get_rhs_grad (polynomials, dir, rhs) |
| subroutine | derivatives_make_discretization (namespace, der, nderiv, ideriv, op, space, name, verbose, order) |
| 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 | derivates_set_coordinates_system (der, coord_system) |
| 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_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, factor) |
| apply the gradient to a batch of mesh functions More... | |
| subroutine | dbatch_covector_to_cartesian (der, coord_system, uvw, xyz) |
| 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_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, factor) |
| apply the gradient to a batch of mesh functions More... | |
| subroutine | zbatch_covector_to_cartesian (der, coord_system, uvw, xyz) |
| 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), target | coord_system, | ||
| type(symmetries_t), intent(in) | symm, | ||
| integer, intent(in), optional | order | ||
| ) |
Definition at line 256 of file derivatives.F90.
| subroutine, public derivatives_oct_m::derivatives_end | ( | type(derivatives_t), intent(inout) | der | ) |
Definition at line 450 of file derivatives.F90.
|
private |
Definition at line 482 of file derivatives.F90.
| subroutine, public derivatives_oct_m::derivatives_lapl_diag | ( | type(derivatives_t), intent(in) | der, |
| real(real64), dimension(:), intent(out), contiguous | lapl | ||
| ) |
Returns the diagonal elements of the Laplacian, needed for preconditioning.
| [out] | lapl | lapl(meshnp) |
Definition at line 520 of file derivatives.F90.
|
private |
Definition at line 537 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, | ||
| type(stencil_t), intent(in) | stencil, | ||
| real(real64), dimension(:), intent(in), optional, contiguous | 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.
The polynomials can be either computed in primitive or Cartesian coordinates and correspondingly the right-hand side needs to be different. By default, Cartesian coordinates are only used for curvilinear grids.
Let \(u_1,u_2,u_3\) be the primitive coordinates and \(F=BB^T\) (i.e. the inverse metric tensor), with \(B\) the change-of-coordinates matrix (see Natan et al. (2008), PRB 78, 075109, eqs. 10 and 11, i.e. the inverse Jacobian). 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
For Cartesian coordinates, the right-hand side for the Laplacian is
The polynomials need to include the cases for which the right-hand-side is non-zero.
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] | stencil | stencil used to generate the boundary and ghost points of the mesh |
| [in] | qvector | momentum transfer for spiral BC (pass through to boundaries_oct_m::boundaries_init()) |
Definition at line 619 of file derivatives.F90.
|
private |
Symmetrizes the gradient operators over the point group of the structure.
The symmetrized gradient is \( D^{sym} f(r) = \frac{1}{N}\sum_g R_g [D (f \circ g)](g^{-1} r) \), where \( g r = R_g r \) runs over the rotations of the space group that map the grid onto itself. As the weights are constant, the fractional translations are irrelevant. For a stencil with Cartesian weights \( w(s) \), its weights are \( w^{sym}(M_g s) = \frac{1}{N}\sum_g R_g w(s) \), where \( M_g \) is the integer matrix of the operation in the basis of the grid. The exact gradient is invariant under this averaging.
| [in] | stencil | stencil used to generate the boundary and ghost points of the mesh |
Definition at line 716 of file derivatives.F90.
|
private |
Definition at line 873 of file derivatives.F90.
|
private |
Definition at line 892 of file derivatives.F90.
|
private |
Definition at line 914 of file derivatives.F90.
|
private |
Definition at line 992 of file derivatives.F90.
|
private |
Definition at line 1020 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), contiguous | op, | ||
| class(space_t), intent(in) | space, | ||
| character(len=80), intent(in) | name, | ||
| integer, intent(in) | order | ||
| ) |
Definition at line 1180 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 1210 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 1238 of file derivatives.F90.
| subroutine, public derivatives_oct_m::derivates_set_coordinates_system | ( | type(derivatives_t), intent(inout), target | der, |
| class(coordinate_system_t), intent(in), target | coord_system | ||
| ) |
Definition at line 1265 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 1353 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 1391 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 1413 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 1456 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 1483 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 1549 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 1654 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 1700 of file derivatives.F90.
| subroutine, public derivatives_oct_m::dderivatives_batch_perform | ( | 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, | ||
| 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 1730 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), contiguous | opffb, | ||
| logical, intent(in), optional | ghost_update, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | to_cartesian, | ||
| 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] | factor | optional scaling factor |
Definition at line 1757 of file derivatives.F90.
|
private |
transform a vector of batches from affine to cartesian coordinates
Definition at line 1798 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 1964 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), contiguous | 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 1994 of file derivatives.F90.
| subroutine, public derivatives_oct_m::dderivatives_batch_div | ( | type(derivatives_t), intent(in) | der, |
| class(batch_t), dimension(:), intent(inout), contiguous | 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 2056 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 2189 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 2227 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 2249 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 2292 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 2319 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 2385 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 2490 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 2536 of file derivatives.F90.
| subroutine, public derivatives_oct_m::zderivatives_batch_perform | ( | 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, | ||
| 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 2566 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), contiguous | opffb, | ||
| logical, intent(in), optional | ghost_update, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | to_cartesian, | ||
| 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] | factor | optional scaling factor |
Definition at line 2593 of file derivatives.F90.
|
private |
transform a vector of batches from affine to cartesian coordinates
Definition at line 2634 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 2800 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), contiguous | 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 2830 of file derivatives.F90.
| subroutine, public derivatives_oct_m::zderivatives_batch_div | ( | type(derivatives_t), intent(in) | der, |
| class(batch_t), dimension(:), intent(inout), contiguous | 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 2892 of file derivatives.F90.
|
private |
function is zero at the boundaries
Definition at line 180 of file derivatives.F90.
|
private |
first derivative of the function is zero
Definition at line 180 of file derivatives.F90.
|
private |
boundary is periodic
Definition at line 180 of file derivatives.F90.
| integer, parameter, public derivatives_oct_m::der_star = 1 |
Definition at line 185 of file derivatives.F90.
| integer, parameter, public derivatives_oct_m::der_variational = 2 |
Definition at line 185 of file derivatives.F90.
| integer, parameter, public derivatives_oct_m::der_cube = 3 |
Definition at line 185 of file derivatives.F90.
| integer, parameter, public derivatives_oct_m::der_starplus = 4 |
Definition at line 185 of file derivatives.F90.
| integer, parameter, public derivatives_oct_m::der_stargeneral = 5 |
Definition at line 185 of file derivatives.F90.
|
private |
Definition at line 192 of file derivatives.F90.
|
private |
Definition at line 192 of file derivatives.F90.
|
private |
Definition at line 251 of file derivatives.F90.
|
private |
Definition at line 251 of file derivatives.F90.
|
private |
Definition at line 251 of file derivatives.F90.