This is a benchmark test for various Automatic Differentiation (AD) tools for deriving constitutive models in solid mechanics.
The AD tools used in this benchmark suit are:
- ADOL-C
- Tapenade
- Enzyme (C & Rust)
in addition to the hand-coded implementation of the Neo-Hookean Hyper-elasticity model in current configuration.
Enzyme-AD can be cloned from GitHub.
$ git clone https://github.com/EnzymeAD/Enzyme
Follow the Enzyme documentation to build Enzyme.
ADOL-C can be cloned from GitHub.
$ git clone https://github.com/coin-or/ADOL-C
Follow the ADOL-C instructions to build ADOL-C.
The environment variables ENZYME_LIB
, ADOLC_LIB
, and ADOLC_INCLUDE
must be set to build the benchmark.
Assuming you have cloned benchmark-ad4solids
, export these environment variables:
$ export ENZYME_LIB=[path to Enzyme] ADOLC_LIB=[path to ADOL-C lib directory] ADOLC_LIB=[path to ADOL-C include directory]
Build with:
$ make OPT="-Ofast -march=native"
Create a csv
file that contains n
number of data (quadrature) points with:
$ python3 random-data.py n
and, run the tests with:
$ ./build/elasticity-exec