Minor cleanup to Render size

This commit is contained in:
2020-10-03 22:13:59 -07:00
parent 0642f52172
commit 4ac48bd3f1
4 changed files with 24 additions and 17 deletions

View File

@@ -4,18 +4,19 @@ use coremem::stim::{Stimulus, Sinusoid};
fn main() {
coremem::init_logging();
let feat_size = 5e-6; // feature size
let feat_size = 10e-6; // feature size
let from_m = |m| (m/feat_size) as u32;
let m_to_um = |px| (px * 1e6) as u32;
let to_m = |px| px as Flt * feat_size;
let width = 2000e-6;
let depth = 500e-6;
let width = 1000e-6;
let depth = 600e-6;
let conductor_inner_rad = 0e-6;
let conductor_outer_rad = 5e-6;
let ferro_inner_rad = 220e-6;
let ferro_outer_rad = 300e-6;
let buffer = 100e-6;
let peak_current = 1e-80;
let conductor_outer_rad = 19e-6;
let ferro_inner_rad = 100e-6;
let ferro_outer_rad = 200e-6;
let buffer = 50e-6;
let peak_current = 2e3;
let current_duration = 1e-9; // half-wavelength of the sine wave
let conductivity = 1.0e5;
let half_width = width * 0.5;
let half_depth = depth * 0.5;
@@ -24,14 +25,15 @@ fn main() {
let depth_px = from_m(depth);
let size_px = Index((width_px, width_px, depth_px).into());
let mut driver = Driver::new(size_px, feat_size);
//driver.set_steps_per_frame(8);
driver.set_steps_per_frame(8);
//driver.set_steps_per_frame(40);
//driver.set_steps_per_frame(200);
driver.add_y4m_renderer(&*format!("toroid25d-flt{}-{}-feat{}um-{:.1e}A--radii{}um-{}um-{}um.y4m",
driver.add_y4m_renderer(&*format!("toroid25d-flt{}-{}-feat{}um-{:.1e}A-{:.1e}s--radii{}um-{}um-{}um.y4m",
std::mem::size_of::<Flt>() * 8,
*size_px,
m_to_um(feat_size),
peak_current,
current_duration,
m_to_um(conductor_outer_rad),
m_to_um(ferro_inner_rad),
m_to_um(ferro_outer_rad),
@@ -90,12 +92,13 @@ fn main() {
}
let boundary_xy = half_width - ferro_outer_rad - buffer;
println!("boundary: {}um", m_to_um(boundary_xy));
let boundary = Index((from_m(boundary_xy), from_m(boundary_xy), 20).into());
let boundary = Index((from_m(boundary_xy), from_m(boundary_xy), 0).into());
driver.add_upml_boundary(boundary);
driver.add_stimulus(Stimulus::new(
conductor_region.clone(),
Sinusoid::new(Vec3::new(0.0, 0.0, peak_current * 1e-18), 1e9)));
Sinusoid::from_wavelength(Vec3::new(0.0, 0.0, peak_current), current_duration * 2.0
)));
loop {
driver.step();