4.1.5.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. |
- class SphericalDivergence(grid, bcs, *, dtype=<class 'numpy.float64'>, safe=None, conservative=None, method='central')[source]
Bases:
TorchOperatorSpherical 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 (AnyDType) – The data type of the field
safe (bool) – Add extra checks for the validity of the input. If None. the value is read from the configuration option operators.tensor_symmetry_check.
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=<class 'numpy.float64'>, method='central')[source]
Bases:
TorchOperatorSpherical 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 (AnyDType) – 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=<class 'numpy.float64'>)[source]
Bases:
TorchOperatorSpherical 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 (AnyDType) – The data type of the field
- class SphericalLaplacian(grid, bcs, *, dtype=<class 'numpy.float64'>, conservative=None)[source]
Bases:
TorchOperatorSpherical 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 (AnyDType) – 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.