stim: convert CurlStimulus to a CurlVectorField and use ModulatedVectorField

this opens the door to caching the vector field stuff.
This commit is contained in:
2022-08-18 20:47:02 -07:00
parent 478db86b75
commit ffda00b796
4 changed files with 106 additions and 111 deletions

View File

@@ -7,7 +7,7 @@ use coremem::{Driver, mat, meas};
use coremem::geom::{Coord as _, Meters, Torus};
use coremem::sim::spirv::{SpirvSim, WgpuBackend};
use coremem::sim::units::Seconds;
use coremem::stim::{CurlStimulus, Sinusoid, StimExt as _};
use coremem::stim::{CurlVectorField, ModulatedVectorField, Sinusoid, StimExt as _};
fn main() {
@@ -81,9 +81,9 @@ fn main() {
let wave = Sinusoid::from_wavelength(amp, duration * 2.0)
.half_cycle()
.shifted(start);
driver.add_stimulus(CurlStimulus::new(
region.clone(),
wave.clone(),
driver.add_stimulus(ModulatedVectorField::new(
CurlVectorField::new(region.clone()),
wave,
));
};