PointCloud#

class pinnx.geometry.PointCloud(points, boundary_points=None, boundary_normals=None)[source]#

A geometry represented by a point cloud, i.e., a set of points in space.

Parameters:
  • points – A 2-D NumPy array. If boundary_points is not provided, points can include points both inside the geometry or on the boundary; if boundary_points is provided, points includes only points inside the geometry.

  • boundary_points – A 2-D NumPy array.

  • boundary_normals – A 2-D NumPy array.

boundary_normal(x)[source]#

Compute the unit normal at x for Neumann or Robin boundary conditions.

Parameters:

x – A 2D array of shape (n, dim), where n is the number of points and dim is the dimension of the geometry.

inside(x)[source]#

Check if x is inside the geometry (including the boundary).

Parameters:

x – A 2D array of shape (n, dim), where n is the number of points and dim is the dimension of the geometry.

Returns:

A boolean array of shape (n,) where each element is True if the point is inside the geometry.

on_boundary(x)[source]#

Check if x is on the geometry boundary.

Parameters:

x – A 2D array of shape (n, dim), where n is the number of points and dim is the dimension of the geometry.

Returns:

A boolean array of shape (n,) where each element is True if the point is on the boundary.

random_boundary_points(n, random='pseudo')[source]#

Compute the random point locations on the boundary.

random_points(n, random='pseudo')[source]#

Compute the random point locations in the geometry.

Parameters:
  • n – The number of points.

  • random – The random distribution. One of the following: “pseudo” (pseudorandom), “LHS” (Latin hypercube sampling), “Halton” (Halton sequence), “Hammersley” (Hammersley sequence), or “Sobol” (Sobol sequence