4.1.2.1.4 pde.backends.numba.operators.polar_sym module
This module implements differential operators on polar grids.
Make a discretized laplace operator for a polar grid. |
|
Make a discretized gradient operator for a polar grid. |
|
Make a discretized gradient squared operator for a polar grid. |
|
Make a discretized divergence operator for a polar grid. |
|
Make a discretized vector gradient operator for a polar grid. |
|
Make a discretized tensor divergence operator for a polar grid. |
- make_divergence(grid, *, backend=None)[source]
Make a discretized divergence operator for a polar grid.
The polar grid assumes polar symmetry, so that fields only depend on the radial coordinate r. The radial discretization is defined as \(r_i = r_\mathrm{min} + (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\), where \(r_\mathrm{min}\) is the radius of the inner boundary, which is zero by default. Note that the radius of the outer boundary is given by \(r_\mathrm{max} = r_\mathrm{min} + N_r \Delta r\).
- Parameters:
grid (
PolarSymGrid) – The polar grid for which this operator will be definedbackend (
NumbaBackend) – References to the backend to read configuration details
- Returns:
A function that can be applied to an array of values
- Return type:
OperatorImplType
- make_gradient(grid, *, backend=None, method='central')[source]
Make a discretized gradient operator for a polar grid.
The polar grid assumes polar symmetry, so that fields only depend on the radial coordinate r. The radial discretization is defined as \(r_i = r_\mathrm{min} + (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\), where \(r_\mathrm{min}\) is the radius of the inner boundary, which is zero by default. Note that the radius of the outer boundary is given by \(r_\mathrm{max} = r_\mathrm{min} + N_r \Delta r\).
- Parameters:
grid (
PolarSymGrid) – The polar grid for which this operator will be definedbackend (
NumbaBackend) – References to the backend to read configuration detailsmethod (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_squared(grid, *, backend=None, central=True)[source]
Make a discretized gradient squared operator for a polar grid.
The polar grid assumes polar symmetry, so that fields only depend on the radial coordinate r. The radial discretization is defined as \(r_i = r_\mathrm{min} + (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\), where \(r_\mathrm{min}\) is the radius of the inner boundary, which is zero by default. Note that the radius of the outer boundary is given by \(r_\mathrm{max} = r_\mathrm{min} + N_r \Delta r\).
- Parameters:
grid (
PolarSymGrid) – The polar grid for which this operator will be definedbackend (
NumbaBackend) – References to the backend to read configuration detailscentral (bool) – Whether a central difference approximation is used for the gradient operator. If this is False, the squared gradient is calculated as the mean of the squared values of the forward and backward derivatives.
- Returns:
A function that can be applied to an array of values
- Return type:
OperatorImplType
- make_laplace(grid, *, backend=None)[source]
Make a discretized laplace operator for a polar grid.
The polar grid assumes polar symmetry, so that fields only depend on the radial coordinate r. The radial discretization is defined as \(r_i = r_\mathrm{min} + (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\), where \(r_\mathrm{min}\) is the radius of the inner boundary, which is zero by default. Note that the radius of the outer boundary is given by \(r_\mathrm{max} = r_\mathrm{min} + N_r \Delta r\).
- Parameters:
grid (
PolarSymGrid) – The polar grid for which this operator will be definedbackend (
NumbaBackend) – References to the backend to read configuration details
- Returns:
A function that can be applied to an array of values
- Return type:
OperatorImplType
- make_tensor_divergence(grid, *, backend=None)[source]
Make a discretized tensor divergence operator for a polar grid.
The polar grid assumes polar symmetry, so that fields only depend on the radial coordinate r. The radial discretization is defined as \(r_i = r_\mathrm{min} + (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\), where \(r_\mathrm{min}\) is the radius of the inner boundary, which is zero by default. Note that the radius of the outer boundary is given by \(r_\mathrm{max} = r_\mathrm{min} + N_r \Delta r\).
- Parameters:
grid (
PolarSymGrid) – The polar grid for which this operator will be definedbackend (
NumbaBackend) – References to the backend to read configuration details
- Returns:
A function that can be applied to an array of values
- Return type:
OperatorImplType
- make_vector_gradient(grid, *, backend=None)[source]
Make a discretized vector gradient operator for a polar grid.
The polar grid assumes polar symmetry, so that fields only depend on the radial coordinate r. The radial discretization is defined as \(r_i = r_\mathrm{min} + (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\), where \(r_\mathrm{min}\) is the radius of the inner boundary, which is zero by default. Note that the radius of the outer boundary is given by \(r_\mathrm{max} = r_\mathrm{min} + N_r \Delta r\).
- Parameters:
grid (
PolarSymGrid) – The polar grid for which this operator will be definedbackend (
NumbaBackend) – References to the backend to read configuration details
- Returns:
A function that can be applied to an array of values
- Return type:
OperatorImplType