Disk#
- class pinnx.geometry.Disk(center, radius)[source]#
- background_points(x, dirn, dist2npt, shift)[source]#
Compute the background points for the collocation points.
- Parameters:
x – A 2D array of shape (n, dim), where n is the number of points and dim is the dimension of the geometry.
dirn – The direction of the background points. One of the following: -1 (left), or 1 (right), or 0 (both direction).
dist2npt – A function which converts distance to the number of extra points (not including x).
shift – The number of shift.
- 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.
- distance2boundary(x, dirn)[source]#
Compute the distance to 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.
dirn – A 2D array of shape (n, dim), where n is the number of points and dim is the dimension of the geometry. The direction of the distance computation. If dirn is not provided, the distance is computed in the normal direction.
- 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.
- mindist2boundary(x)[source]#
Compute the minimum distance to 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.
- 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