# IMPETUS User Material Models Framework

## Documentation

Framework documentation is in the `docs` folder. The example user material GUI
sidecar documentation is in `doc/IMPETUS example user material.xml`.

## Source Code

Framework source code is located in the `user-material` folder.

## Build

This project is built with CMake on Windows and Linux. The example library is
named `IMPETUS example user material` and embeds
`user-material/manifest.json`.

```bash
cmake -S . -B build
cmake ──build build ──config Release
```

When using a single-configuration generator such as Ninja, select the build type
during configuration instead:

```bash
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake ──build build
```

The build embeds `user-material/manifest.json` into the shared library through
`tools/embed_umat_manifest.cmake`. It also copies the matching XML
documentation beside the compiled library, for example:

```text
build/deliverables/Release/IMPETUS example user material.dll
build/deliverables/Release/IMPETUS example user material.xml
```

For GUI editor manual lookup, use `IMPETUS example user material` as the
optional title line on each `*MAT_USER_X` card in this example library. For your
own UMATs, set the optional title to the base name shared by your DLL/shared
object and XML sidecar. The GUI uses that title to find the corresponding XML
manual page while the cursor is on a `*MAT_USER_X` command.

## Examples

Examples of IMPETUS simulation models using the provided material models can be
found in the `example-models` folder.

## Tree

```text
user-material-models/
├── CMakeLists.txt
├── LICENSE.txt
├── README.md
├── doc/
│   └── IMPETUS example user material.xml
├── docs/
│   └── index.html
├── example-models/
├── tests/
│   └── probe_umat_manifest.py
├── tools/
│   └── embed_umat_manifest.cmake
└── user-material/
    ├── gpu_error.cpp
    ├── gpu_error.h
    ├── interface.cpp
    ├── interface.h
    ├── manifest.json
    ├── mat_user.h
    ├── mat_user_defines.h
    ├── mat_user_functions.h
    ├── mat_user_structs_cpu.h
    ├── mat_user_structs_gpu.h
    ├── umat_manifest.h
    ├── kernel_mat_XXXX.cu
    ├── kernel_mat_XXXX.h
    ├── mat_XXXX.cpp
    └── mat_XXXX.h
```
