scimba_torch.domain.meshless_domain¶
Meshless domains.
- class Segment1D(low_high, is_main_domain=False)[source]¶
Bases:
VolumetricDomainSegment1D domain.
- Parameters:
low_high (
tuple[float,float] |list[tuple[float,float]] |Tensor) – Bounds of the segmentis_main_domain (
bool) – A flag to indicate if the domain can have subdomains and holes.
- full_bc_domain()[source]¶
Return the full boundary domain of the Segment1D.
- Return type:
list[SurfacicDomain]- Returns:
A list containing the two boundary Point1D domains.
- class Point1D(value, low_value, tol=1e-06)[source]¶
Bases:
SurfacicDomainPoint1D domain.
- Parameters:
value (
float|Tensor) – The position of the point.low_value (
bool) – Whether the point is at the lower bound.tol (
float) – A small tolerance value for the point.
- class ArcCircle2D(center, radius, theta1, theta2)[source]¶
Bases:
SurfacicDomainArcCircle2D domain.
- Parameters:
center (
tuple[float,float] |Tensor) – Center of the circle.radius (
float) – Radius of the circle.theta1 (
float) – Start angle of the arc in radians.theta2 (
float) – End angle of the arc in radians.
- class Circle2D(center, radius)[source]¶
Bases:
SurfacicDomainCircle2D domain.
- Parameters:
center (
tuple[float,float] |Tensor) – Center of the circle.radius (
float) – Radius of the circle.
- class Disk2D(center, radius, is_main_domain=False)[source]¶
Bases:
VolumetricDomainDisk2D domain.
- Parameters:
center (
Tensor) – Center of the disk.radius (
float) – Radius of the disk.is_main_domain (
bool) – Whether this domain is the main domain.
- full_bc_domain()[source]¶
Return the full boundary domain of the Disk2D.
- Return type:
list[SurfacicDomain]- Returns:
A list containing the boundary Circle2D domain.
- class Polygon2D(vertices, threshold=0.01, is_main_domain=False)[source]¶
Bases:
VolumetricDomainPolygon2D domain.
The vertices must be given in counter-clockwise order.
- Parameters:
vertices (
list[tuple[float,float]]) – Vertices of the polygon.threshold (
float) – Threshold for the polygonal approximation.is_main_domain (
bool) – Whether this domain is the main domain.
- full_bc_domain()[source]¶
Return the full boundary domain of the Polygon2D.
- Return type:
list[SurfacicDomain]- Returns:
A list containing the boundary Segment2D domains.
- class Segment2D(pt1, pt2)[source]¶
Bases:
SurfacicDomainSegment2D domain.
- Parameters:
pt1 (
tuple[float,float] |Tensor) – First point of the segment.pt2 (
tuple[float,float] |Tensor) – Second point of the segment.
- class Square2D(bounds, is_main_domain=False)[source]¶
Bases:
VolumetricDomainSquare2D domain.
- Parameters:
bounds (
list[tuple[float,float]]) – Bounds of the square in the form [(min_x, max_x), (min_y, max_y)].is_main_domain (
bool) – Whether this domain is the main domain.
- Raises:
ValueError – If bounds is not of shape (2, 2).
- class Cube3D(bounds, is_main_domain=False)[source]¶
Bases:
VolumetricDomainCube3D domain.
- Parameters:
bounds (
list[tuple[float,float]] |Tensor) – Bounds of the cube in the form [(min_x, max_x), (min_y, max_y), (min_z, max_z)]is_main_domain (
bool) – Whether this domain is the main domain.
- class Cylinder3D(radius, length, is_main_domain=False)[source]¶
Bases:
VolumetricDomainA Cylinder3D domain around \(z\) axis.
- Parameters:
radius (
float) – Radius of the cylinderlength (
float) – Length of the cylinderis_main_domain (
bool) – Whether the domain is the main domain or not
- class Disk3D(center, radius, is_main_domain=False)[source]¶
Bases:
VolumetricDomainDisk3D domain.
- Parameters:
center (
tuple[float,float,float] |Tensor) – Center of the disk.radius (
float) – Radius of the disk.is_main_domain (
bool) – Whether this domain is the main domain.
- full_bc_domain()[source]¶
Return the full boundary domain of the Disk3D.
- Return type:
list[SurfacicDomain]- Returns:
A list containing the boundary Sphere3D domain.
- class Sphere3D(center, radius)[source]¶
Bases:
SurfacicDomain3D sphere domain.
- Parameters:
center (
tuple[float,float,float] |Tensor) – Center of the sphere.radius (
float) – Radius of the sphere.
- class Square3D(origin, x_dir, y_dir)[source]¶
Bases:
SurfacicDomainSquare3D domain.
- Parameters:
origin (
tuple[float,float,float] |Tensor) – Vector defining the origin of the squarex_dir (
tuple[float,float,float] |Tensor) – Vector defining the x directiony_dir (
tuple[float,float,float] |Tensor) – Vector defining the y direction
- class SurfaceTorus3D(radius, tube_radius, center=(0, 0, 0))[source]¶
Bases:
SurfacicDomainSurfaceTorus3D domain around :math: z axis.
- Parameters:
radius (
float) – Radius of the torus (distance from the center to the center of the tube).tube_radius (
float) – Radius of the tube.center (
Tensor) – Center of the torus.
- class Torus3D(radius, tube_radius, center=(0, 0, 0), is_main_domain=True)[source]¶
Bases:
VolumetricDomainTorus3D domain around :math: z axis.
- Parameters:
radius (
float) – Radius of the torus (distance from the center to the center of the tubetube_radius (
float) – Radius of the tube.center (
Tensor|tuple[float,float,float]) – Center of the torus.is_main_domain (
bool) – Whether the domain is the main domain or not
- full_bc_domain()[source]¶
Returns the boundary condition domain of the torus.
- Return type:
list[SurfacicDomain]- Returns:
A list with a single SurfaceTorus3D domain.
- class TorusFrom2DVolume(base_volume, radius, is_main_domain=True)[source]¶
Bases:
VolumetricDomainTorus from 2D volume domain.
Creates a Torus by revolving a 2D VolumetricDomain around the \(z\) axis.
- Parameters:
base_volume (
VolumetricDomain) – A 2D VolumetricDomain to be revolved around the \(z\) axis.radius (
float) – Radius of the torus.is_main_domain (
bool) – Whether this domain is the main domain.
- Raises:
TypeError – If base_volume is not a VolumetricDomain instance.
ValueError – If base_volume is not a 2D domain. If base_volume does not have an invertible mapping.
- is_inside(x)[source]¶
Test if N points x are inside the domain (before mapping if any).
- Parameters:
x (
Tensor) – Tensor of shape (N, dim) representing the points to test.- Return type:
Tensor- Returns:
Boolean tensor of shape (N,) indicating if the points are inside the domain.
- is_outside(x)[source]¶
Test if N points x are outside the domain (before mapping if any).
- Parameters:
x – Tensor of shape (N, dim) representing the points to test.
- Returns:
- Boolean tensor of shape (N,) indicating if the points are outside
the domain.
- is_on_boundary(x, tol=0.0001)[source]¶
Test if N points x are on the boundary of the domain (before mapping if any).
- Parameters:
x – Tensor of shape (N, dim) representing the points to test.
tol – Tolerance for the test (Default value = 1e-4).
- Returns:
Boolean tensor of shape (N,) indicating if the points are on the boundary.
- full_bc_domain()[source]¶
Return the full boundary domain of the Torus_from2DVolume.
- Return type:
list[SurfacicDomain]- Returns:
A list with a SurfaceTorus_from2DSurface domain for each boundary of the base_volume.
- class HypercubeND(bounds, is_main_domain=False)[source]¶
Bases:
VolumetricDomainHypercube n-dimensional domain.
- Parameters:
bounds (
list[tuple[float,float]] |Tensor) – A list of tuples representing the bounds of the cube in each dimension.is_main_domain (
bool) – A flag to indicate if the domain can have subdomains and holes.
Modules