4.2.3.1 pde.grids.operators.cartesian module

This module implements differential operators on Cartesian grids.

make_laplace

Make a Laplace operator on a Cartesian grid.

make_gradient

Make a gradient operator on a Cartesian grid.

make_divergence

Make a divergence operator on a Cartesian grid.

make_vector_gradient

Make a vector gradient operator on a Cartesian grid.

make_vector_laplace

Make a vector Laplacian on a Cartesian grid.

make_tensor_divergence

Make a tensor divergence operator on a Cartesian grid.

make_poisson_solver

Make a operator that solves Poisson's equation.

make_divergence(grid, *, backend='auto', method='central')[source]

Make a divergence operator on a Cartesian grid.

Parameters:
  • grid (CartesianGrid) – The grid for which the operator is created

  • backend (str) – Backend used for calculating the divergence operator. If backend=’auto’, a suitable backend is chosen automatically.

  • method (str) – The method for calculating the derivative. Possible values are ‘central’, ‘forward’, and ‘backward’.

Returns:

A function that can be applied to an array of values

Return type:

OperatorType

make_gradient(grid, *, backend='auto', method='central')[source]

Make a gradient operator on a Cartesian grid.

Parameters:
  • grid (CartesianGrid) – The grid for which the operator is created

  • backend (str) – Backend used for calculating the gradient operator. If backend=’auto’, a suitable backend is chosen automatically.

  • method (str) – The method for calculating the derivative. Possible values are ‘central’, ‘forward’, and ‘backward’.

Returns:

A function that can be applied to an array of values

Return type:

OperatorType

make_laplace(grid, *, backend='auto', **kwargs)[source]

Make a Laplace operator on a Cartesian grid.

Parameters:
  • grid (CartesianGrid) – The grid for which the operator is created

  • backend (str) – Backend used for calculating the Laplace operator. If backend=’auto’, a suitable backend is chosen automatically.

  • **kwargs – Specifies extra arguments influencing how the operator is created. Note that

Returns:

A function that can be applied to an array of values

Return type:

OperatorType

make_poisson_solver(bcs, *, method='auto')[source]

Make a operator that solves Poisson’s equation.

Parameters:
  • bcs (BoundariesList) – {ARG_BOUNDARIES_INSTANCE}

  • method (str) – Method used for calculating the tensor divergence operator. If method=’auto’, a suitable method is chosen automatically.

Returns:

A function that can be applied to an array of values

Return type:

OperatorType

make_tensor_divergence(grid, *, backend='numba', method='central')[source]

Make a tensor divergence operator on a Cartesian grid.

Parameters:
  • grid (CartesianGrid) – The grid for which the operator is created

  • backend (str) – Backend used for calculating the tensor divergence operator.

  • method (str) – The method for calculating the derivative. Possible values are ‘central’, ‘forward’, and ‘backward’.

Returns:

A function that can be applied to an array of values

Return type:

OperatorType

make_vector_gradient(grid, *, backend='numba', method='central')[source]

Make a vector gradient operator on a Cartesian grid.

Parameters:
  • grid (CartesianGrid) – The grid for which the operator is created

  • backend (str) – Backend used for calculating the vector gradient operator.

  • method (str) – The method for calculating the derivative. Possible values are ‘central’, ‘forward’, and ‘backward’.

Returns:

A function that can be applied to an array of values

Return type:

OperatorType

make_vector_laplace(grid, *, backend='numba')[source]

Make a vector Laplacian on a Cartesian grid.

Parameters:
  • grid (CartesianGrid) – The grid for which the operator is created

  • backend (str) – Backend used for calculating the vector Laplace operator.

Returns:

A function that can be applied to an array of values

Return type:

OperatorType