Skip to main content

Crate vita_core

Crate vita_core 

Source
Expand description

Foundational vocabulary for the vita ecosystem: the questions a physical system can answer, not the structures that store the answers.

What we observe is not nature itself, but nature exposed to our method of questioning.

— Werner Heisenberg

A system is never a concrete type here. Each kind of question it can answer is a trait: HasElements what occupies a site, HasPositions where it sits, HasNetCharge the total charge. Code bounds on exactly the capabilities it needs and stays blind to the storage behind them.

§Sites

Per-site data is keyed on an opaque SiteId; HasSites enumerates those keys and is the supertrait of every per-site capability. A capability is a keyed getter paired with a (SiteId, _) iterator — storage order is never implied. System-wide quantities (HasLattice, HasNetCharge) are standalone, single-valued traits.

§Quantities

Physical values carry their dimension and unit in the type via units; geometry uses the three-dimensional primitives in tensor. Both are generic over the Scalar element type, f32 or f64.

Modules§

prelude
The vita-core prelude.
tensor
Fixed-size geometric primitives in three dimensions.
units
Dimensionally-typed physical quantities.

Structs§

Element
A chemical element, identified by its atomic number Z — the proton count.
Isotope
A nuclide: an Element together with its mass number A.
Lattice
A periodic lattice: the three basis vectors a, b, c that generate a system’s translational symmetry.
SiteId
An opaque, dense identifier for a simulation site (e.g., an atom).

Traits§

HasAccelerations
Per-site acceleration: the Vector3 acceleration of each site.
HasElements
Per-site chemical identity: the Element occupying each site.
HasIsotopes
Per-site nuclear identity: the Isotope occupying each site.
HasLattice
The periodic Lattice of a system.
HasMasses
Per-site mass: the Mass of the particle at each site.
HasNetCharge
The net electric charge of a system.
HasPositions
Per-site position: the Point3 locating each site in space.
HasSites
The identity skeleton: the SiteIds every per-site datum is keyed on.
HasVelocities
Per-site velocity: the Vector3 velocity of each site.
Scalar
Numeric scalar type for values in physical-quantity and tensor types.