|
|
# 3D derivatives:
|
|
|
## Basic 3D derivative function:
|
|
|
```c
|
|
|
int wderiv_derivative_3d_r(int direction, int n, double *f, double *deriv)
|
|
|
```
|
|
|
Function computes n-th derivative with respect to `direction` of 3D real function $`f(x,y,z)`$: $`\frac{\partial^n f}{\partial t^n}`$.
|
|
|
* `direction` - predefined integer corresponding to direction of derivative: `WDERIV_DX` or `WDERIV_DY` or `WDERIV_DZ`
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
|
|
|
* `deriv` - pointer to output derivative function which is array of size [nx\*ny\*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`deriv` can be the same pointer as `f`, then result overwrites input.
|
|
|
## First 3D derivative functions:
|
|
|
```c
|
|
|
int wderiv_dfdx_3d_r(double *f, double *dfdx)
|
|
|
```
|
|
|
Function computes first derivative with respect to $`x`$ of 3D real function $`f(x,y,z)`$: $`\frac{\partial f}{\partial x}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
|
|
|
* `dfdx` - pointer to output derivative function which is array of size [nx\*ny\*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dfdx` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
```c
|
|
|
int wderiv_dfdy_3d_r(double *f, double *dfdy)
|
|
|
```
|
|
|
Function computes first derivative with respect to $`y`$ of 3D real function $`f(x,y,z)`$: $`\frac{\partial f}{\partial y}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx*ny*nz]
|
|
|
* `dfdy` - pointer to output derivative function which is array of size [nx*ny*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dfdy` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
```c
|
|
|
int wderiv_dfdz_3d_r(double *f, double *dfdz)
|
|
|
```
|
|
|
Function computes first derivative with respect to $`z`$ of 3D real function $`f(x,y,z)`$: $`\frac{\partial f}{\partial x}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx*ny*nz]
|
|
|
* `dfdz` - pointer to output derivative function which is array of size [nx*ny*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dfdz` can be the same pointer as `f`, then result overwrites input.
|
|
|
## Second 3D derivative functions:
|
|
|
```c
|
|
|
int wderiv_d2fdx2_3d_r(double *f, double *d2fdx2)
|
|
|
```
|
|
|
Function computes second derivative with respect to $`x`$ of 3D real function $`f(x,y,z)`$: $`\frac{\partial^2 f}{\partial x^2}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
|
|
|
* `d2fdx2` - pointer to output derivative function which is array of size [nx\*ny\*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`d2fdx2` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
```c
|
|
|
int wderiv_d2fdy2_3d_r(double *f, double *d2fdy2)
|
|
|
```
|
|
|
Function computes second derivative with respect to $`y`$ of 3D real function $`f(x,y,z)`$: $`\frac{\partial^2 f}{\partial y^2}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
|
|
|
* `d2fdy2` - pointer to output derivative function which is array of size [nx\*ny\*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`d2fdy2` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
```c
|
|
|
int wderiv_d2fdz2_3d_r(double *f, double *d2fdz2)
|
|
|
```
|
|
|
Function computes second derivative with respect to $`z`$ of 3D real function $`f(x,y,z)`$: $`(\frac{d^2f}{dz^2})`$.
|
|
|
* `f` - pointer to input function which is array of size [nx*ny*nz]
|
|
|
* `d2fdz2` - pointer to output derivative function which is array of size [nx*ny*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`d2fdz2` can be the same pointer as `f`, then result overwrites input.
|
|
|
## n-th 3D derivative functions:
|
|
|
```c
|
|
|
int wderiv_dnfdxn_3d_r(int n, double *f, double *dnfdxn)
|
|
|
```
|
|
|
Function computes n-th derivative with respect to $`x`$ of 3D real function $`f(x,y,z)`$: $`(\frac{d^nf}{dx^n})`$.
|
|
|
* `f` - pointer to input function which is array of size [nx*ny*nz]
|
|
|
* `dnfdxn` - pointer to output derivative function which is array of size [nx*ny*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dnfdxn` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
```c
|
|
|
int wderiv_dnfdyn_3d_r(int n, double *f, double *dnfdyn)
|
|
|
```
|
|
|
Function computes n-th derivative with respect to $`y`$ of 3D real function $`f(x,y,z)`$: $`(\frac{d^nf}{dy^n})`$.
|
|
|
* `f` - pointer to input function which is array of size [nx*ny*nz]
|
|
|
* `dnfdyn` - pointer to output derivative function which is array of size [nx*ny*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dnfdyn` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
```c
|
|
|
int wderiv_dnfdzn_3d_r(int n, double *f, double *dnfdzn)
|
|
|
```
|
|
|
Function computes n-th derivative with respect to $`z`$ of 3D real function $`f(x,y,z)`$: $`(\frac{d^nf}{dz^n})`$.
|
|
|
* `f` - pointer to input function which is array of size [nx*ny*nz]
|
|
|
* `dnfdzn` - pointer to output derivative function which is array of size [nx*ny*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dnfdzn` can be the same pointer as `f`, then result overwrites input.
|
|
|
## 3D gradient:
|
|
|
```c
|
|
|
int wderiv_gradient_3d_r(double *f, double *dfdx, double *dfdy, double *dfdz);
|
|
|
```
|
|
|
Function computes gradient of 3D real function $`f(x,y,z)`$: $`\nabla f = (\frac{df}{dx},\frac{df}{dy},\frac{df}{dz})`$.
|
|
|
* `f` - pointer to input function which is array of size [nx*ny*nz]
|
|
|
* `dfdx` - pointer to output derivative function which is array of size [nx*ny*nz]
|
|
|
* `dfdy` - pointer to output derivative function which is array of size [nx*ny*nz]
|
|
|
* `dfdz` - pointer to output derivative function which is array of size [nx*ny*nz]
|
|
|
* `return` - error code
|
|
|
## 3D gradient squared:
|
|
|
```c
|
|
|
int wderiv_gradient2_3d_r(double *f, double *gradient_square)
|
|
|
```
|
|
|
Function computes squared gradient of 3D real function $`f(x,y,z)`$: $`|\nabla f|^2 = |\frac{df}{dx}|^2 +|\frac{df}{dy}|^2 +|\frac{df}{dz}|^2 `$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
|
|
|
* `gradient_square` - pointer to output gradient squared function which is array of size [nx\*ny\*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`gradient_square` can be the same pointer as `f`, then result overwrites input.
|
|
|
## 3D laplacian:
|
|
|
```c
|
|
|
int wderiv_laplace_3d_r(double *f, double *laplace)
|
|
|
```
|
|
|
Function computes laplacian of 3D real function $`f(x,y,z)`$: $`|\Delta f|^2 = \frac{d^2f}{dx^2} +\frac{d^2f}{dy^2} +\frac{d^2f}{dz^2} `$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
|
|
|
* `laplace` - pointer to output laplacian function which is array of size [nx\*ny\*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`laplace` can be the same pointer as `f`, then result overwrites input.
|
|
|
## 3D divergence:
|
|
|
```c
|
|
|
int wderiv_divergence_3d_r(double *f, double *divergence)
|
|
|
```
|
|
|
Function divergence of 3D real function $`f(x,y,z)`$: $`\nabla \cdot f = \frac{df}{dx} +\frac{df}{dy} +\frac{df}{dz} `$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
|
|
|
* `divergence` - pointer to output divergence function which is array of size [nx\*ny\*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
`divergence` can be the same pointer as `f`, then result overwrites input.
|
|
|
## 3D curl:
|
|
|
```c
|
|
|
int wderiv_curl_3d_r(double *fx, double *fy, double *fz, double *curl_x, double *curl_y, double *curl_z);
|
|
|
```
|
|
|
Function computes curl of 3D real vector $`(f_x, f_y, f_z)`$: $`\nabla \times \vec{f} = (\frac{df_y}{dz} - \frac{df_z}{dy}, \frac{df_z}{dx} - \frac{df_x}{dz}, \frac{df_x}{dy} - \frac{df_y}{dx})`$.
|
|
|
* `fx` - pointer to input function which is array of size [nx\*ny\*nz]
|
|
|
* `fy` - pointer to input function which is array of size [nx\*ny\*nz]
|
|
|
* `fz` - pointer to input function which is array of size [nx\*ny\*nz]
|
|
|
* `curl_x` - pointer to output $`x`$-component function which is array of size [nx\*ny\*nz]
|
|
|
* `curl_y` - pointer to output $`y`$-component function which is array of size [nx\*ny\*nz]
|
|
|
* `curl_z` - pointer to output $`z`$-component function which is array of size [nx\*ny\*nz]
|
|
|
* `return` - error code
|
|
|
|
|
|
# 2D real derivatives:
|
|
|
## Basic 2D derivative function:
|
|
|
```c
|
|
|
int wderiv_derivative_2d_r(int direction, int n, double *f, double *deriv)
|
|
|
```
|
|
|
Function computes n-th derivative with respect to `direction` of 2D real function $`f(x,y)`$: $`\frac{\partial^n f}{\partial t^n}`$.
|
|
|
* `direction` - predefined integer corresponding to direction of derivative: `WDERIV_DX` or `WDERIV_DY`
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny]
|
|
|
* `deriv` - pointer to output derivative function which is array of size [nx\*ny]
|
|
|
* `return` - error code
|
|
|
|
|
|
`deriv` can be the same pointer as `f`, then result overwrites input.
|
|
|
## First 2D derivative functions:
|
|
|
```c
|
|
|
int wderiv_dfdx_2d_r(double *f, double *dfdx)
|
|
|
```
|
|
|
Function computes first derivative with respect to $`x`$ of 2D real function $`f(x,y)`$: $`\frac{\partial f}{\partial x}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny]
|
|
|
* `dfdx` - pointer to output derivative function which is array of size [nx\*ny]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dfdx` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
```c
|
|
|
int wderiv_dfdy_2d_r(double *f, double *dfdy)
|
|
|
```
|
|
|
Function computes first derivative with respect to $`y`$ of 2D real function $`f(x,y)`$: $`\frac{\partial f}{\partial y}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx*ny]
|
|
|
* `dfdy` - pointer to output derivative function which is array of size [nx*ny]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dfdy` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
## Second 2D derivative functions:
|
|
|
```c
|
|
|
int wderiv_d2fdx2_2d_r(double *f, double *d2fdx2)
|
|
|
```
|
|
|
Function computes second derivative with respect to $`x`$ of 2D real function $`f(x,y)`$: $`\frac{\partial^2 f}{\partial x^2}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny]
|
|
|
* `d2fdx2` - pointer to output derivative function which is array of size [nx\*ny]
|
|
|
* `return` - error code
|
|
|
|
|
|
`d2fdx2` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
```c
|
|
|
int wderiv_d2fdy2_2d_r(double *f, double *d2fdy2)
|
|
|
```
|
|
|
Function computes second derivative with respect to $`y`$ of 2D real function $`f(x,y)`$: $`\frac{\partial^2 f}{\partial y^2}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny]
|
|
|
* `d2fdy2` - pointer to output derivative function which is array of size [nx\*ny]
|
|
|
* `return` - error code
|
|
|
|
|
|
`d2fdy2` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
## n-th 2D derivative functions:
|
|
|
```c
|
|
|
int wderiv_dnfdxn_2d_r(int n, double *f, double *dnfdxn)
|
|
|
```
|
|
|
Function computes n-th derivative with respect to $`x`$ of 2D real function $`f(x,y)`$: $`(\frac{d^nf}{dx^n})`$.
|
|
|
* `f` - pointer to input function which is array of size [nx*ny]
|
|
|
* `dnfdxn` - pointer to output derivative function which is array of size [nx*ny]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dnfdxn` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
```c
|
|
|
int wderiv_dnfdyn_2d_r(int n, double *f, double *dnfdyn)
|
|
|
```
|
|
|
Function computes n-th derivative with respect to $`y`$ of 2D real function $`f(x,y)`$: $`(\frac{d^nf}{dy^n})`$.
|
|
|
* `f` - pointer to input function which is array of size [nx*ny]
|
|
|
* `dnfdyn` - pointer to output derivative function which is array of size [nx*ny]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dnfdyn` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
## 2D gradient:
|
|
|
```c
|
|
|
int wderiv_gradient_2d_r(double *f, double *dfdx, double *dfdy);
|
|
|
```
|
|
|
Function computes gradient of 2D real function $`f(x,y)`$: $`\nabla f = (\frac{df}{dx},\frac{df}{dy})`$.
|
|
|
* `f` - pointer to input function which is array of size [nx*ny]
|
|
|
* `dfdx` - pointer to output derivative function which is array of size [nx*ny]
|
|
|
* `dfdy` - pointer to output derivative function which is array of size [nx*ny]
|
|
|
* `return` - error code
|
|
|
|
|
|
## 2D gradient squared:
|
|
|
```c
|
|
|
int wderiv_gradient2_2d_r(double *f, double *gradient_square)
|
|
|
```
|
|
|
Function computes squared gradient of 2D real function $`f(x,y)`$: $`|\nabla f|^2 = |\frac{df}{dx}|^2 +|\frac{df}{dy}|^2`$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny]
|
|
|
* `gradient_square` - pointer to output gradient squared function which is array of size [nx\*ny]
|
|
|
* `return` - error code
|
|
|
|
|
|
`gradient_square` can be the same pointer as `f`, then result overwrites input.
|
|
|
## 2D laplacian:
|
|
|
```c
|
|
|
int wderiv_laplace_2d_r(double *f, double *laplace)
|
|
|
```
|
|
|
Function computes laplacian of 2D real function $`f(x,y)`$: $`|\Delta f|^2 = \frac{d^2f}{dx^2} +\frac{d^2f}{dy^2}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny]
|
|
|
* `laplace` - pointer to output laplacian function which is array of size [nx\*ny]
|
|
|
* `return` - error code
|
|
|
|
|
|
`laplace` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
## 2D divergence:
|
|
|
```c
|
|
|
int wderiv_divergence_2d_r(double *f, double *divergence)
|
|
|
```
|
|
|
Function divergence of 2D real function $`f(x,y)`$: $`\nabla \cdot f = \frac{df}{dx} +\frac{df}{dy}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx\*ny]
|
|
|
* `divergence` - pointer to output divergence function which is array of size [nx\*ny]
|
|
|
* `return` - error code
|
|
|
|
|
|
`divergence` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
# 1D real derivatives:
|
|
|
## Basic 1D derivative function:
|
|
|
```c
|
|
|
int wderiv_derivative_1d_r(int direction, int n, double *f, double *deriv)
|
|
|
```
|
|
|
Function computes n-th derivative with respect to `direction` of 1D real function $`f(x)`$: $`\frac{\partial^n f}{\partial t^n}`$.
|
|
|
* `direction` - predefined integer corresponding to direction of derivative: `WDERIV_DX`
|
|
|
* `f` - pointer to input function which is array of size [nx]
|
|
|
* `deriv` - pointer to output derivative function which is array of size [nx]
|
|
|
* `return` - error code
|
|
|
|
|
|
`deriv` can be the same pointer as `f`, then result overwrites input.
|
|
|
## First 1D derivative functions:
|
|
|
```c
|
|
|
int wderiv_dfdx_1d_r(double *f, double *dfdx)
|
|
|
```
|
|
|
Function computes first derivative with respect to $`x`$ of 1D real function $`f(x)`$: $`\frac{\partial f}{\partial x}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx]
|
|
|
* `dfdx` - pointer to output derivative function which is array of size [nx]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dfdx` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
## Second 1D derivative functions:
|
|
|
```c
|
|
|
int wderiv_d2fdx2_1d_r(double *f, double *d2fdx2)
|
|
|
```
|
|
|
Function computes second derivative with respect to $`x`$ of 1D real function $`f(x)`$: $`\frac{\partial^2 f}{\partial x^2}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx]
|
|
|
* `d2fdx2` - pointer to output derivative function which is array of size [nx]
|
|
|
* `return` - error code
|
|
|
|
|
|
`d2fdx2` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
## n-th 1D derivative functions:
|
|
|
```c
|
|
|
int wderiv_dnfdxn_1d_r(int n, double *f, double *dnfdxn)
|
|
|
```
|
|
|
Function computes n-th derivative with respect to $`x`$ of 1D real function $`f(x)`$: $`(\frac{d^nf}{dx^n})`$.
|
|
|
* `f` - pointer to input function which is array of size [nx]
|
|
|
* `dnfdxn` - pointer to output derivative function which is array of size [nx]
|
|
|
* `return` - error code
|
|
|
|
|
|
`dnfdxn` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
## 1D gradient:
|
|
|
```c
|
|
|
int wderiv_gradient_1d_r(double *f, double *dfdx);
|
|
|
```
|
|
|
Function computes gradient of 1D real function $`f(x)`$: $`\nabla f = (\frac{df}{dx})`$.
|
|
|
* `f` - pointer to input function which is array of size [nx]
|
|
|
* `dfdx` - pointer to output derivative function which is array of size [nx]
|
|
|
* `return` - error code
|
|
|
|
|
|
## 1D gradient squared:
|
|
|
```c
|
|
|
int wderiv_gradient2_1d_r(double *f, double *gradient_square)
|
|
|
```
|
|
|
Function computes squared gradient of 1D real function $`f(x)`$: $`|\nabla f|^2 = |\frac{df}{dx}|^2`$.
|
|
|
* `f` - pointer to input function which is array of size [nx]
|
|
|
* `gradient_square` - pointer to output gradient squared function which is array of size [nx]
|
|
|
* `return` - error code
|
|
|
|
|
|
`gradient_square` can be the same pointer as `f`, then result overwrites input.
|
|
|
## 1D laplacian:
|
|
|
```c
|
|
|
int wderiv_laplace_1d_r(double *f, double *laplace)
|
|
|
```
|
|
|
Function computes laplacian of 1D real function $`f(x)`$: $`|\Delta f|^2 = \frac{d^2f}{dx^2}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx]
|
|
|
* `laplace` - pointer to output laplacian function which is array of size [nx]
|
|
|
* `return` - error code
|
|
|
|
|
|
`laplace` can be the same pointer as `f`, then result overwrites input.
|
|
|
|
|
|
## 1D divergence:
|
|
|
```c
|
|
|
int wderiv_divergence_1d_r(double *f, double *divergence)
|
|
|
```
|
|
|
Function divergence of 1D real function $`f(x)`$: $`\nabla \cdot f = \frac{df}{dx}`$.
|
|
|
* `f` - pointer to input function which is array of size [nx]
|
|
|
* `divergence` - pointer to output divergence function which is array of size [nx]
|
|
|
* `return` - error code
|
|
|
|
|
|
`divergence` can be the same pointer as `f`, then result overwrites input. |