CSGDifference#
- class pinnx.geometry.CSGDifference(geom1, geom2)[source]#
Construct an object by CSG Difference.
- Parameters:
geom1 – The first geometry object.
geom2 – The second geometry object.
- 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.
- periodic_point(x, component)[source]#
Compute the periodic image of x for periodic boundary condition.
- Parameters:
x – A 2D array of shape (n, dim), where n is the number of points and dim is the dimension of the geometry.
component – The component of the periodic direction.
- 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