move coremem/mat -> coremem/sim/legacy/mat
This commit is contained in:
parent
d0fcd9b657
commit
7286d272b9
|
@ -1,6 +1,7 @@
|
|||
use coremem::*;
|
||||
use coremem::geom::*;
|
||||
use coremem::real::{Real as _, ToFloat as _};
|
||||
use coremem::sim::legacy::mat::Static;
|
||||
use coremem::stim::AbstractStimulus;
|
||||
use coremem::types::vec::Vec3;
|
||||
use rand::rngs::StdRng;
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
use crate::geom::{Coord, Index, Meters, Region};
|
||||
use crate::mat::{self, Pml};
|
||||
use crate::mat;
|
||||
use crate::meas::{self, AbstractMeasurement};
|
||||
use crate::real::{self, Real};
|
||||
use crate::render::{self, MultiRenderer, Renderer};
|
||||
use crate::sim::{GenericSim, MaterialSim, SampleableSim};
|
||||
use crate::sim::legacy::SimState;
|
||||
use crate::sim::legacy::{self, SimState};
|
||||
use crate::sim::legacy::mat::Pml;
|
||||
use crate::sim::units::{Frame, Time};
|
||||
use crate::sim::spirv::SpirvSim;
|
||||
use crate::stim::AbstractStimulus;
|
||||
|
@ -37,7 +38,7 @@ pub struct Driver<S=SimState> {
|
|||
sim_end_time: Option<Frame>,
|
||||
}
|
||||
|
||||
pub type CpuDriver<R=real::R32, M=mat::GenericMaterial<R>> = Driver<SimState<R, M>>;
|
||||
pub type CpuDriver<R=real::R32, M=legacy::mat::GenericMaterial<R>> = Driver<SimState<R, M>>;
|
||||
pub type SpirvDriver<M=mat::FullyGenericMaterial<f32>> = Driver<SpirvSim<M>>;
|
||||
|
||||
impl<R: Real, M: Default> Driver<SimState<R, M>> {
|
||||
|
|
|
@ -9,7 +9,6 @@ use log::info;
|
|||
|
||||
pub mod driver;
|
||||
pub mod geom;
|
||||
pub mod mat;
|
||||
pub mod meas;
|
||||
pub mod render;
|
||||
pub mod sim;
|
||||
|
@ -17,10 +16,10 @@ pub mod stim;
|
|||
pub mod util;
|
||||
|
||||
pub use driver::*;
|
||||
pub use mat::*;
|
||||
pub use sim::*;
|
||||
pub use coremem_types as types;
|
||||
pub use coremem_types::real;
|
||||
pub use coremem_types::mat;
|
||||
|
||||
// Some things to keep in mind:
|
||||
// B = mu_r*H + M
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use super::Material;
|
||||
use crate::geom::{Line2d, Polygon2d};
|
||||
use crate::mat::Material;
|
||||
use crate::real::Real;
|
||||
use crate::sim::legacy::{CellState, StepParametersMut};
|
||||
use crate::types::vec::{Vec2, Vec3};
|
|
@ -1,6 +1,6 @@
|
|||
//! database of common materials
|
||||
|
||||
use crate::mat::{AnisomorphicConductor, IsomorphicConductor, LinearMagnet, Ferroxcube3R1, MinimalSquare};
|
||||
use super::{AnisomorphicConductor, IsomorphicConductor, LinearMagnet, Ferroxcube3R1, MinimalSquare};
|
||||
use crate::real::Real;
|
||||
use crate::types::vec::Vec3;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::mat::Material;
|
||||
use super::Material;
|
||||
use crate::real::Real;
|
||||
use crate::sim::legacy::CellState;
|
||||
use crate::types::vec::Vec3;
|
|
@ -1,9 +1,13 @@
|
|||
pub mod mat;
|
||||
|
||||
use crate::geom::{Coord, Index, Meters};
|
||||
use crate::mat::{self, GenericMaterial, Material, MaterialExt as _};
|
||||
use crate::types::real::{R32, Real};
|
||||
use crate::types::vec::{Vec3, Vec3u};
|
||||
use crate::sim::{CellStateWithM, GenericSim, MaterialSim, Sample, SampleableSim};
|
||||
use crate::stim::AbstractStimulus;
|
||||
|
||||
use mat::{GenericMaterial, Material, MaterialExt as _};
|
||||
|
||||
use log::trace;
|
||||
use ndarray::{Array3, Zip};
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
@ -878,7 +882,7 @@ impl<R: Real> CellState<R> {
|
|||
mod test {
|
||||
use super::*;
|
||||
use crate::geom::{Cube, Region, WorldRegion};
|
||||
use crate::mat::{AnisomorphicConductor, IsomorphicConductor, Pml, Static};
|
||||
use crate::sim::legacy::mat::{AnisomorphicConductor, IsomorphicConductor, Pml, Static};
|
||||
use crate::real::{R64, ToFloat as _};
|
||||
use float_eq::assert_float_eq;
|
||||
use more_asserts::*;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use crate::geom::{Coord, Cube, Index, InvertedRegion, Meters, Region};
|
||||
use crate::mat;
|
||||
use crate::types::real::Real;
|
||||
use crate::types::vec::{Vec3, Vec3u};
|
||||
use crate::stim::{AbstractStimulus, NoopStimulus};
|
||||
|
@ -385,7 +384,7 @@ pub trait SampleableSim: Send + Sync {
|
|||
let cell = self.sample(idx.to_meters(self.feature_size()));
|
||||
*e = cell.e().cast();
|
||||
*h = cell.h().cast();
|
||||
mat::Static {
|
||||
legacy::mat::Static {
|
||||
conductivity: cell.conductivity().cast(),
|
||||
m: cell.m().cast(),
|
||||
}
|
||||
|
|
|
@ -652,7 +652,7 @@ mod test {
|
|||
use super::*;
|
||||
use crate::real::ToFloat as _;
|
||||
use crate::sim::SampleableSim;
|
||||
use crate::sim::legacy::SimState;
|
||||
use crate::sim::legacy::{self, SimState};
|
||||
use crate::mat::{self, AnisomorphicConductor};
|
||||
fn mean_magnitude_e(sim: &dyn SampleableSim) -> f32 {
|
||||
(sim.map_sum_enumerated(|_pos: Index, cell| {
|
||||
|
@ -909,7 +909,7 @@ mod test {
|
|||
let slope = rng.gen_range(0.0..0.9*f32::mu0_inv());
|
||||
let b_end = b_start + b_range;
|
||||
let m_max = b_range * slope;
|
||||
ref_state.put_material(Index::new(x, y, z), mat::MBPgram::new(
|
||||
ref_state.put_material(Index::new(x, y, z), legacy::mat::MBPgram::new(
|
||||
b_start.cast(), b_end.cast(), m_max.cast()
|
||||
));
|
||||
dut_state.put_material(Index::new(x, y, z), coremem_types::mat::MBPgram::new(
|
||||
|
@ -1177,7 +1177,7 @@ mod test {
|
|||
let slope = rng.gen_range(0.0..0.9*f32::mu0_inv());
|
||||
let b_end = b_start + b_range;
|
||||
let m_max = b_range * slope;
|
||||
ref_state.put_material(Index::new(x, y, z), mat::MBPgram::new(
|
||||
ref_state.put_material(Index::new(x, y, z), legacy::mat::MBPgram::new(
|
||||
b_start.cast(), b_end.cast(), m_max.cast()
|
||||
));
|
||||
dut_state.put_material(Index::new(x, y, z), coremem_types::mat::MBPgram::new(
|
||||
|
|
Loading…
Reference in New Issue