fdtdx.PositionConstraint

dataclass

PositionConstraint(
    *,
    object: SimulationObject,
    other_object: SimulationObject,
    axes: tuple[int, ...],
    object_positions: tuple[float, ...],
    other_object_positions: tuple[float, ...],
    margins: tuple[float, ...],
    grid_margins: tuple[int, ...]
)

Defines a positional relationship between two simulation objects.

A constraint that positions one object relative to another, with optional margins and offsets. Used to specify how objects should be placed in the simulation volume relative to each other.

Attributes:
  • object (SimulationObject) –

    The "child" object whose position is being adjusted

  • other_object (SimulationObject) –

    The "parent" object that serves as reference

  • axes (tuple[int, ...]) –

    Which axes (x,y,z) this constraint applies to

  • object_positions (tuple[float, ...]) –

    Relative positions on child object (-1 to 1)

  • other_object_positions (tuple[float, ...]) –

    Relative positions on parent object (-1 to 1)

  • margins (tuple[float, ...]) –

    Optional real-space margins between objects

  • grid_margins (tuple[int, ...]) –

    Optional grid-space margins between objects