Object Base Classes

fdtdx.objects.object.OrderableObject

fdtdx.objects.static_material.static.StaticMultiMaterialObject

Bases: OrderableObject, ABC

get_material_mapping abstractmethod

get_material_mapping() -> jax.Array

Returns an array, which represents the material index at every voxel. Specifically, it returns the index of the ordered material list.

Returns:
  • Array

    jax.Array: Index array

Source code in src/fdtdx/objects/static_material/static.py
33
34
35
36
37
38
39
40
41
42
43
@abstractmethod
def get_material_mapping(
    self,
) -> jax.Array:
    """Returns an array, which represents the material index at every voxel. Specifically, it returns the
    index of the ordered material list.

    Returns:
        jax.Array: Index array
    """
    raise NotImplementedError()

get_voxel_mask_for_shape abstractmethod

get_voxel_mask_for_shape() -> jax.Array

Get a binary mask of the objects shape. Everything voxel not in the mask, will not be updated by this object. For example, can be used to approximate a round shape. The mask is calculated in device voxel size, not in simulation voxels.

Returns:
  • Array

    jax.Array: Binary mask representing the voxels occupied by the object

Source code in src/fdtdx/objects/static_material/static.py
22
23
24
25
26
27
28
29
30
31
@abstractmethod
def get_voxel_mask_for_shape(self) -> jax.Array:
    """Get a binary mask of the objects shape. Everything voxel not in the mask, will not be updated by
    this object. For example, can be used to approximate a round shape.
    The mask is calculated in device voxel size, not in simulation voxels.

    Returns:
        jax.Array: Binary mask representing the voxels occupied by the object
    """
    raise NotImplementedError()