mesh.Mesh.select_nodes#
- Mesh.select_nodes(nodsel, eltype=None)#
Return a Mesh with subsets of the original nodes.
Parameters#
- nodsel: 1-dim or 2-dim int array_like
An object that can be converted to a 1-dim or 2-dim array. Each row of nodsel holds a list of local node numbers that should be retained in the new connectivity table. See also
connectivity.Connectivity.select_nodes().- eltype:
ElementTypeor str, optional The element type or name for the new Mesh. It should be specified if the default for the plexitude would not be correct.
Returns#
- Mesh
A Mesh with the same node set as the input but other element connectivity and eltype
Examples#
From a Mesh of triangles, create a Mesh with the edges.
>>> M = Mesh(eltype='quad4').convert('tri3') >>> M.elems Elems([[0, 1, 2], [2, 3, 0]]..., eltype=Tri3) >>> M1 = M.select_nodes([(0,1), (1,2), (2,0)]) >>> M1.elems Elems([[0, 1], [1, 2], [2, 0], [2, 3], [3, 0], [0, 2]]..., eltype=Line2)