4.1.6.1.5 pde.backends.torch.operators.spherical_sym module
This module implements differential operators on spherical grids.
Spherical Laplace using torch. |
|
Spherical gradient operator using torch. |
|
Spherical gradient squared operator using torch. |
|
Spherical divergence operator using torch. |
|
Spherical vector gradient operator using torch. |
|
Spherical tensor divergence operator using torch. |
- class SphericalDivergence(grid, bcs, *, dtype, conservative=None, method='central')[source]
Bases:
TorchDifferentialOperatorSpherical divergence operator using torch.
The spherical grid assumes spherical 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 Spherical 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
conservative (bool) – Flag indicating whether the operator should be conservative (which results in slightly slower computations). Conservative operators ensure mass conservation. If None, the value is read from the configuration option operators.conservative_stencil.
method (str) – The method for calculating the derivative. Possible values are ‘central’, ‘forward’, and ‘backward’.
- class SphericalGradient(grid, bcs, *, dtype, method='central')[source]
Bases:
TorchDifferentialOperatorSpherical gradient operator using torch.
The spherical grid assumes spherical 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 Spherical 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 SphericalGradientSquared(grid, bcs, *, central=True, dtype)[source]
Bases:
TorchDifferentialOperatorSpherical gradient squared operator using torch.
The spherical grid assumes spherical 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 Spherical 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 SphericalLaplacian(grid, bcs, *, dtype, conservative=None)[source]
Bases:
TorchDifferentialOperatorSpherical Laplace using torch.
The spherical grid assumes spherical 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 Spherical 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
conservative (bool) – Flag indicating whether the Laplace operator should be conservative (which results in slightly slower computations). Conservative operators ensure mass conservation. If None, the value is read from the configuration option operators.conservative_stencil.
- class SphericalTensorDivergence(grid, bcs, *, dtype, conservative=False)[source]
Bases:
TorchDifferentialOperatorSpherical tensor divergence operator using torch.
The spherical grid assumes spherical 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 Spherical 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
conservative (bool) – Flag indicating whether the operator should be conservative (which results in slightly slower computations). Conservative operators ensure mass conservation. If None, the value is read from the configuration option operators.conservative_stencil.
- class SphericalVectorGradient(grid, bcs, *, dtype, method='central')[source]
Bases:
TorchDifferentialOperatorSpherical vector gradient operator using torch.
The spherical grid assumes spherical 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 Spherical 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
method (str) – The method for calculating the derivative. Possible values are ‘central’, ‘forward’, and ‘backward’.