rename 'coremem_types' -> 'coremem_cross' to better reflect its purpose
This commit is contained in:
parent
9e35b29087
commit
45d2de29c6
|
@ -312,7 +312,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"bincode",
|
||||
"common_macros",
|
||||
"coremem_types",
|
||||
"coremem_cross",
|
||||
"criterion",
|
||||
"crossterm",
|
||||
"csv",
|
||||
|
@ -345,6 +345,13 @@ dependencies = [
|
|||
"y4m",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "coremem_cross"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "coremem_post"
|
||||
version = "0.1.0"
|
||||
|
@ -359,13 +366,6 @@ dependencies = [
|
|||
"structopt",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "coremem_types"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crc32fast"
|
||||
version = "1.3.2"
|
||||
|
@ -2096,7 +2096,7 @@ source = "git+https://github.com/EmbarkStudios/rust-gpu#0866cf591a7fdbbd15bdb346
|
|||
name = "spirv_backend"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"coremem_types",
|
||||
"coremem_cross",
|
||||
"spirv-std",
|
||||
]
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ members = [
|
|||
"crates/spirv_backend",
|
||||
"crates/spirv_backend_builder",
|
||||
"crates/spirv_backend_runner",
|
||||
"crates/types",
|
||||
"crates/cross",
|
||||
"crates/post",
|
||||
|
||||
"crates/applications/buffer_proto5",
|
||||
|
|
|
@ -12,7 +12,7 @@ use coremem::geom::{Coord as _, Cube, Index};
|
|||
use coremem::units::Seconds;
|
||||
use coremem::sim::spirv::{self, SpirvSim};
|
||||
use coremem::stim::{Stimulus, TimeVarying as _, UniformStimulus};
|
||||
use coremem::types::vec::Vec3;
|
||||
use coremem::cross::vec::Vec3;
|
||||
|
||||
type Mat = mat::FullyGenericMaterial<f32>;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu" }
|
|||
spirv-std-macros = { git = "https://github.com/EmbarkStudios/rust-gpu" }
|
||||
spirv_backend = { path = "../spirv_backend" }
|
||||
spirv_backend_runner = { path = "../spirv_backend_runner" }
|
||||
coremem_types = { path = "../types", features = ["fmt", "serde"] }
|
||||
coremem_cross = { path = "../cross", features = ["fmt", "serde"] }
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use coremem::{self, Driver, GenericSim};
|
||||
use coremem::sim::legacy::SimState;
|
||||
use coremem::sim::spirv::{SpirvSim, WgpuBackend};
|
||||
use coremem::types::mat::FullyGenericMaterial;
|
||||
use coremem::cross::mat::FullyGenericMaterial;
|
||||
use coremem::geom::Index;
|
||||
use std::time::{Instant, Duration};
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ use crate::render::{self, MultiRenderer, Renderer};
|
|||
use crate::sim::{GenericSim, MaterialSim, SampleableSim};
|
||||
use crate::sim::units::{Frame, Time};
|
||||
use crate::stim::AbstractStimulus;
|
||||
use crate::types::vec::Vec3;
|
||||
use crate::cross::vec::Vec3;
|
||||
|
||||
use log::{info, trace};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use coremem_types::real::Real;
|
||||
use coremem_types::vec::Vec2;
|
||||
use coremem_cross::real::Real;
|
||||
use coremem_cross::vec::Vec2;
|
||||
|
||||
use std::ops::Add;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::geom::Line2d;
|
||||
use coremem_types::real::Real;
|
||||
use coremem_types::vec::Vec2;
|
||||
use coremem_cross::real::Real;
|
||||
use coremem_cross::vec::Vec2;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct Polygon2d<R> {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::geom::Meters;
|
||||
use coremem_types::real::Real as _;
|
||||
use coremem_types::vec::{Vec2, Vec3};
|
||||
use coremem_cross::real::Real as _;
|
||||
use coremem_cross::vec::{Vec2, Vec3};
|
||||
|
||||
use serde::{Serialize, Deserialize};
|
||||
use std::fmt::{self, Display};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use coremem_types::real::ToFloat;
|
||||
use coremem_types::vec::{Vec3, Vec3u};
|
||||
use coremem_cross::real::ToFloat;
|
||||
use coremem_cross::vec::{Vec3, Vec3u};
|
||||
use serde::{Serialize, Deserialize};
|
||||
use std::fmt::{self, Display};
|
||||
use std::cmp::Ordering;
|
||||
|
|
|
@ -16,9 +16,9 @@ pub mod stim;
|
|||
|
||||
pub use driver::*;
|
||||
pub use sim::*;
|
||||
pub use coremem_types as types;
|
||||
pub use coremem_types::real;
|
||||
pub use coremem_types::mat;
|
||||
pub use coremem_cross as cross;
|
||||
pub use coremem_cross::real;
|
||||
pub use coremem_cross::mat;
|
||||
|
||||
// Some things to keep in mind:
|
||||
// B = mu_r*H + M
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::geom::{Meters, Region, Torus, WorldRegion};
|
||||
use crate::real::{Real as _, ToFloat as _};
|
||||
use crate::types::vec::Vec3;
|
||||
use crate::cross::vec::Vec3;
|
||||
use crate::sim::SampleableSim;
|
||||
use dyn_clone::{self, DynClone};
|
||||
use indexmap::IndexMap;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::geom::Meters;
|
||||
use crate::real::ToFloat as _;
|
||||
use crate::types::vec::{Vec2, Vec3};
|
||||
use crate::cross::vec::{Vec2, Vec3};
|
||||
use crate::sim::{SampleableSim, Sample, StaticSim};
|
||||
use crate::meas::{self, AbstractMeasurement};
|
||||
use crossterm::{cursor, QueueableCommand as _};
|
||||
|
|
|
@ -2,7 +2,7 @@ use super::Material;
|
|||
use crate::geom::{Line2d, Polygon2d};
|
||||
use crate::real::Real;
|
||||
use crate::sim::legacy::{CellState, StepParametersMut};
|
||||
use crate::types::vec::{Vec2, Vec3};
|
||||
use crate::cross::vec::{Vec2, Vec3};
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use log::trace;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use super::{AnisomorphicConductor, IsomorphicConductor, LinearMagnet, Ferroxcube3R1, MinimalSquare};
|
||||
use crate::real::Real;
|
||||
use crate::types::vec::Vec3;
|
||||
use crate::cross::vec::Vec3;
|
||||
|
||||
pub fn conductor<R: Real, R2: Real>(conductivity: R2) -> IsomorphicConductor<R> {
|
||||
IsomorphicConductor::new(conductivity.cast())
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use super::Material;
|
||||
use crate::real::Real;
|
||||
use crate::sim::legacy::CellState;
|
||||
use crate::types::vec::Vec3;
|
||||
use crate::cross::vec::Vec3;
|
||||
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::real::Real;
|
||||
use crate::sim::legacy::{CellState, PmlParameters, PmlState, StepParameters, StepParametersMut};
|
||||
use crate::types::vec::Vec3;
|
||||
use crate::cross::vec::Vec3;
|
||||
|
||||
use enum_dispatch::enum_dispatch;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
@ -10,7 +10,7 @@ mod bh_ferromagnet;
|
|||
mod linear;
|
||||
|
||||
pub use bh_ferromagnet::*;
|
||||
pub use coremem_types::mat::{
|
||||
pub use coremem_cross::mat::{
|
||||
AnisomorphicConductor,
|
||||
Ferroxcube3R1MH,
|
||||
FullyGenericMaterial,
|
||||
|
@ -316,14 +316,14 @@ impl<R: Real> Material<R> for GenericMaterialOneField<R> {
|
|||
}
|
||||
}
|
||||
|
||||
// coremem_types adapters
|
||||
// coremem_cross adapters
|
||||
// TODO: move this to a dedicated file
|
||||
|
||||
/// the coremem_types Materials are stateless;
|
||||
/// the coremem_cross Materials are stateless;
|
||||
/// rather than hold onto their own magnetic fields (for example), the simulation holds that.
|
||||
/// that's counter to the original cpu-only simulation, in which materials hold their own state.
|
||||
///
|
||||
/// this type adapts any stateless coremem_types::mat::Material type to be a coremem::mat::Material.
|
||||
/// this type adapts any stateless coremem_cross::mat::Material type to be a coremem::mat::Material.
|
||||
#[derive(Default, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AdaptStateless<R, M> {
|
||||
mat: M,
|
||||
|
@ -342,7 +342,7 @@ impl<R: Default, M> From<M> for AdaptStateless<R, M> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<R: Real, M: coremem_types::mat::Material<R>> Material<R> for AdaptStateless<R, M> {
|
||||
impl<R: Real, M: coremem_cross::mat::Material<R>> Material<R> for AdaptStateless<R, M> {
|
||||
fn m(&self) -> Vec3<R> {
|
||||
self.m
|
||||
}
|
||||
|
@ -359,20 +359,20 @@ impl<R: Real, M: coremem_types::mat::Material<R>> Material<R> for AdaptStateless
|
|||
// conductors: these are truly stateless
|
||||
impl<R: Real> Material<R> for AnisomorphicConductor<R> {
|
||||
fn step_parameters_mut<'a>(&'a mut self) -> StepParametersMut<'a, R> {
|
||||
let c = coremem_types::mat::Material::conductivity(self);
|
||||
let c = coremem_cross::mat::Material::conductivity(self);
|
||||
StepParametersMut::default().with_conductivity(c)
|
||||
}
|
||||
}
|
||||
impl<R: Real> Material<R> for IsomorphicConductor<R> {
|
||||
fn step_parameters_mut<'a>(&'a mut self) -> StepParametersMut<'a, R> {
|
||||
let c = coremem_types::mat::Material::conductivity(self);
|
||||
let c = coremem_cross::mat::Material::conductivity(self);
|
||||
StepParametersMut::default().with_conductivity(c)
|
||||
}
|
||||
}
|
||||
|
||||
pub type MBPgram<R> = AdaptStateless<R, coremem_types::mat::MBPgram<R>>;
|
||||
pub type MBPgram<R> = AdaptStateless<R, coremem_cross::mat::MBPgram<R>>;
|
||||
impl<R: Real> MBPgram<R> {
|
||||
pub fn new(b_start: R, b_end: R, m_max: R) -> Self {
|
||||
coremem_types::mat::MBPgram::new(b_start, b_end, m_max).into()
|
||||
coremem_cross::mat::MBPgram::new(b_start, b_end, m_max).into()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pub mod mat;
|
||||
|
||||
use crate::geom::{Coord, Index, Meters};
|
||||
use crate::types::real::{R32, Real};
|
||||
use crate::types::vec::{Vec3, Vec3u};
|
||||
use crate::cross::real::{R32, Real};
|
||||
use crate::cross::vec::{Vec3, Vec3u};
|
||||
use crate::sim::{CellStateWithM, GenericSim, MaterialSim, Sample, SampleableSim, StaticSim};
|
||||
use crate::stim::AbstractStimulus;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::geom::{Coord, Cube, Index, InvertedRegion, Meters, Region};
|
||||
use crate::types::mat::Vacuum;
|
||||
use crate::types::real::Real;
|
||||
use crate::types::vec::{Vec3, Vec3u};
|
||||
use crate::cross::mat::Vacuum;
|
||||
use crate::cross::real::Real;
|
||||
use crate::cross::vec::{Vec3, Vec3u};
|
||||
use crate::stim::{AbstractStimulus, NoopStimulus};
|
||||
use rayon::prelude::*;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use coremem_types::mat::Material;
|
||||
use coremem_types::real::Real;
|
||||
use coremem_types::step::{SimMeta, StepEContext, StepHContext};
|
||||
use coremem_types::vec::{Vec3, Vec3u};
|
||||
use coremem_cross::mat::Material;
|
||||
use coremem_cross::real::Real;
|
||||
use coremem_cross::step::{SimMeta, StepEContext, StepHContext};
|
||||
use coremem_cross::vec::{Vec3, Vec3u};
|
||||
|
||||
use super::SimBackend;
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ use std::num::NonZeroU64;
|
|||
use wgpu;
|
||||
use wgpu::util::DeviceExt as _;
|
||||
|
||||
use coremem_types::vec::{Vec3, Vec3u};
|
||||
use coremem_types::step::SimMeta;
|
||||
use coremem_cross::vec::{Vec3, Vec3u};
|
||||
use coremem_cross::step::SimMeta;
|
||||
|
||||
use spirv_backend::HasEntryPoints;
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ use crate::geom::{Coord, Index, Meters};
|
|||
use crate::real::Real;
|
||||
use crate::sim::{CellStateWithM, GenericSim, MaterialSim, Sample, SampleableSim, StaticSim};
|
||||
use crate::stim::AbstractStimulus;
|
||||
use crate::types::vec::Vec3;
|
||||
use coremem_types::mat::{FullyGenericMaterial, Material};
|
||||
use coremem_types::step::SimMeta;
|
||||
use crate::cross::vec::Vec3;
|
||||
use coremem_cross::mat::{FullyGenericMaterial, Material};
|
||||
use coremem_cross::step::SimMeta;
|
||||
|
||||
mod cpu;
|
||||
mod gpu;
|
||||
|
@ -514,7 +514,7 @@ mod test {
|
|||
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(
|
||||
dut_state.put_material(Index::new(x, y, z), coremem_cross::mat::MBPgram::new(
|
||||
b_start, b_end, m_max
|
||||
));
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::real::*;
|
||||
use crate::types::vec::Vec3;
|
||||
use crate::cross::vec::Vec3;
|
||||
use crate::geom::{Meters, Region};
|
||||
use rand;
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
[package]
|
||||
name = "coremem_types"
|
||||
version = "0.1.0"
|
||||
name = "coremem_cross"
|
||||
version = "0.2.0"
|
||||
authors = ["Colin <colin@uninsane.org>"]
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
# some functionality does not compile for the spirv target, so we feature gate these.
|
||||
serde = [ "dep:serde" ]
|
||||
fmt = []
|
||||
|
|
@ -8,4 +8,4 @@ crate-type = ["dylib", "lib"]
|
|||
|
||||
[dependencies]
|
||||
spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu", features = ["glam"] } # MIT or Apache 2.0
|
||||
coremem_types = { path = "../types" }
|
||||
coremem_cross = { path = "../cross" }
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use spirv_std::RuntimeArray;
|
||||
|
||||
use coremem_types::mat::Material;
|
||||
use coremem_types::real::Real;
|
||||
use coremem_types::step::{SimMeta, StepEContext, StepHContext};
|
||||
use coremem_types::vec::{Vec3, Vec3u};
|
||||
use coremem_cross::mat::Material;
|
||||
use coremem_cross::real::Real;
|
||||
use coremem_cross::step::{SimMeta, StepEContext, StepHContext};
|
||||
use coremem_cross::vec::{Vec3, Vec3u};
|
||||
|
||||
use crate::support::SizedArray;
|
||||
|
||||
|
|
|
@ -15,10 +15,10 @@ use spirv_std::macros::spirv;
|
|||
mod adapt;
|
||||
mod support;
|
||||
|
||||
use coremem_types::mat::{Ferroxcube3R1MH, FullyGenericMaterial, IsoConductorOr};
|
||||
use coremem_types::real::R32;
|
||||
use coremem_types::step::SimMeta;
|
||||
use coremem_types::vec::{Vec3, Vec3u};
|
||||
use coremem_cross::mat::{Ferroxcube3R1MH, FullyGenericMaterial, IsoConductorOr};
|
||||
use coremem_cross::real::R32;
|
||||
use coremem_cross::step::SimMeta;
|
||||
use coremem_cross::vec::{Vec3, Vec3u};
|
||||
|
||||
type Iso3R1<R> = IsoConductorOr<R, Ferroxcube3R1MH>;
|
||||
|
||||
|
|
Loading…
Reference in New Issue