multi_core_inverter: add the second core
This commit is contained in:
@@ -48,30 +48,33 @@ fn main() {
|
||||
let io_major = um(80);
|
||||
let io_minor = um(30);
|
||||
|
||||
let s0x = um(400);
|
||||
let sx = |n| um((n+1) * 400);
|
||||
let sy = um(400);
|
||||
let sz = um(160);
|
||||
|
||||
let sim_bounds = Meters::new(s0x * 2.0, sy * 2.0, sz * 2.0);
|
||||
let sim_bounds = Meters::new(sx(2) + um(400), sy * 2.0, sz * 2.0);
|
||||
let sim_padding = Meters::new(um(80), um(80), um(80));
|
||||
let duration = Seconds(ns(1));
|
||||
|
||||
let s0 = Torus::new_xy(Meters::new(s0x, sy, sz), s_major, s_minor);
|
||||
let drive0 = Torus::new_xz(Meters::new(s0x - s_major, sy, sz), io_major, io_minor);
|
||||
let ctl0 = Torus::new_yz(Meters::new(s0x, sy + s_major, sz), io_major, io_minor);
|
||||
let drive0 = Torus::new_xz(Meters::new(sx(0) - s_major, sy, sz), io_major, io_minor);
|
||||
let ctl = |n| Torus::new_yz(Meters::new(sx(n), sy + s_major, sz), io_major, io_minor);
|
||||
let s = |n| Torus::new_xy(Meters::new(sx(n), sy, sz), s_major, s_minor);
|
||||
|
||||
let ferro_mat = Ferroxcube3R1MH::new();
|
||||
let wire_mat = IsomorphicConductor::new(1e6);
|
||||
let ferro_mat = wire_mat;
|
||||
// let ferro_mat = Ferroxcube3R1MH::new(); // uncomment when ready to simulate for real
|
||||
|
||||
let mut driver: SpirvDriver<Mat> = Driver::new_spirv(sim_bounds, feat_size);
|
||||
driver.add_classical_boundary(sim_padding);
|
||||
driver.fill_region(&s0, ferro_mat);
|
||||
driver.fill_region(&drive0, wire_mat);
|
||||
driver.fill_region(&ctl0, wire_mat);
|
||||
for core in 0..2 {
|
||||
driver.fill_region(&s(core), ferro_mat);
|
||||
driver.fill_region(&ctl(core), wire_mat);
|
||||
}
|
||||
|
||||
let prefix = "out/applications/multi_core_inverter/3/";
|
||||
let prefix = "out/applications/multi_core_inverter/0/";
|
||||
let _ = std::fs::create_dir_all(&prefix);
|
||||
driver.add_state_file(&*format!("{}state.bc", prefix), 9600);
|
||||
// driver.add_state_file(&*format!("{}state.bc", prefix), 9600);
|
||||
driver.add_serializer_renderer(&*format!("{}frame-", prefix), 36000, None);
|
||||
driver.add_csv_renderer(&*format!("{}meas.csv", prefix), 400, None);
|
||||
driver.set_steps_per_stim(200);
|
||||
|
Reference in New Issue
Block a user