pysdic.Mesh.add_vertices#

Mesh.add_vertices(new_vertices, *, propagate_properties=True)[source]#

Return a new mesh with additional vertices (appended after the current ones, so the current indices are unchanged).

See pysdic.PointCloud.concatenate() for the properties.

Parameters:
  • new_vertices (Union[pysdic.PointCloud, ArrayLike]) – The new vertices, as a pysdic.PointCloud or an array of shape \((Q, E)\).

  • propagate_properties (bool, optional (default: True)) – If False, the new mesh has no vertex properties. The element properties are always copied.

Returns:

A new mesh with \(N_v + Q\) vertices.

Return type:

pysdic.Mesh

Examples

1import numpy
2from pysdic import Mesh
3
4mesh = Mesh([[0, 0, 0], [1, 0, 0], [0, 1, 0]], [[0, 1, 2]], element_type="triangle_3")
5mesh.vertices["u"] = [1.0, 2.0, 3.0]
6
7mesh = mesh.add_vertices([[1, 1, 0]])
8print(mesh.vertices["u"])  # [[ 1.] [ 2.] [ 3.] [nan]]