stim: remove the extra norm call in CurlStimulus application

we call `with_mag` after, making it redundant.
This commit is contained in:
2022-08-18 14:28:33 -07:00
parent 454307325b
commit 6e7ae48d86
2 changed files with 2 additions and 2 deletions

View File

@@ -385,7 +385,7 @@ fn main() {
// let stim = DynStimuli::from_vec(stim.map(MapIntoBoxStimulus).into_vec()); // let stim = DynStimuli::from_vec(stim.map(MapIntoBoxStimulus).into_vec());
let mut driver = driver.with_stimulus(stim); let mut driver = driver.with_stimulus(stim);
let prefix = "out/applications/multi_core_inverter/19-4ns-1e7A/"; let prefix = "out/applications/multi_core_inverter/20-4ns-1e7A/";
let _ = std::fs::create_dir_all(&prefix); let _ = std::fs::create_dir_all(&prefix);
driver.add_state_file(&*format!("{}state.bc", prefix), 6400); driver.add_state_file(&*format!("{}state.bc", prefix), 6400);
driver.add_serializer_renderer(&*format!("{}frame-", prefix), 6400, None); driver.add_serializer_renderer(&*format!("{}frame-", prefix), 6400, None);

View File

@@ -266,7 +266,7 @@ impl<R: Region + HasCrossSection, T: TimeVarying1 + Sync> AbstractStimulus for C
fn at(&self, t_sec: f32, pos: Meters) -> Fields { fn at(&self, t_sec: f32, pos: Meters) -> Fields {
if self.region.contains(pos) { if self.region.contains(pos) {
let FieldMags { e, h } = self.stim.at(t_sec); let FieldMags { e, h } = self.stim.at(t_sec);
let rotational = self.region.cross_section_normal(pos).norm(); let rotational = self.region.cross_section_normal(pos);
let impulse_e = rotational.with_mag(e.cast()).unwrap_or_default(); let impulse_e = rotational.with_mag(e.cast()).unwrap_or_default();
let impulse_h = rotational.with_mag(h.cast()).unwrap_or_default(); let impulse_h = rotational.with_mag(h.cast()).unwrap_or_default();
Fields { Fields {