NEML2

In addition to the MOOSE native material models, MOOSE can also seamlessly interface with the external material modeling library NEML2 MESSNER and HU (2023).

What is NEML2?

NEML2, the New Engineering Material modeling Library, version 2, is an offshoot of NEML2, an earlier material modeling code developed at Argonne National Laboratory. the library is provided as open source software under a MIT license.

NEML2 extends the key philosophy of its predecessor, i.e., material models are flexible, modular, and can be built from smaller blocks. It also provides modern features that do not exist in the framework of its predecessor such as material model vectorization, automatic differentiation, device-portable just-in-time compilation, operator fusion, lazy tensor evaluation, etc. Moreover, NEML2 can seamlessly integrate with the popular machine learning package PyTorch to take advantage of modern and fast-growing machine learning techniques.

How to install NEML2?

To enable NEML2 in MOOSE, set the environment variable NEML2_DIR to the path to the NEML2 directory. Alternatively, a compatible version of NEML2 also comes with MOOSE as an optional submodule. To obtain the submodule, run


git submodule update --checkout --init --recursive modules/solid_mechanics/contrib/neml2

Once the environment variable NEML2_DIR is set to a valid path or the submodule is initialized, you need to configure MOOSE to use libTorch (because NEML2 depends on libTorch). To do so, run


cd ~/projects/moose
./scripts/setup_libtorch.sh
./configure --with-libtorch

For additional details consult our libTorch installation guide. Note that if you want to use a custom version of libTorch, you can point the configure script to a specific libTorch installation, i.e.


cd ~/projects/moose
./configure --with-libtorch=/path/to/libTorch

After that, you can follow the getting started instructions to build MOOSE as usual.

How to use NEML2 in a MOOSE simulation

A dedicated input file syntax block is reserved for MOOSE-NEML2 interaction. The entry point to the syntax block is [NEML2]. Please refer to the NEML2 syntax documentation for more details.

Citing NEML2


@misc{osti_1961125,
title = {NEML2 - THE NEW ENGINEERING MATERIAL MODEL LIBRARY, VERSION 2},
author = {MESSNER, MARK and HU, TIANCHEN and US DOE NE-NEAMS},
url = {https://www.osti.gov//servlets/purl/1961125},
doi = {10.11578/dc.20230314.1},
url = {https://www.osti.gov/biblio/1961125}, year = {2023},
month = {1},
}

References

  1. MARK MESSNER and TIANCHEN HU. Neml2-the new engineering material model library, version 2. Technical Report, Argonne National Lab.(ANL), Argonne, IL (United States), 2023.[BibTeX]