4.1.6.1.3 pde.backends.torch.operators.cylindrical_sym module

This module implements differential operators on spherical grids.

CylindricalLaplacian

Cylindrical Laplace using torch.

CylindricalGradient

Cylindrical gradient operator using torch.

CylindricalGradientSquared

Cylindrical gradient squared operator using torch.

CylindricalDivergence

Cylindrical divergence operator using torch.

CylindricalVectorGradient

Cylindrical vector gradient operator using torch.

CylindricalVectorLaplacian

Cylindrical vector Laplacian operator using torch.

CylindricalTensorDivergence

Cylindrical tensor divergence operator using torch.

class CylindricalDivergence(grid, bcs, *, dtype)[source]

Bases: TorchDifferentialOperator

Cylindrical divergence operator using torch.

The cylindrical grid assumes polar symmetry, so that fields only depend on the radial coordinate r and the axial coordinate z. Here, the first axis is along the radius, while the second axis is along the axis of the cylinder. The radial discretization is defined as \(r_i = (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\).

Initialize the Cylindrical divergence operator.

Parameters:
  • grid (GridBase) – The grid on which the operator acts

  • bcs (BoundariesList or None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.

  • dtype (np.dtype) – The data type of the field

forward(arr, args=None)[source]

Fill internal data array, apply operator, and return valid data.

Parameters:

arr (Tensor)

Return type:

Tensor

rank_in = 1

The rank of the input tensor

Type:

int

class CylindricalGradient(grid, bcs, *, dtype)[source]

Bases: TorchDifferentialOperator

Cylindrical gradient operator using torch.

The cylindrical grid assumes polar symmetry, so that fields only depend on the radial coordinate r and the axial coordinate z. Here, the first axis is along the radius, while the second axis is along the axis of the cylinder. The radial discretization is defined as \(r_i = (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\).

Initialize the Cylindrical gradient operator.

Parameters:
  • grid (GridBase) – The grid on which the operator acts

  • bcs (BoundariesList or None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.

  • dtype (np.dtype) – The data type of the field

forward(arr, args=None)[source]

Fill internal data array, apply operator, and return valid data.

Parameters:

arr (Tensor)

Return type:

Tensor

rank_in = 0

The rank of the input tensor

Type:

int

class CylindricalGradientSquared(grid, bcs, *, central=True, dtype)[source]

Bases: TorchDifferentialOperator

Cylindrical gradient squared operator using torch.

The cylindrical grid assumes polar symmetry, so that fields only depend on the radial coordinate r and the axial coordinate z. Here, the first axis is along the radius, while the second axis is along the axis of the cylinder. The radial discretization is defined as \(r_i = (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\).

Initialize the Cylindrical gradient squared operator.

Parameters:
  • grid (GridBase) – The grid on which the operator acts

  • bcs (BoundariesList or 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

forward(arr, args=None)[source]

Fill internal data array, apply operator, and return valid data.

Parameters:

arr (Tensor)

Return type:

Tensor

rank_in = 0

The rank of the input tensor

Type:

int

class CylindricalLaplacian(grid, bcs, *, dtype)[source]

Bases: TorchDifferentialOperator

Cylindrical Laplace using torch.

The cylindrical grid assumes polar symmetry, so that fields only depend on the radial coordinate r and the axial coordinate z. Here, the first axis is along the radius, while the second axis is along the axis of the cylinder. The radial discretization is defined as \(r_i = (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\).

Initialize the Cylindrical Laplacian operator.

Parameters:
  • grid (GridBase) – The grid on which the operator acts

  • bcs (BoundariesList or None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.

  • dtype (np.dtype) – The data type of the field

forward(arr, args=None)[source]

Fill internal data array, apply operator, and return valid data.

Parameters:

arr (Tensor)

Return type:

Tensor

rank_in = 0

The rank of the input tensor

Type:

int

class CylindricalTensorDivergence(grid, bcs, *, dtype)[source]

Bases: TorchDifferentialOperator

Cylindrical tensor divergence operator using torch.

The cylindrical grid assumes polar symmetry, so that fields only depend on the radial coordinate r and the axial coordinate z. Here, the first axis is along the radius, while the second axis is along the axis of the cylinder. The radial discretization is defined as \(r_i = (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\).

Initialize the Cylindrical tensor divergence operator.

Parameters:
  • grid (GridBase) – The grid on which the operator acts

  • bcs (BoundariesList or None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.

  • dtype (np.dtype) – The data type of the field

forward(arr, args=None)[source]

Fill internal data array, apply operator, and return valid data.

Parameters:

arr (Tensor)

Return type:

Tensor

rank_in = 2

The rank of the input tensor

Type:

int

class CylindricalVectorGradient(grid, bcs, *, dtype)[source]

Bases: TorchDifferentialOperator

Cylindrical vector gradient operator using torch.

The cylindrical grid assumes polar symmetry, so that fields only depend on the radial coordinate r and the axial coordinate z. Here, the first axis is along the radius, while the second axis is along the axis of the cylinder. The radial discretization is defined as \(r_i = (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\).

Initialize the Cylindrical vector gradient operator.

Parameters:
  • grid (GridBase) – The grid on which the operator acts

  • bcs (BoundariesList or None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.

  • dtype (np.dtype) – The data type of the field

forward(arr, args=None)[source]

Fill internal data array, apply operator, and return valid data.

Parameters:

arr (Tensor)

Return type:

Tensor

rank_in = 1

The rank of the input tensor

Type:

int

class CylindricalVectorLaplacian(grid, bcs, *, dtype)[source]

Bases: TorchDifferentialOperator

Cylindrical vector Laplacian operator using torch.

The cylindrical grid assumes polar symmetry, so that fields only depend on the radial coordinate r and the axial coordinate z. Here, the first axis is along the radius, while the second axis is along the axis of the cylinder. The radial discretization is defined as \(r_i = (i + \frac12) \Delta r\) for \(i=0, \ldots, N_r-1\).

Initialize the Cylindrical vector Laplacian operator.

Parameters:
  • grid (GridBase) – The grid on which the operator acts

  • bcs (BoundariesList or None) – The boundary conditions applied to the field. If None, no boundary conditions are enforced.

  • dtype (np.dtype) – The data type of the field

forward(arr, args=None)[source]

Fill internal data array, apply operator, and return valid data.

Parameters:

arr (Tensor)

Return type:

Tensor

rank_in = 1

The rank of the input tensor

Type:

int