scimba_torch.domain.meshless_domain.domain_nd

nD domains.

Classes

CartesianProduct(domains[, is_main_domain])

Cartesian product of multiple domains.

HypercubeND(bounds[, is_main_domain])

Hypercube n-dimensional domain.

class HypercubeND(bounds, is_main_domain=False)[source]

Bases: VolumetricDomain

Hypercube 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.

full_bc_domain()[source]

Returns the full boundary condition domain for the Hypercube_nD.

Raises:

NotImplementedError – Hypercube_nD does not have a full boundary condition domain implemented.

class CartesianProduct(domains, is_main_domain=False)[source]

Bases: VolumetricDomain

Cartesian product of multiple domains.

Parameters:
  • domains (list[VolumetricDomain]) – list of domains to be combined

  • is_main_domain (bool) – Whether the domain is the main domain or not

Raises:

ValueError – If any of the domains have non-invertible mappings

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.

full_bc_domain()[source]

Returns the full boundary condition domain for the CartesianProduct.

Raises:

NotImplementedError – CartesianProduct does not have a full boundary condition domain implemented.