pub struct FdtdTmz {
pub hx: Vec<f64>,
pub hy: Vec<f64>,
/* private fields */
}Expand description
A two-dimensional TMz FDTD grid with a perfectly matched layer.
Fields§
§hx: Vec<f64>η₀ H_x at (i, j + ½).
hy: Vec<f64>η₀ H_y at (i + ½, j).
Implementations§
Source§impl FdtdTmz
impl FdtdTmz
Sourcepub fn new(
nx: usize,
ny: usize,
delta: f64,
courant: f64,
pml_cells: usize,
) -> Result<Self, ErrorsJSL>
pub fn new( nx: usize, ny: usize, delta: f64, courant: f64, pml_cells: usize, ) -> Result<Self, ErrorsJSL>
An nx × ny grid of square cells of side delta with a PML of pml_cells on every side,
graded polynomially (order 3) for a normal-incidence reflection of about 1e-6.
pub fn dimensions(&self) -> (usize, usize)
pub fn time_step(&self) -> f64
pub fn time(&self) -> f64
Sourcepub fn set_permittivity(
&mut self,
i0: usize,
i1: usize,
j0: usize,
j1: usize,
eps_r: f64,
)
pub fn set_permittivity( &mut self, i0: usize, i1: usize, j0: usize, j1: usize, eps_r: f64, )
Sets the relative permittivity in the box [i0, i1) × [j0, j1).
Sourcepub fn set_pec(&mut self, i0: usize, i1: usize, j0: usize, j1: usize)
pub fn set_pec(&mut self, i0: usize, i1: usize, j0: usize, j1: usize)
Makes the box [i0, i1) × [j0, j1) a perfect electric conductor (E_z = 0).
Sourcepub fn step(&mut self, source: Option<(usize, usize, f64)>)
pub fn step(&mut self, source: Option<(usize, usize, f64)>)
Advances one time step with an optional soft source added to E_z at (i, j).
Sourcepub fn interior_energy(&self, pml_cells: usize) -> f64
pub fn interior_energy(&self, pml_cells: usize) -> f64
The electromagnetic energy proxy Σ (ε_r E_z² + H̃²) over the interior (outside the PML).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FdtdTmz
impl RefUnwindSafe for FdtdTmz
impl Send for FdtdTmz
impl Sync for FdtdTmz
impl Unpin for FdtdTmz
impl UnsafeUnpin for FdtdTmz
impl UnwindSafe for FdtdTmz
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more