scimba_torch.domain.meshless_domain.domain_3d¶
Basic Volumetric and Surfacic domains in 3D.
Classes
|
Cube3D domain. |
|
A Cylinder3D domain around \(z\) axis. |
|
Disk3D domain. |
|
3D sphere domain. |
|
Square3D domain. |
|
SurfaceTorus3D domain around :math: z axis. |
|
Surface Torus from 2D surface domain. |
|
Torus3D domain around :math: z axis. |
|
Torus from 2D volume domain. |
- 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 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 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 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 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 SurfaceTorusFrom2DSurface(radius, base_surface)[source]¶
Bases:
SurfacicDomainSurface Torus from 2D surface domain.
Creates a Torus Surface by revolving a 2D SurfacicDomain around the \(z\) axis.
- Parameters:
radius (
float) – Radius of the torus.base_surface (
SurfacicDomain) – A 2D SurfacicDomain to be revolved around the \(z\) axis.
- Raises:
TypeError – If base_surface is not a SurfacicDomain instance.
ValueError – If base_surface is not a 2D 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