fdtdx.ObjectContainer#

class fdtdx.ObjectContainer(object_list, *, volume_idx=null)[source]#

Bases: TreeClass

Container for managing simulation objects and their relationships.

This class provides a structured way to organize and access different types of simulation objects like sources, detectors, PML/periodic boundaries and devices. It maintains object lists and provides filtered access to specific object types.

Quick Reference#

Attributes

Methods

Attributes#

ObjectContainer.all_objects_diagonally_anisotropic_electric_conductivity#
ObjectContainer.all_objects_diagonally_anisotropic_magnetic_conductivity#
ObjectContainer.all_objects_diagonally_anisotropic_permeability#
ObjectContainer.all_objects_diagonally_anisotropic_permittivity#
ObjectContainer.all_objects_isotropic_electric_conductivity#
ObjectContainer.all_objects_isotropic_magnetic_conductivity#
ObjectContainer.all_objects_isotropic_permeability#
ObjectContainer.all_objects_isotropic_permittivity#
ObjectContainer.all_objects_non_dispersive#
ObjectContainer.all_objects_non_electrically_conductive#
ObjectContainer.all_objects_non_magnetic#
ObjectContainer.all_objects_non_magnetically_conductive#
ObjectContainer.backward_detectors#
ObjectContainer.bloch_objects#
ObjectContainer.boundary_objects#
ObjectContainer.detectors#
ObjectContainer.devices#
ObjectContainer.forward_detectors#
ObjectContainer.max_num_dispersive_poles#

Maximum number of dispersive poles required across all objects.

Walks every object (UniformMaterialObject, Device, StaticMultiMaterialObject) and returns the largest pole count of any Material attached to them. Drives the leading dimension of the per-cell dispersive coefficient and polarization arrays, which are zero-padded for materials with fewer poles.

ObjectContainer.object_list: list[SimulationObject]#

List of all simulation objects in the container.

ObjectContainer.objects#
ObjectContainer.pec_objects#
ObjectContainer.periodic_objects#
ObjectContainer.pmc_objects#
ObjectContainer.pml_objects#
ObjectContainer.sources#
ObjectContainer.static_material_objects#
ObjectContainer.volume#
ObjectContainer.volume_idx: int#

Index of the volume object in the object list.

Methods#

ObjectContainer.aset(attr_name, val, create_new_ok=False)#

Sets an attribute of this class. In contrast to the classical .at[].set(), this method updates the class attribute directly and does not only operate on jax pytree leaf nodes. Instead, replaces the full attribute with the new value.

The attribute can either be the attribute name of this class, or for nested classes it can also be the attribute name of a class, which itself is an attribute of this class. The syntax for this operation could look like this: “a->b->[0]->[‘name’]”. Here, the current class has an attribute a, which has an attribute b, which is a list, which we index at index 0, which is an element of type dictionary, which we index using the dictionary key ‘name’.

Note that dictionary keys cannot contain square brackets or single quotes (even if they are escaped).

Parameters:
  • attr_name (str) – Name of attribute to set

  • val (Any) – Value to set the attribute to

  • create_new_ok (bool, optional) – If false (default), throw an error if the attribute does not exist. If true, creates a new attribute if the attribute name does not exist yet.

Returns:

Updated instance with new attribute value

Return type:

Self

ObjectContainer.copy()[source]#
Return type:

ObjectContainer

ObjectContainer.get_class_fields()#
Return type:

list[TreeClassField]

ObjectContainer.get_public_fields()#
Return type:

list[TreeClassField]

ObjectContainer.index(name)[source]#
Return type:

int

ObjectContainer.replace_sources(sources)[source]#
Return type:

Self

If you find any errors in the documentation, please report them in the Github Issues!