Files
fdtd-coremem/examples/boundary_conditions.rs

26 lines
726 B
Rust

use coremem::{Driver, mat};
fn main() {
coremem::init_logging();
let width = 201;
let boundary = 50;
let mut driver = Driver::new(width, width, 1e-3 /* feature size */);
driver.add_y4m_renderer(&*format!("boundary_conditions_upml_round-{}.y4m", boundary));
// driver.add_term_renderer();
//driver.add_boundary(boundary, 0.1);
driver.add_upml_boundary(boundary);
loop {
let imp = if driver.state.step_no() < 50 {
30000.0 * ((driver.state.step_no() as f64)*0.04*std::f64::consts::PI).sin()
} else {
0.0
};
for y in 0..width {
driver.state.impulse_bz(100, y, (imp / 3.0e8) as _);
}
driver.step();
}
}