4.2.2.2. pde.grids.operators.common module

Common functions that are used by many operators

make_general_poisson_solver(matrix, vector, method: str = 'auto') Callable[[numpy.ndarray, numpy.ndarray], None][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

make_laplace_from_matrix(matrix, vector) Callable[[numpy.ndarray, numpy.ndarray], None][source]

make a Laplace operator using matrix vector products

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.

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

uniform_discretization(grid: GridBase) float[source]

returns the uniform discretization or raises RuntimeError