rename RenderedVectorField -> RenderedStimulus

This commit is contained in:
2022-08-20 17:08:26 -07:00
parent cd2917c8a5
commit 4f229a51b1
3 changed files with 9 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ use crate::stim::{
Stimulus,
StimuliVec,
TimeVarying,
RenderedVectorField,
RenderedStimulus,
VectorField,
};
use coremem_cross::compound::list;
@@ -429,7 +429,7 @@ impl<T: TimeVarying> DriverStimulus for DriverStimulusModulated<T> {
/// a Stimulus where the field has been pre-calculated
pub type ModulatedStaticField<T> = ModulatedVectorField<DimSlice<Vec<Fields>>, T>;
pub type StaticFields = RenderedVectorField;
pub type StaticFields = RenderedStimulus;
fn stim_to_vector_field<S: Stimulus>(meta: SimMeta<f32>, t_sec: f32, stim: &S) -> StaticFields {
let dim = meta.dim();
let dim_len = dim.product_sum_usize();
@@ -463,7 +463,7 @@ fn stim_to_vector_field<S: Stimulus>(meta: SimMeta<f32>, t_sec: f32, stim: &S) -
let field_e = DimSlice::new(dim, e);
let field_h = DimSlice::new(dim, h);
RenderedVectorField::new(
RenderedStimulus::new(
field_e, field_h, time_step, feature_size, t_sec
)
}

View File

@@ -5,7 +5,7 @@ use crate::diagnostics::SyncDiagnostics;
use crate::geom::Index;
use crate::real::Real;
use crate::sim::{AbstractSim, Fields, GenericSim, StaticSim};
use crate::stim::{Stimulus, RenderedVectorField};
use crate::stim::{Stimulus, RenderedStimulus};
use coremem_cross::mat::{FullyGenericMaterial, Material};
use coremem_cross::step::SimMeta;
use coremem_cross::vec::Vec3;
@@ -235,7 +235,7 @@ where
let timestep = self.meta.time_step;
// TODO: use `Stimulus::render()` instead
let stim: &RenderedVectorField = unsafe { std::mem::transmute(stim) };
let stim: &RenderedStimulus = unsafe { std::mem::transmute(stim) };
assert_eq!(stim.scale(), timestep.cast());
assert_eq!(stim.feature_size(), feature_size);

View File

@@ -153,7 +153,7 @@ where
}
}
pub struct RenderedVectorField {
pub struct RenderedStimulus {
e: DimSlice<Vec<Vec3<f32>>>,
h: DimSlice<Vec<Vec3<f32>>>,
scale: f32,
@@ -161,7 +161,7 @@ pub struct RenderedVectorField {
t_sec: f32,
}
impl RenderedVectorField {
impl RenderedStimulus {
pub fn new(
e: DimSlice<Vec<Vec3<f32>>>,
h: DimSlice<Vec<Vec3<f32>>>,
@@ -188,12 +188,12 @@ impl RenderedVectorField {
}
}
impl VectorField for RenderedVectorField {
impl VectorField for RenderedStimulus {
fn at(&self, _feat_size: f32, loc: Index) -> Fields {
Fields::new_eh(self.e[loc.into()], self.h[loc.into()])
}
}
impl Stimulus for RenderedVectorField {
impl Stimulus for RenderedStimulus {
fn at(&self, _t_sec: f32, _feat_size: f32, loc: Index) -> Fields {
Fields::new_eh(self.e[loc.into()], self.h[loc.into()])
}