4.1.5.1.2 pde.backends.scipy.operators.common module

Common functions that are used by many operators.

make_general_poisson_solver(matrix, vector, method='auto')[source]

Make an operator that solves Poisson’s problem.

Parameters:
  • matrix – The (sparse) matrix representing the laplace operator on the given grid.

  • vector – The constant part representing the boundary conditions of the Laplace operator.

  • method (str) – The chosen method for implementing the operator

Returns:

A function that can be applied to an array of values to obtain the solution to Poisson’s equation where the array is used as the right hand side

Return type:

OperatorImplType

make_laplace_from_matrix(matrix, vector)[source]

Make a Laplace operator using matrix vector products.

Parameters:
  • matrix – (Sparse) matrix representing the laplace operator on the given grid

  • vector – Constant part representing the boundary conditions of the Laplace operator

Returns:

A function that can be applied to an array of values to obtain the result of applying the linear operator matrix and the offset given by vector.

Return type:

Callable[[NumericArray, NumericArray | None], NumericArray]

uniform_discretization(grid)[source]

Returns the uniform discretization or raises RuntimeError.

Parameters:

grid (GridBase) – The grid whose discretization is tested

Raises:

RuntimeError

Returns:

the common discretization of all axes

Return type:

float