diff --git a/crates/coremem/src/sim/mod.rs b/crates/coremem/src/sim/mod.rs index 2c86d82..206be4f 100644 --- a/crates/coremem/src/sim/mod.rs +++ b/crates/coremem/src/sim/mod.rs @@ -143,7 +143,13 @@ impl<'a, R: Real, M: Material> Sample<'a, R, M> { } pub fn current_density(&self) -> Vec3 { - // TODO: does this make sense for Pml? + // TODO: justify/derive this. + // i guess the actual current density is the gradient of E multiplied by conductivity, + // and that when summed over a loop the negative terms from the neighbors are canceled + // when we grab their current density? + // + // or maybe it's $V = \int{E . dl} = IR$, so $I = \int{\sigma E . dl}$ + // in which case this might not be "current density", but something related. let conductivity = self.conductivity(); self.e().elem_mul(conductivity) } diff --git a/crates/coremem/src/stim.rs b/crates/coremem/src/stim.rs index 9e8073e..c096097 100644 --- a/crates/coremem/src/stim.rs +++ b/crates/coremem/src/stim.rs @@ -150,6 +150,7 @@ impl AbstractStimulus for CurlStimulus if self.region.contains(pos) { let (amt_e, amt_h) = self.stim.at(t_sec); let from_center_to_point = *pos - *self.center; + // TODO: is this inverted? let rotational = from_center_to_point.cross(*self.axis); let impulse_e = rotational.with_mag(amt_e.cast()).unwrap_or_default(); let impulse_h = rotational.with_mag(amt_h.cast()).unwrap_or_default();