pysdic.create_2d_quadrangle_4_polar#

create_2d_quadrangle_4_polar(*, r_bounds=None, t_bounds=None, r_array=None, t_array=None, n_r=None, n_t=None, direct=True, close=False, uv_layout=0)[source]#

Create a 2D quadrangle_4 mesh (\(E = 2\)) of a polar grid: an annulus or a sector of an annulus.

The vertex at the radius \(r\) and the angle \(\theta\) is \((r \cos\theta, r \sin\theta)\).

Important

n_r and n_t are numbers of vertices, not elements.

The vertex at the indices i_r along \(r\) and i_t along \(\theta\) (both starting from 0) is mesh.coordinates[i_t * n_r + i_r].

If close is True, the last and first angles are connected by one more ring of elements. For a uniform closed grid, use t_bounds=(0, 2 * pi * (1 - 1 / n_t)).

The radii must be strictly positive: at \(r = 0\) the quadrangles would be degenerated. Use pysdic.create_2d_triangle_3_polar() with stick=True for a disk.

See also

pysdic.create_3d_quadrangle_4_cylindrical() for a 3D cylindrical surface.

Parameters:
  • r_bounds (Optional[Tuple[Real, Real]], optional) – The bounds of the uniform grid along \(r\) and \(\theta\) (with n_r and n_t).

  • t_bounds (Optional[Tuple[Real, Real]], optional) – The bounds of the uniform grid along \(r\) and \(\theta\) (with n_r and n_t).

  • r_array (Optional[ArrayLike], optional) – The coordinates of the grid along \(r\) and \(\theta\) (instead of the bounds), with at least 2 values.

  • t_array (Optional[ArrayLike], optional) – The coordinates of the grid along \(r\) and \(\theta\) (instead of the bounds), with at least 2 values.

  • n_r (Optional[Integral], optional) – The numbers of vertices along \(r\) and \(\theta\) (\(\geq 2\)). Required with the bounds, checked against the arrays if given.

  • n_t (Optional[Integral], optional) – The numbers of vertices along \(r\) and \(\theta\) (\(\geq 2\)). Required with the bounds, checked against the arrays if given.

  • direct (bool, optional (default: True)) – If True, the vertices of the quadrangles are ordered counterclockwise in the plane (for increasing radii and angles), otherwise clockwise.

  • close (bool, optional (default: False)) – If True, the mesh is closed along \(\theta\).

  • uv_layout (Integral, optional (default: 0)) – The UV mapping strategy, between 0 and 7 (see pysdic.create_uniform_quadrangle_4_mesh()), with \(r\) as the first axis of the grid and \(\theta\) as the second one.

Returns:

The 2D quadrangle_4 mesh, with a UV map.

Return type:

pysdic.Mesh

Raises:

ValueError – If a radius is not strictly positive, or if an input has a wrong value.

Examples

A closed annulus of radii 1 and 2.

1import numpy
2from pysdic import create_2d_quadrangle_4_polar
3
4n_t = 24
5mesh = create_2d_quadrangle_4_polar(
6    r_bounds=(1, 2), n_r=4, t_bounds=(0, 2 * numpy.pi * (1 - 1 / n_t)), n_t=n_t, close=True,
7)
8print(mesh.n_vertices, mesh.n_elements)  # 96 72