scimba_torch.domain.mesh_based_domain.cuboid

Defines the Cuboid domain and its components.

Classes

Cuboid(bounds[, is_main_domain])

Cuboid domain in n dimensions.

class Cuboid(bounds, is_main_domain=True, **kwargs)[source]

Bases: object

Cuboid domain in n dimensions.

At the moment, boundaries, inclusions and holes are not supported.

Parameters:
  • bounds (list[tuple[float, float]]) – The bounds of the cuboid.

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

  • **kwargs (Any) – Additional arguments.

uniform_mesh(n, **kwargs)[source]

Uniformly meshes the domain.

Parameters:
  • n (int | list | tuple) – Total number of mesh points. If the same number of points is used in each dimension, equal to n ** (1 / dim). If list or tuple, the number of points in each dimension.

  • **kwargs (Any) – Additional arguments.

Return type:

LabelTensor

Returns:

The mesh points.

flatten_mesh(mesh, mesh_size)[source]

Flattens a mesh.

Parameters:
  • mesh (tuple[Tensor, ...]) – The mesh.

  • mesh_size (int) – The size of the mesh.

Return type:

Tensor

Returns:

The flattened mesh.

to_volumetric_domain()[source]

Converts the cuboid to a volumetric domain.

Return type:

VolumetricDomain

Returns:

The volumetric domain.

Raises:

NotImplementedError – If the dimension is not supported.