Maths

Finite difference differentiation in 2D/3D

fiesta.maths.dfdx(xgrid: ndarray, f: ndarray, periodic: bool = False) ndarray

Differentiate using a symmetric two-point derivative and the non-symmetric three point derivative estimator.

Parameters:
  • xgrid (array) – X-axis.

  • f (array) – Function values at x.

  • periodic (bool, optional) – Sets periodic boundary conditions.

Returns:

dfdx – Numerical differentiation values for f evaluated at points x.

Return type:

array

fiesta.maths.dfdy(ygrid: ndarray, f: ndarray, periodic: bool = False) ndarray

Differentiate using a symmetric two-point derivative and the non-symmetric three point derivative estimator.

Parameters:
  • ygrid (array) – Y-axis.

  • f (array) – Function values at y.

  • periodic (bool, optional) – Sets periodic boundary conditions.

Returns:

dfdy – Numerical differentiation values for f evaluated at points y.

Return type:

array

fiesta.maths.dfdz(zgrid: ndarray, f: ndarray, periodic: bool = False) ndarray

Differentiate using a symmetric two-point derivative and the non-symmetric three point derivative estimator.

Parameters:
  • zgrid (array) – Z-axis.

  • f (array) – Function values at z.

  • periodic (bool, optional) – Sets periodic boundary conditions.

Returns:

dfdz – Numerical differentiation values for f evaluated at points z.

Return type:

array

fiesta.maths.mpi_dfdx(xgrid: ndarray, f: ndarray, MPI: object, periodic: bool = False) ndarray

Differentiate using a symmetric two-point derivative and the non-symmetric three point derivative estimator.

Parameters:
  • xgrid (array) – X-axis.

  • f (array) – Function values at x.

  • MPI (object) – shift.mpiutils MPI object.

  • periodic (bool, optional) – Sets periodic boundary conditions.

Returns:

dfdx – Numerical differentiation values for f evaluated at points x.

Return type:

array

fiesta.maths.mpi_dfdy(ygrid: ndarray, f: ndarray, MPI: object, periodic: bool = False) ndarray

Differentiate using a symmetric two-point derivative and the non-symmetric three point derivative estimator.

Parameters:
  • ygrid (array) – Y-axis.

  • f (array) – Function values at y.

  • MPI (object) – shift.mpiutils MPI object.

  • periodic (bool, optional) – Sets periodic boundary conditions.

Returns:

dfdy – Numerical differentiation values for f evaluated at points y.

Return type:

array

fiesta.maths.mpi_dfdz(zgrid: ndarray, f: ndarray, MPI: object, periodic: bool = False) ndarray

Differentiate using a symmetric two-point derivative and the non-symmetric three point derivative estimator.

Parameters:
  • zgrid (array) – Z-axis.

  • f (array) – Function values at z.

  • MPI (object) – shift.mpiutils MPI object.

  • periodic (bool, optional) – Sets periodic boundary conditions.

Returns:

dfdz – Numerical differentiation values for f evaluated at points z.

Return type:

array

Matrices

fiesta.maths.det3by3(m00: Tuple[float, ndarray], m01: Tuple[float, ndarray], m02: Tuple[float, ndarray], m10: Tuple[float, ndarray], m11: Tuple[float, ndarray], m12: Tuple[float, ndarray], m20: Tuple[float, ndarray], m21: Tuple[float, ndarray], m22: Tuple[float, ndarray]) Tuple[float, ndarray]

Computes the determinant of a matrix or a series of matrices

Parameters:
  • m00 (float or array) – Matrix element for row 0 and column 0.

  • m01 (float or array) – Matrix element for row 0 and column 1.

  • m02 (float or array) – Matrix element for row 0 and column 2.

  • m10 (float or array) – Matrix element for row 1 and column 0.

  • m11 (float or array) – Matrix element for row 1 and column 1.

  • m12 (float or array) – Matrix element for row 1 and column 2.

  • m20 (float or array) – Matrix element for row 2 and column 0.

  • m21 (float or array) – Matrix element for row 2 and column 1.

  • m22 (float or array) – Matrix element for row 2 and column 2.

Returns:

det – Determinant for the matrix/matrices.

Return type:

float or array

fiesta.maths.det4by4(m00: Tuple[float, ndarray], m01: Tuple[float, ndarray], m02: Tuple[float, ndarray], m03: Tuple[float, ndarray], m10: Tuple[float, ndarray], m11: Tuple[float, ndarray], m12: Tuple[float, ndarray], m13: Tuple[float, ndarray], m20: Tuple[float, ndarray], m21: Tuple[float, ndarray], m22: Tuple[float, ndarray], m23: Tuple[float, ndarray], m30: Tuple[float, ndarray], m31: Tuple[float, ndarray], m32: Tuple[float, ndarray], m33: Tuple[float, ndarray]) Tuple[float, ndarray]

Computes the determinant of a matrix or a series of matrices

Parameters:
  • m00 (float or array) – Matrix element for row 0 and column 0.

  • m01 (float or array) – Matrix element for row 0 and column 1.

  • m02 (float or array) – Matrix element for row 0 and column 2.

  • m03 (float or array) – Matrix element for row 0 and column 3.

  • m10 (float or array) – Matrix element for row 1 and column 0.

  • m11 (float or array) – Matrix element for row 1 and column 1.

  • m12 (float or array) – Matrix element for row 1 and column 2.

  • m13 (float or array) – Matrix element for row 1 and column 3.

  • m20 (float or array) – Matrix element for row 2 and column 0.

  • m21 (float or array) – Matrix element for row 2 and column 1.

  • m22 (float or array) – Matrix element for row 2 and column 2.

  • m23 (float or array) – Matrix element for row 2 and column 3.

  • m30 (float or array) – Matrix element for row 3 and column 0.

  • m31 (float or array) – Matrix element for row 3 and column 1.

  • m32 (float or array) – Matrix element for row 3 and column 2.

  • m33 (float or array) – Matrix element for row 3 and column 3.

Returns:

det – Determinant for the matrix/matrices.

Return type:

float or array