pysdic.create_2d_quadrangle_4_rectangle#
- create_2d_quadrangle_4_rectangle(*, x_bounds=None, y_bounds=None, x_array=None, y_array=None, n_x=None, n_y=None, direct=True, uv_layout=0)[source]#
Create a 2D
quadrangle_4mesh (\(E = 2\)) of a rectangular grid.The grid of vertices is given, for each axis, either by bounds and a number of vertices (uniform grid), or by an array of coordinates.
Important
n_xandn_yare numbers of vertices, not elements.The vertex at the indices
i_xalong \(x\) andi_yalong \(y\) (both starting from 0) ismesh.coordinates[i_y * n_x + i_x].See also
pysdic.create_3d_quadrangle_4_heightmap()for a 3D surface \(z = f(x, y)\).- Parameters:
x_bounds (Optional[Tuple[Real, Real]], optional) – The bounds of the uniform grid along \(x\) and \(y\) (with
n_xandn_y).y_bounds (Optional[Tuple[Real, Real]], optional) – The bounds of the uniform grid along \(x\) and \(y\) (with
n_xandn_y).x_array (Optional[ArrayLike], optional) – The coordinates of the grid along \(x\) and \(y\) (instead of the bounds), with at least 2 values.
y_array (Optional[ArrayLike], optional) – The coordinates of the grid along \(x\) and \(y\) (instead of the bounds), with at least 2 values.
n_x (Optional[Integral], optional) – The numbers of vertices along \(x\) and \(y\) (\(\geq 2\)). Required with the bounds, checked against the arrays if given.
n_y (Optional[Integral], optional) – The numbers of vertices along \(x\) and \(y\) (\(\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 coordinates), otherwise clockwise.uv_layout (Integral, optional (default:
0)) – The UV mapping strategy, between 0 and 7 (seepysdic.create_uniform_quadrangle_4_mesh()).
- Returns:
The 2D
quadrangle_4mesh, with a UV map.- Return type:
Examples
1from pysdic import create_2d_quadrangle_4_rectangle 2 3mesh = create_2d_quadrangle_4_rectangle(x_bounds=(0, 2), y_bounds=(0, 1), n_x=5, n_y=3) 4print(mesh.n_dimensions, mesh.n_vertices, mesh.n_elements) # 2 15 8