4.1.6.1.4 pde.backends.torch.operators.polar_sym module
This module implements differential operators on polar grids.
Polar Laplace using torch. |
|
Polar gradient operator using torch. |
|
Polar gradient squared operator using torch. |
|
Polar divergence operator using torch. |
|
Polar vector gradient operator using torch. |
|
Polar tensor divergence operator using torch. |
- class PolarDivergence(grid, bcs, *, dtype)[source]
Bases:
TorchDifferentialOperatorPolar divergence operator using torch.
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\).
Initialize the Polar divergence operator.
- Parameters:
grid (
GridBase) – The grid on which the operator actsbcs (
BoundariesListor None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.dtype (np.dtype) – The data type of the field
- class PolarGradient(grid, bcs, *, dtype, method='central')[source]
Bases:
TorchDifferentialOperatorPolar gradient operator using torch.
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\).
Initialize the Polar gradient operator.
- Parameters:
grid (
GridBase) – The grid on which the operator actsbcs (
BoundariesListor None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.dtype (np.dtype) – The data type of the field
method (str) – The method for calculating the derivative. Possible values are ‘central’, ‘forward’, and ‘backward’.
- class PolarGradientSquared(grid, bcs, *, central=True, dtype)[source]
Bases:
TorchDifferentialOperatorPolar gradient squared operator using torch.
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\).
Initialize the Polar gradient squared operator.
- Parameters:
grid (
GridBase) – The grid on which the operator actsbcs (
BoundariesListor None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.central (bool) – Whether to use central differences. If False, forward and backward differences are used.
dtype (np.dtype) – The data type of the field
- class PolarLaplacian(grid, bcs, *, dtype)[source]
Bases:
TorchDifferentialOperatorPolar Laplace using torch.
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\).
Initialize the Polar Laplacian operator.
- Parameters:
grid (
GridBase) – The grid on which the operator actsbcs (
BoundariesListor None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.dtype (np.dtype) – The data type of the field
- class PolarTensorDivergence(grid, bcs, *, dtype)[source]
Bases:
TorchDifferentialOperatorPolar tensor divergence operator using torch.
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\).
Initialize the Polar tensor divergence operator.
- Parameters:
grid (
GridBase) – The grid on which the operator actsbcs (
BoundariesListor None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.dtype (np.dtype) – The data type of the field
- class PolarVectorGradient(grid, bcs, *, dtype)[source]
Bases:
TorchDifferentialOperatorPolar vector gradient operator using torch.
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\).
Initialize the Polar vector gradient operator.
- Parameters:
grid (
GridBase) – The grid on which the operator actsbcs (
BoundariesListor None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.dtype (np.dtype) – The data type of the field