pysdic.create_3d_quadrangle_4_spherical#
- create_3d_quadrangle_4_spherical(function=None, *, frame=None, t_bounds=None, p_bounds=None, t_array=None, p_array=None, n_t=None, n_p=None, direct=True, close=False, uv_layout=0)[source]#
Create a 3D
quadrangle_4mesh of a spherical surface with radius \(r = f(\theta, \phi)\).\(\theta\) is the polar angle, measured from the \(z\)-axis of the frame (between 0 and \(\pi\)), and \(\phi\) is the azimuthal angle, measured from its \(x\)-axis (between 0 and \(2\pi\)): the vertex is \((r \sin\theta \cos\phi, r \sin\theta \sin\phi, r \cos\theta)\).
Important
n_tandn_pare numbers of vertices, not elements.The vertex at the indices
i_talong \(\theta\) andi_palong \(\phi\) (both starting from 0) ismesh.coordinates[i_t * n_p + i_p].If
closeis True, the last and first azimuthal angles are connected by one more column of elements. For a uniform closed grid, usep_bounds=(0, 2 * pi * (1 - 1 / n_p)). The mesh is not closed at the poles: usepysdic.create_3d_triangle_3_spherical()for a closed sphere.- Parameters:
function (Optional[Callable[[numpy.ndarray, numpy.ndarray], ArrayLike]], optional) – The radius \(f(\theta, \phi)\), called once with the 2D grids of \(\theta\) and \(\phi\) (shape \((n_p, n_t)\)). It must return a scalar or an array of the same shape. By default, \(f = 1\).
frame (Optional[
py3dframe.Frame], optional (default:None)) – The local frame of the surface (see above). By default, the canonical frame. Requires the optional packagepy3dframe.t_bounds (Optional[Tuple[Real, Real]], optional) – The bounds of the uniform grid along \(\theta\) and \(\phi\) (with
n_tandn_p).p_bounds (Optional[Tuple[Real, Real]], optional) – The bounds of the uniform grid along \(\theta\) and \(\phi\) (with
n_tandn_p).t_array (Optional[ArrayLike], optional) – The coordinates of the grid along \(\theta\) and \(\phi\) (instead of the bounds), with at least 2 values.
p_array (Optional[ArrayLike], optional) – The coordinates of the grid along \(\theta\) and \(\phi\) (instead of the bounds), with at least 2 values.
n_t (Optional[Integral], optional) – The numbers of vertices along \(\theta\) and \(\phi\) (\(\geq 2\)). Required with the bounds, checked against the arrays if given.
n_p (Optional[Integral], optional) – The numbers of vertices along \(\theta\) and \(\phi\) (\(\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 \((\phi, \theta)\) plane, otherwise clockwise.close (bool, optional (default:
False)) – If True, the mesh is closed along \(\phi\).uv_layout (Integral, optional (default:
0)) – The UV mapping strategy, between 0 and 7 (seepysdic.create_uniform_quadrangle_4_mesh()).
- Returns:
The
quadrangle_4mesh, with a UV map.- Return type: