.. _mat-usage: Getting started =============== This page shows the smallest native MAT workflow. Use :doc:`Concepts and model ` for the composition and formula rules, and :doc:`Workflows ` for mixtures, matter calculations, and the application facade. Standalone use -------------- .. code-block:: cpp #include #include int main() { snt::mat::Substance water("H2O"); const auto formula = water.data_composite(); std::cout << formula.sum.mass.to_string() << "\n"; return 0; } The ``examples/mat/Standalone`` program demonstrates these calls. The ``examples/mat/InstalledConsumer`` project validates that an installed package links ``snt-mat`` and propagates its public PUQ dependency. Build and run ------------- Install the C++ package using :doc:`../../installation` with the MAT module enabled (``ENABLE_MAT=ON``). Save the example above as ``main.cpp`` and create this ``CMakeLists.txt`` in the same directory: .. code-block:: cmake cmake_minimum_required(VERSION 3.22) project(snt_mat_example LANGUAGES C CXX) find_package(snt CONFIG REQUIRED) add_executable(application main.cpp) target_compile_features(application PRIVATE cxx_std_17) target_link_libraries(application PRIVATE snt-mat) Configure with the installed package prefix, build, and run: .. code-block:: console cmake -S . -B build -DCMAKE_PREFIX_PATH=/path/to/snt cmake --build build ./build/application Expected output: .. code-block:: text 18.0153*u Replace ``/path/to/snt`` with the installation prefix; omit that option if CMake already finds SNT. C is enabled for discovery of HDF5 in packages built with DIP support. See :ref:`cmake-consumer` for package discovery details. Continue with :doc:`Workflows ` to build mixtures, derive matter values, and use the command-oriented facade.