4.2.3.2 pde.grids.operators.common module
Common functions that are used by many operators.
- make_derivative(grid, axis=0, method='central')[source]
Make a derivative operator along a single axis using numba compilation.
- Parameters:
- Returns:
A function that can be applied to an full array of values including those at ghost cells. The result will be an array of the same shape containing the actual derivatives at the valid (interior) grid points.
- Return type:
- make_derivative2(grid, axis=0)[source]
Make a second-order derivative operator along a single axis.
- Parameters:
- Returns:
A function that can be applied to an full array of values including those at ghost cells. The result will be an array of the same shape containing the actual derivatives at the valid (interior) grid points.
- Return type:
- 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:
- 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: