sim: remove unused AbstractSim::to_static
method
This commit is contained in:
@@ -718,9 +718,6 @@ pub mod test {
|
|||||||
fn step_multiple<S: Stimulus<f32>>(&mut self, _num_steps: u32, _s: &S) {
|
fn step_multiple<S: Stimulus<f32>>(&mut self, _num_steps: u32, _s: &S) {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
fn to_static(&self) -> StaticSim {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
fn to_generic(&self) -> GenericSim<Self::Real> {
|
fn to_generic(&self) -> GenericSim<Self::Real> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
@@ -206,8 +206,9 @@ pub trait AbstractSim: Sync {
|
|||||||
fn put_material_index(&mut self, at: Index, m: Self::Material);
|
fn put_material_index(&mut self, at: Index, m: Self::Material);
|
||||||
fn step_multiple<S: Stimulus<Self::Real>>(&mut self, num_steps: u32, s: &S);
|
fn step_multiple<S: Stimulus<Self::Real>>(&mut self, num_steps: u32, s: &S);
|
||||||
|
|
||||||
/// Take a "snapshot" of the simulation, dropping all material-specific information.
|
/// convert to something which is maximally generalizable.
|
||||||
fn to_static(&self) -> StaticSim;
|
/// the result might then be saved to disc for later readback, where having that consistent
|
||||||
|
/// serialization format is more important than perf.
|
||||||
fn to_generic(&self) -> GenericSim<Self::Real>;
|
fn to_generic(&self) -> GenericSim<Self::Real>;
|
||||||
fn use_diagnostics(&mut self, _diag: SyncDiagnostics) {
|
fn use_diagnostics(&mut self, _diag: SyncDiagnostics) {
|
||||||
// optional
|
// optional
|
||||||
|
@@ -6,7 +6,7 @@ use log::{info, trace, warn};
|
|||||||
use crate::diagnostics::SyncDiagnostics;
|
use crate::diagnostics::SyncDiagnostics;
|
||||||
use crate::geom::Index;
|
use crate::geom::Index;
|
||||||
use crate::real::Real;
|
use crate::real::Real;
|
||||||
use crate::sim::{AbstractSim, Fields, GenericSim, StaticSim};
|
use crate::sim::{AbstractSim, Fields, GenericSim};
|
||||||
use crate::stim::{RenderedStimulus, Stimulus};
|
use crate::stim::{RenderedStimulus, Stimulus};
|
||||||
use coremem_cross::mat::{FullyGenericMaterial, Material};
|
use coremem_cross::mat::{FullyGenericMaterial, Material};
|
||||||
use coremem_cross::step::SimMeta;
|
use coremem_cross::step::SimMeta;
|
||||||
@@ -128,21 +128,6 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn to_static(&self) -> StaticSim {
|
|
||||||
let mut mat = Vec::new();
|
|
||||||
mat.resize(self.e.len(), Default::default());
|
|
||||||
StaticSim {
|
|
||||||
meta: self.meta.cast(),
|
|
||||||
e: self.e.iter().map(|v| v.cast()).collect(),
|
|
||||||
h: self.h.iter().map(|v| v.cast()).collect(),
|
|
||||||
m: self.m.iter().map(|v| v.cast()).collect(),
|
|
||||||
mat,
|
|
||||||
step_no: self.step_no,
|
|
||||||
backend: Default::default(),
|
|
||||||
diag: self.diag.clone(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn to_generic(&self) -> GenericSim<Self::Real> {
|
fn to_generic(&self) -> GenericSim<Self::Real> {
|
||||||
let mat = self.mat.iter().map(|m| m.clone().into()).collect();
|
let mat = self.mat.iter().map(|m| m.clone().into()).collect();
|
||||||
GenericSim {
|
GenericSim {
|
||||||
|
Reference in New Issue
Block a user