MAT commands
The MAT facade exposes the standalone MAT library through command objects. A
command is constructed with its expression, configured with argument_*
methods, and evaluated with execute(). It is the boundary used by the native
CLI and by other applications that need element, formula, or mixture results
without depending on CLI text parsing:
#include <snt/api/mat_eval.h>
snt::api::MATMaterial command("0.965 <H2O> 0.035 <NaCl>");
command.argument_normalization("mass_fraction");
command.argument_mass_density(snt::puq::Quantity(1.02, "g/cm3"));
command.argument_volume(snt::puq::Quantity(1.0, "L"));
const auto result = command.execute();
const double total_mass_g = snt::mat::quantity_value(*result.matter.mass, "g");
MATElement, MATSubstance, and MATMaterial return
MatElementResult, MatSubstanceResult, and MatMaterialResult from
execute(). Each result contains the corresponding typed MAT data records
and optional matter values. argument_natural() selects the isotope mode,
argument_matter() replaces all optional inputs, and the individual
argument_number_density(), argument_mass_density(),
argument_volume(), and argument_mass() methods update one input. The
facade does not add formatting, DIPL state, or a second physics implementation.
The snt mat command parses options and formats these results. In a build
with ENABLE_MAT=ON, snt-api links snt-mat and the CLI links only
snt-api. When MAT is disabled, its facade source and CLI command are
excluded and the command reports the required configuration option.
See MAT model and formula syntax and physical assumptions and limits for the model and conventions, the CLI guide for command usage, and the generated MAT facade declarations for the complete interface.