Skip to main content

GPU-enabled vectorized material modeling library

Project description

Overview

Documentation tests

The New Engineering Material model Library, version 2

NEML2 is an offshoot of NEML, an earlier constitutive modeling code developed at Argonne National Laboratory. Like NEML, NEML2 provides a flexible, modular way to build constitutive models from smaller blocks. Unlike NEML, NEML2 vectorizes the constitutive update to efficiently run on GPUs. NEML2 is built on top of PyTorch to provide GPU support, but this also means that NEML2 models have all the features of a PyTorch module. So, for example, users can take derivatives of the model with respect to parameters using automatic differentiation.

NEML2 is provided as open source software under a MIT license.

Build and installation

Building should be as easy as cloning the repository, configuring with CMake, building with make, and testing with make test.

By default NEML2 will download the current CPU-only version of torch. To instead use a system torch set CMake options -DLIBTORCH_DIR=/path/to/your/torch. If you use the default build you will get a CPU-only version of torch and performance might suffer compared to a CUDA version.

NEML2 features and design philosophy

  • Modular constitutive models: NEML2 material models are modular – they are built up from smaller pieces into a complete model. For example, a model might piece together a temperature-dependent elasticity model, a yield surface, a flow rule, and several hardening rules. Each of these submodels is independent of the other objects so that, for example, switching from conventional J2 plasticity to a non J2 theory requires only a one line change in an input file, if the model is already implemented, or a relatively small amount of coding to add the new yield surface if it has not been implemented. All of these objects are interchangeable. For example, the damage, viscoplastic, and rate-independent plasticity models all use the same yield (flow) surfaces, hardening rules, elasticity models, and so on.
  • Extensible constitutive models: The library is structured so that adding a new feature to an existing material model should be as simple as possible and require as little code as possible. As part of this philosophy, the library only requires new components provide a few partial derivatives and NEML uses this information to assemble the Jacobian needed to do a fully implement, backward Euler integration of the ordinary differential equations comprising the model form and to provide the algorithmic tangent needed to integrate the model into an implicit finite element framework. Moreover, in NEML2 implementations can forgo providing these partial derivatives and NEML2 will calculate them with automatic differentiation -- albeit at a significant performance cost.
  • Friendly user interfaces: There are two general ways to create and interface with NEML2 material models: the python bindings and the compiled library with HIT input. The python bindings are generally used for creating, fitting, and debugging new material models. In python, a material model is built up object-by-object and assembled into a complete mathematical constitutive relation. NEML2 provides several python drivers for exercising these material models in simple loading configurations. These drivers include common test types, like uniaxial tension tests and strain-controlled cyclic fatigue tests along with more esoteric drivers supporting simplified models of high temperature pressure vessels, like n-bar models and generalized plane-strain axisymmetry. NEML2 provides a full Abaqus UMAT interface and examples of how to link the compiled library into C, C++, or Fortran codes. These interfaces can be used to call NEML2 models from finite element codes. When using the compiled library, NEML2 models can be created and archived using a hierarchical HIT format.
  • Strict quality assurance: NEML2 is developed under a strict quality assurance program. Because the NEML2 distribution does not provide full, parameterized models for any actual materials, ensuring the quality of the library is a verification problem – testing to make sure that NEML2 is correctly implementing the mathematical models – rather than a validation problem of comparing the results of a model to an actual test. This verification is done with extensive unit testing. This unit testing verifies every mathematical function and every derivative in the library is correctly implemented.
  • CPU/GPU Vectorization: NEML2 models can be vectorized, meaning that a large batch of constitutive models can be evaluated simultaneously. The vectorized model can be evaluated both on CPU and on GPU, with a unified, intuitive user interface.
  • Flexible model composition: NEML2 offers a more flexible way of composing models. Each individual model only defines the forward operator (and optionally its derivative) with a given set of inputs and outputs, without knowing anything a priori about how it is going to be used. When a set of models are composed together to form a composite model, dependencies among different models are automatically detected, registered, and resolved. The user has complete control over how NEML2 evaluates a set of models.
  • Faster evaluation of chained models: As a result the dependency resolution mentioned above, an optimal order of evaluating the composed model is used to perform the forward operation -- every model in the dependency graph is evaluated once and only once, avoiding any redundant calculations.
  • General implicit update: NEML2 offers a general interface for defining implicit models, unlike NEML which requires the implicit function to be in the form of an ODE.

Disclaimer

NEML2 does not provide a database of models for any particular class of materials. There are many example materials contained in the library release. These models are included entirely for illustrative purposes and do not represent the response of any actual material. Right now these models are solid mechanics constitutive models, providing the stress/strain response of materials. However, NEML2 is general enough to build models of any type.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neml2-1.3.1.tar.gz (3.0 MB view details)

Uploaded Source

Built Distributions

neml2-1.3.1-cp311-cp311-manylinux_2_17_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

neml2-1.3.1-cp311-cp311-macosx_10_15_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

neml2-1.3.1-cp310-cp310-manylinux_2_17_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

neml2-1.3.1-cp310-cp310-macosx_10_15_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

neml2-1.3.1-cp39-cp39-manylinux_2_17_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

neml2-1.3.1-cp39-cp39-macosx_10_15_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

neml2-1.3.1-cp38-cp38-manylinux_2_17_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

neml2-1.3.1-cp38-cp38-macosx_10_15_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

Details for the file neml2-1.3.1.tar.gz.

File metadata

  • Download URL: neml2-1.3.1.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for neml2-1.3.1.tar.gz
Algorithm Hash digest
SHA256 93dc04e7573311e8fb62526b6707e275b7b836fb948873672f3bc16f19780fac
MD5 48d5cc0ac7c4755170578bff64746bb3
BLAKE2b-256 30cbc381d96457f7ffed2d567eb41addc1ecbbae982def1ae1a2f9d719ddaa08

See more details on using hashes here.

File details

Details for the file neml2-1.3.1-cp311-cp311-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for neml2-1.3.1-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5b8dfaffebb7a3eceb66e4156ea9f670d268bd8af0d18429f9a999c4e969ee91
MD5 6b99250267c278b49ca988398cf02973
BLAKE2b-256 173e091baa81d559c091f47faf399d83035c6a0623481004123d279da8c6633b

See more details on using hashes here.

File details

Details for the file neml2-1.3.1-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for neml2-1.3.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 b9e2f23b21632fb962e4f76d7e00f6ae1a38efd0bb9769865d5f3a9ed90e9117
MD5 df7ae66d155be3fc1c62edef69ff07fd
BLAKE2b-256 82f25811e1e8db9a452dafa7708ce704f156c5fd56d9fb1202e45e4dd2a43cd0

See more details on using hashes here.

File details

Details for the file neml2-1.3.1-cp310-cp310-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for neml2-1.3.1-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 bc618a908263b25c6d0fea2c97698a07279aa2cca5d93fdade145bc70c9be2ff
MD5 ed08c2285cd2d45952946720b67ec2fb
BLAKE2b-256 c0b0f4312b4e8fe8d85ba1e5e1c15adc30c4c60365751a30a1af1e0b85aebfdf

See more details on using hashes here.

File details

Details for the file neml2-1.3.1-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for neml2-1.3.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 04e6cddbfaccd4fb6a5cf5bda7a26a5f7b5255a13e65ddd10e65dd834051d01b
MD5 e248e808c8e5ce1f1e89ed7cab32a99c
BLAKE2b-256 4b93682448ccb79803be264f2e21b253865517f198f04ff2263853b34eec091d

See more details on using hashes here.

File details

Details for the file neml2-1.3.1-cp39-cp39-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for neml2-1.3.1-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 74440d6d09632c95e5bd823717b72f0771ce69ec2aa145aafc5a71f87b10649f
MD5 d5a0aedefde93349fbdd9d1af3d13fa1
BLAKE2b-256 ef15dd34e91432299603ac43b904fdb6655aed37932951edc9038f6a6ce444f5

See more details on using hashes here.

File details

Details for the file neml2-1.3.1-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for neml2-1.3.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0d03b45f9be9162b30c205f40a802ea2f4f0976a12f99aedcb766307152e21c2
MD5 fd9574627d4153579a014c7535708f6d
BLAKE2b-256 9c4f942eef5a3934c3ff546d4b1d28f4fd0ea7e647053aa11cd922e195d9928a

See more details on using hashes here.

File details

Details for the file neml2-1.3.1-cp38-cp38-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for neml2-1.3.1-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ed397e6b32fd27f7b4435ad413eb2e3db10e262d1cb00da6b82c6c9dd1fade20
MD5 543cc84995fd0f46099c1d1f8ee18c3b
BLAKE2b-256 bce66683c5aeeb1e6ccc6a11828f24edf1ba69146c920a88b13c23a2ad3fa126

See more details on using hashes here.

File details

Details for the file neml2-1.3.1-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for neml2-1.3.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 873e88b17e2fe21a0f754afc451e82e0821dc2f1d1bab4484c7b6d26868c7f36
MD5 b8ac99b14cef4e85cf474e242bfa13f7
BLAKE2b-256 4741b2feb3cc8854d08948354c49c36791525714c223182a497585b404b3c448

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page