Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • wderiv wderiv
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wtools
  • wderivwderiv
  • Wiki
  • Complex derivatives

Last edited by Bartosz Ruszczak May 30, 2021
Page history
This is an old version of this page. You can view the most recent version or browse the history.

Complex derivatives

3D derivatives:

Basic 3D derivative function:

int wderiv_derivative_3d_r(int direction, int n, double complex *f, double complex *deriv)

Function computes n-th derivative with respect to direction of 3D complex 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:

int wderiv_dfdx_3d_r(double complex *f, double complex *dfdx)

Function computes first derivative with respect to x of 3D complex 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.

int wderiv_dfdy_3d_r(double complex *f, double complex *dfdy)

Function computes first derivative with respect to y of 3D complex function f(x,y,z): \frac{\partial f}{\partial y}.

  • f - pointer to input function which is array of size [nxnynz]
  • dfdy - pointer to output derivative function which is array of size [nxnynz]
  • return - error code

dfdy can be the same pointer as f, then result overwrites input.

int wderiv_dfdz_3d_r(double complex *f, double complex *dfdz)

Function computes first derivative with respect to z of 3D complex function f(x,y,z): \frac{\partial f}{\partial x}.

  • f - pointer to input function which is array of size [nxnynz]
  • dfdz - pointer to output derivative function which is array of size [nxnynz]
  • return - error code

dfdz can be the same pointer as f, then result overwrites input.

Second 3D derivative functions:

int wderiv_d2fdx2_3d_r(double complex *f, double complex *d2fdx2)

Function computes second derivative with respect to x of 3D complex 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.

int wderiv_d2fdy2_3d_r(double complex *f, double complex *d2fdy2)

Function computes second derivative with respect to y of 3D complex 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.

int wderiv_d2fdz2_3d_r(double complex *f, double complex *d2fdz2)

Function computes second derivative with respect to z of 3D complex function f(x,y,z): (\frac{d^2f}{dz^2}).

  • f - pointer to input function which is array of size [nxnynz]
  • d2fdz2 - pointer to output derivative function which is array of size [nxnynz]
  • return - error code

d2fdz2 can be the same pointer as f, then result overwrites input.

n-th 3D derivative functions:

int wderiv_dnfdxn_3d_r(int n, double complex *f, double complex *dnfdxn)

Function computes n-th derivative with respect to x of 3D complex function f(x,y,z): (\frac{d^nf}{dx^n}).

  • f - pointer to input function which is array of size [nxnynz]
  • dnfdxn - pointer to output derivative function which is array of size [nxnynz]
  • return - error code

dnfdxn can be the same pointer as f, then result overwrites input.

int wderiv_dnfdyn_3d_r(int n, double complex *f, double complex *dnfdyn)

Function computes n-th derivative with respect to y of 3D complex function f(x,y,z): (\frac{d^nf}{dy^n}).

  • f - pointer to input function which is array of size [nxnynz]
  • dnfdyn - pointer to output derivative function which is array of size [nxnynz]
  • return - error code

dnfdyn can be the same pointer as f, then result overwrites input.

int wderiv_dnfdzn_3d_r(int n, double complex *f, double complex *dnfdzn)

Function computes n-th derivative with respect to z of 3D complex function f(x,y,z): (\frac{d^nf}{dz^n}).

  • f - pointer to input function which is array of size [nxnynz]
  • dnfdzn - pointer to output derivative function which is array of size [nxnynz]
  • return - error code

dnfdzn can be the same pointer as f, then result overwrites input.

3D gradient:

int wderiv_gradient_3d_r(double complex *f, double complex *dfdx, double complex *dfdy, double complex *dfdz);

Function computes gradient of 3D complex 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 [nxnynz]
  • dfdx - pointer to output derivative function which is array of size [nxnynz]
  • dfdy - pointer to output derivative function which is array of size [nxnynz]
  • dfdz - pointer to output derivative function which is array of size [nxnynz]
  • return - error code

3D gradient squared:

int wderiv_gradient2_3d_r(double complex *f, double complex *gradient_square)

Function computes squared gradient of 3D complex 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:

int wderiv_laplace_3d_r(double complex *f, double complex *laplace)

Function computes laplacian of 3D complex 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:

int wderiv_divergence_3d_r(double complex *f, double complex *divergence)

Function divergence of 3D complex 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:

int wderiv_curl_3d_r(double complex *fx, double complex *fy, double complex *fz, double complex *curl_x, double complex *curl_y, double complex *curl_z);

Function computes curl of 3D complex 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 derivatives:

Basic 2D derivative function:

int wderiv_derivative_2d_r(int direction, int n, double complex *f, double complex *deriv)

Function computes n-th derivative with respect to direction of 2D complex 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:

int wderiv_dfdx_2d_r(double complex *f, double complex *dfdx)

Function computes first derivative with respect to x of 2D complex 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.

int wderiv_dfdy_2d_r(double complex *f, double complex *dfdy)

Function computes first derivative with respect to y of 2D complex 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:

int wderiv_d2fdx2_2d_r(double complex *f, double complex *d2fdx2)

Function computes second derivative with respect to x of 2D complex 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.

int wderiv_d2fdy2_2d_r(double complex *f, double complex *d2fdy2)

Function computes second derivative with respect to y of 2D complex 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:

int wderiv_dnfdxn_2d_r(int n, double complex *f, double complex *dnfdxn)

Function computes n-th derivative with respect to x of 2D complex 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.

int wderiv_dnfdyn_2d_r(int n, double complex *f, double complex *dnfdyn)

Function computes n-th derivative with respect to y of 2D complex 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:

int wderiv_gradient_2d_r(double complex *f, double complex *dfdx, double complex *dfdy);

Function computes gradient of 2D complex 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:

int wderiv_gradient2_2d_r(double complex *f, double complex *gradient_square)

Function computes squared gradient of 2D complex 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:

int wderiv_laplace_2d_r(double complex *f, double complex *laplace)

Function computes laplacian of 2D complex 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:

int wderiv_divergence_2d_r(double complex *f, double complex *divergence)

Function divergence of 2D complex 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 derivatives:

Basic 1D derivative function:

int wderiv_derivative_1d_r(int direction, int n, double complex *f, double complex *deriv)

Function computes n-th derivative with respect to direction of 1D complex 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:

int wderiv_dfdx_1d_r(double complex *f, double complex *dfdx)

Function computes first derivative with respect to x of 1D complex 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:

int wderiv_d2fdx2_1d_r(double complex *f, double complex *d2fdx2)

Function computes second derivative with respect to x of 1D complex 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:

int wderiv_dnfdxn_1d_r(int n, double complex *f, double complex *dnfdxn)

Function computes n-th derivative with respect to x of 1D complex 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:

int wderiv_gradient_1d_r(double complex *f, double complex *dfdx);

Function computes gradient of 1D complex 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:

int wderiv_gradient2_1d_r(double complex *f, double complex *gradient_square)

Function computes squared gradient of 1D complex 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:

int wderiv_laplace_1d_r(double complex *f, double complex *laplace)

Function computes laplacian of 1D complex 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:

int wderiv_divergence_1d_r(double complex *f, double complex *divergence)

Function divergence of 1D complex 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.

Clone repository
  • Complex derivatives
  • Gradient square
  • Initialization
  • Real derivatives
  • Home