clean up some unused code/imports

This commit is contained in:
2022-07-23 16:27:43 -07:00
parent 98773a350c
commit 67872de16f
3 changed files with 24 additions and 7 deletions

View File

@@ -3,13 +3,12 @@
//! search for the conditions which maximize energy transfer from the one core to the other.
use coremem::{Driver, mat, meas, SpirvDriver};
use coremem::geom::{region, Cube, Dilate, Memoize, Meters, Region, Spiral, SwapYZ, Torus, Translate, Wrap};
use coremem::geom::{region, Cube, Dilate, Memoize, Meters, Spiral, SwapYZ, Torus, Translate, Wrap};
use coremem::mat::{Ferroxcube3R1MH, IsoConductorOr};
use coremem::real::{R32, Real as _};
use coremem::render::CsvRenderer;
use coremem::stim::{CurlStimulus, Exp1, Gated, Sinusoid1, TimeVarying as _};
use coremem::sim::units::{Seconds, Frame, Time as _};
use coremem::sim::spirv;
use coremem::sim::units::{Seconds, Time as _};
use coremem::util::cache::DiskCache;
use log::{error, info, warn};
use serde::{Deserialize, Serialize};
@@ -151,24 +150,43 @@ struct Geometries {
wrap2_len: f32,
}
/// computed measurements which get written to disk for later, manual (or grep-based) analysis.
/// because we only write these (except for the Debug impl reading them to write to disk),
/// rustc thinks all the fields are dead.
#[derive(Clone, Debug, Default)]
struct Results {
#[allow(dead_code)]
m1_peak: f32,
#[allow(dead_code)]
m2_peak: f32,
#[allow(dead_code)]
m1_stable: f32,
#[allow(dead_code)]
m2_stable: f32,
#[allow(dead_code)]
h1_peak: f32,
#[allow(dead_code)]
h2_max: f32,
#[allow(dead_code)]
h2_min: f32,
#[allow(dead_code)]
h1_stable: f32,
#[allow(dead_code)]
h2_stable: f32,
#[allow(dead_code)]
iset_min: f32,
#[allow(dead_code)]
iset_max: f32,
#[allow(dead_code)]
icoupling_peak: f32,
#[allow(dead_code)]
peak_m_ratio: f32,
#[allow(dead_code)]
stable_m_ratio: f32,
/// m2_stable divided by m1_peak. i.e. "amplification"
#[allow(dead_code)]
m2_stable_m1_peak: f32,
#[allow(dead_code)]
t: f32,
}
@@ -428,8 +446,9 @@ fn run_sim(id: u32, p: Params, g: Geometries) -> Results {
));
};
let add_drive_step = |driver: &mut SpirvDriver<Mat>, region: &Torus, start: f32, amp: f32| {
add_drive_square_pulse(driver, region, start, 1.0, amp);
// step function: "permanently" increase the current by `amp`.
let _add_drive_step = |driver: &mut SpirvDriver<Mat>, region: &Torus, start: f32, amp: f32| {
add_drive_square_pulse(driver, region, start, 1.0 /* effectively infinite duration */, amp);
};
let add_drive_pulse = |ty: PulseType, driver: &mut SpirvDriver<Mat>, region: &Torus, start: f32, duration: f32, amp: f32| {