MAT examples
The examples/mat directory contains a standalone material calculator and
an installed-package consumer.
Standalone calculator
The Standalone source constructs natural water, calculates its formula composition, builds a mass-fraction brine from a braced substance map, and reports component and aggregate matter values.
mat::MatterSpec matter;
matter.mass_density = puq::Quantity(1.02, "g/cm3");
matter.volume = puq::Quantity(1.0, "L");
const mat::Material brine(
{{"H2O", 0.965}, {"NaCl", 0.035}},
mat::Norm::MASS_FRACTION,
true,
matter
);
Installed consumer
The InstalledConsumer source
is a separate CMake project. It uses find_package(snt CONFIG REQUIRED),
links only snt-mat, and calculates a formula mass and a density-derived
material mass. It is intentionally excluded from the in-tree example build.
See examples/mat/README.md for the configure, install, and consumer build
commands.