Expand description
§materia
Chemical composition to physical material properties, from first principles.
Define materials by their atomic structure — molecules, crystals, polymers, or amorphous compositions — and get all physical properties derived automatically using established physics models.
§Quick start
use materia::prelude::*;
// Define iron as a BCC crystal
let iron = compile(&Substance::Crystalline(Crystal::iron()));
assert_eq!(iron.phase.state, PhaseState::Solid);
// Or use a preset
let water = materia::presets::water();
assert_eq!(water.phase.state, PhaseState::Liquid);§Architecture
Element → Substance → compile() → MaterialDef
(atoms) (structure) (physics) (properties)The [compile] function derives every property from the chemical
structure: density from crystallography, melting point from cohesive
energy, conductivity from Wiedemann-Franz, color from electron
structure. No hardcoded material databases.
§Modules
element— Periodic table: all 118 elements with atomic datasubstance—Substanceenum: molecular, crystalline, polymer, amorphousmolecular—Molecule,Bond, bond energiescrystal—Crystal,LatticeType(BCC, FCC, HCP, Diamond)polymer—PolymerChainwith cross-linking- [
compile] —compile()andcompile_as(): substance → material properties material—MaterialDefoutput type with all property groupsreaction— ChemicalReactionwith energy balanceinteraction— [InteractionRule] for runtime reaction dispatchpresets— 20 ready-to-use world materials
Re-exports§
pub use element::Element;pub use substance::Substance;pub use molecular::Molecule;pub use molecular::Bond;pub use molecular::BondKind;pub use crystal::Crystal;pub use crystal::LatticeType;pub use polymer::PolymerChain;pub use compile::compile;pub use compile::compile_as;pub use reaction::Reaction;pub use material::MaterialDef;pub use material::PhaseState;pub use material::MaterialId;
Modules§
- compile
- Substance -> MaterialDef compilation.
- crystal
- Crystalline structures: lattice type, base element, and solute impurities.
- element
- Periodic table with atomic properties relevant to material science. All 118 elements from Hydrogen (H) to Oganesson (Og).
- interaction
- Material interaction rule system.
- material
- Material property definitions — the full physical description of every material type.
- molecular
- Molecular structures: atoms connected by bonds.
- polymer
- Polymer chain structures.
- prelude
- Convenience prelude — import everything commonly needed.
- presets
- Preset world materials — chemical definitions only.
- reaction
- Chemical reactions: energy balance from bond breaking/formation.
- substance
- Top-level substance abstraction: molecular, crystalline, polymer, or amorphous.