# 4.2.2.4. pde.grids.operators.polar_sym module¶

This module implements differential operators on polar grids

 make_laplace make a discretized laplace operator for a polar grid make_gradient make a discretized gradient operator for a polar grid make_divergence make a discretized divergence operator for a polar grid make_vector_gradient make a discretized vector gradient operator for a polar grid make_tensor_divergence make a discretized tensor divergence operator for a polar grid
make_divergence(grid: PolarSymGrid) [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 defined

Returns

A function that can be applied to an array of values

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 defined

Returns

A function that can be applied to an array of values

make_gradient_squared(grid: PolarSymGrid, central: bool = 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 defined

• central (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

make_laplace(grid: PolarSymGrid) [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 defined

Returns

A function that can be applied to an array of values

make_poisson_solver(bcs: Boundaries, method: str = 'auto') [source]

make a operator that solves Poisson’s equation

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
Returns

A function that can be applied to an array of values

make_tensor_divergence(grid: PolarSymGrid) [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 defined

Returns

A function that can be applied to an array of values

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$$.
grid (PolarSymGrid) – The polar grid for which this operator will be defined