Containers¶
Object Container¶
fdtdx.objects.container.ObjectContainer
¶
Bases: ExtendedTreeClass
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 boundaries and devices. It maintains object lists and provides filtered access to specific object types.
Attributes:
Name | Type | Description |
---|---|---|
object_list |
list[SimulationObject]
|
List of all simulation objects in the container. |
volume_idx |
int
|
Index of the volume object in the object list. |
Source code in src/fdtdx/objects/container.py
Container for managing simulation objects and their relationships.
fdtdx.objects.container.ParameterContainer = dict[str, dict[str, jax.Array]]
module-attribute
¶
Type alias for parameter dictionaries containing JAX arrays.
Array Container¶
fdtdx.objects.container.ArrayContainer
¶
Bases: ExtendedTreeClass
Container for simulation field arrays and states.
This class holds the electromagnetic field arrays and various state information needed during FDTD simulation. It includes the E and H fields, material properties, and states for boundaries, detectors and recordings.
Attributes:
Name | Type | Description |
---|---|---|
E |
Array
|
Electric field array. |
H |
Array
|
Magnetic field array. |
inv_permittivities |
Array
|
Inverse permittivity values array. |
inv_permeabilities |
Array
|
Inverse permeability values array. |
boundary_states |
dict[str, BoundaryState]
|
Dictionary mapping boundary names to their states. |
detector_states |
dict[str, DetectorState]
|
Dictionary mapping detector names to their states. |
recording_state |
RecordingState | None
|
Optional state for recording simulation data. |
Source code in src/fdtdx/objects/container.py
Container for simulation field arrays and states.
fdtdx.objects.container.SimulationState = tuple[jax.Array, ArrayContainer]
module-attribute
¶
Type alias for time step and array state tuple.
Array Management¶
fdtdx.objects.container.reset_array_container(arrays, objects, reset_detector_states=False, reset_recording_state=False)
¶
Reset an ArrayContainer's fields and optionally its states.
This function creates a new ArrayContainer with zeroed E and H fields while preserving material properties. It can optionally reset detector and recording states.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arrays
|
ArrayContainer
|
The ArrayContainer to reset. |
required |
objects
|
ObjectContainer
|
ObjectContainer with simulation objects. |
required |
reset_detector_states
|
bool
|
Whether to zero detector states. |
False
|
reset_recording_state
|
bool
|
Whether to zero recording state. |
False
|
Returns:
Type | Description |
---|---|
ArrayContainer
|
A new ArrayContainer with reset fields and optionally reset states. |
Source code in src/fdtdx/objects/container.py
Reset array container fields and states.