4.1.5.1.1 pde.backends.scipy.operators.cartesian module

This module implements differential operators on Cartesian grids using scipy.

make_laplace

Make a Laplace operator using the scipy module.

make_gradient

Make a gradient operator using the scipy module.

make_divergence

Make a divergence operator using the scipy module.

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, *, method='central')[source]

Make a divergence operator using the scipy module.

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

  • 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:

OperatorImplType

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

Make a gradient operator using the scipy module.

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

  • 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:

OperatorImplType

make_laplace(grid, **kwargs)[source]

Make a Laplace operator using the scipy module.

This only supports uniform discretizations.

Parameters:

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

Returns:

A function that can be applied to an array of values

Return type:

OperatorImplType

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:

OperatorImplType

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

Make a tensor divergence operator on a Cartesian grid.

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

  • 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:

OperatorImplType

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

Make a vector gradient operator on a Cartesian grid.

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

  • 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:

OperatorImplType

make_vector_laplace(grid)[source]

Make a vector Laplacian on a Cartesian grid.

Parameters:

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

Returns:

A function that can be applied to an array of values

Return type:

OperatorImplType