Field Updates¶
Electric Field Updates¶
fdtdx.fdtd.update.update_E(time_step, arrays, objects, config, simulate_boundaries)
¶
Updates the electric field (E) according to Maxwell's equations using the FDTD method.
Implements the discretized form of dE/dt = (1/ε)∇×H on the Yee grid. Updates include: 1. PML boundary conditions if simulate_boundaries=True 2. Source contributions for active sources 3. Field updates based on curl of H field
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time_step
|
Array
|
Current simulation time step |
required |
arrays
|
ArrayContainer
|
Container with E, H fields and material properties |
required |
objects
|
ObjectContainer
|
Container with sources, PML and other simulation objects |
required |
config
|
SimulationConfig
|
Simulation configuration parameters |
required |
simulate_boundaries
|
bool
|
Whether to apply PML boundary conditions |
required |
Returns:
Type | Description |
---|---|
ArrayContainer
|
Updated ArrayContainer with new E field values |
Source code in src/fdtdx/fdtd/update.py
fdtdx.fdtd.update.update_E_reverse(time_step, arrays, objects, config)
¶
Reverse time step update for the electric field used in automatic differentiation.
Implements the inverse update step that transforms the electromagnetic field state from time step t+1 to time step t, leveraging the time-reversibility property of Maxwell's equations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time_step
|
Array
|
Current simulation time step |
required |
arrays
|
ArrayContainer
|
Container with E, H fields and material properties |
required |
objects
|
ObjectContainer
|
Container with sources and other simulation objects |
required |
config
|
SimulationConfig
|
Simulation configuration parameters |
required |
Returns:
Type | Description |
---|---|
ArrayContainer
|
Updated ArrayContainer with reversed E field values |
Source code in src/fdtdx/fdtd/update.py
Magnetic Field Updates¶
fdtdx.fdtd.update.update_H(time_step, arrays, objects, config, simulate_boundaries)
¶
Updates the magnetic field (H) according to Maxwell's equations using the FDTD method.
Implements the discretized form of dH/dt = -(1/μ)∇×E on the Yee grid. Updates include: 1. PML boundary conditions if simulate_boundaries=True 2. Source contributions for active sources 3. Field updates based on curl of E field
The H field is updated at time points offset by half steps from the E field updates, following the Yee grid scheme.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time_step
|
Array
|
Current simulation time step |
required |
arrays
|
ArrayContainer
|
Container with E, H fields and material properties |
required |
objects
|
ObjectContainer
|
Container with sources, PML and other simulation objects |
required |
config
|
SimulationConfig
|
Simulation configuration parameters |
required |
simulate_boundaries
|
bool
|
Whether to apply PML boundary conditions |
required |
Returns:
Type | Description |
---|---|
ArrayContainer
|
Updated ArrayContainer with new H field values |
Source code in src/fdtdx/fdtd/update.py
fdtdx.fdtd.update.update_H_reverse(time_step, arrays, objects, config)
¶
Reverse time step update for the magnetic field used in automatic differentiation.
Implements the inverse update step that transforms the electromagnetic field state from time step t+1 to time step t, leveraging the time-reversibility property of Maxwell's equations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time_step
|
Array
|
Current simulation time step |
required |
arrays
|
ArrayContainer
|
Container with E, H fields and material properties |
required |
objects
|
ObjectContainer
|
Container with sources and other simulation objects |
required |
config
|
SimulationConfig
|
Simulation configuration parameters |
required |
Returns:
Type | Description |
---|---|
ArrayContainer
|
Updated ArrayContainer with reversed H field values |