use crate::real::Real; use crate::vec::Vec3; mod compound; mod conductor; mod mb_pgram; mod mh_pgram; pub use compound::{GenericMaterial, IsoConductorOr}; pub use conductor::{AnisomorphicConductor, IsomorphicConductor}; pub use mb_pgram::MBPgram; pub use mh_pgram::{Ferroxcube3R1MH, MHPgram}; #[cfg(feature = "serde")] use serde::{Serialize, Deserialize}; pub trait Material: Sized { fn conductivity(&self) -> Vec3 { Default::default() } /// returns the new M vector for this material fn move_b_vec(&self, m: Vec3, _target_b: Vec3) -> Vec3 { // XXX could return either 0, or `m`. they should be the same, but one might be more // optimizable than the other (untested). m } } /// Default, non-interesting Material. /// has 0 conductivity (electrical and magnetic) #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] #[cfg_attr(feature = "fmt", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq)] pub struct Vacuum; impl Material for Vacuum {}