Basics to implement user-defined material routines in LS-Dyna with Python and C++ and realize two scale simulation schemes in LS-DYNA.
Dependencies below are included in the external_packages
directory. They may be included as submodules but for the sake of reproducablity a frozen version of their corresponding repositories is included here.
-
ttb
: Tensor Toolbox for Modern Fortran (ttb), hosted at https://github.com/adtzlr/ttb -
forpy
: A library for Fortran-Python interoperability, hosted at https://github.com/ylikx/forpy -
ezh5
: Easy HDF5 C++ Library, hosted at https://github.com/mileschen360/ezh5Test cases of these packages are included in
external_packages/test_*.sh
See the license
file for the project license and the licenses of the included dependencies.
Shadi Alameddin, Felix Fritzen. LS-DYNA two-scale homogenization extension. Version 1.0.0 (2021).
@software{alameddin2021,
author = {Shadi Alameddin, Felix Fritzen},
title = {LS-DYNA two-scale homogenization extension},
month = Aug,
year = 2021,
version = {v1.0.0},
url = {https://gitlab.com/shadialameddin/dae_umat_2scale_lsdyna}
}
-
Start by obtaining
ls-dyna_smp_d_R12_0_0_x64_redhat65_ifort160.tgz
usermat package/object version of LS-DYNA from your local distributor of LS-DYNA. The directory wherels-dyna_smp_d_R12_0_0_x64_redhat65_ifort160.tgz
is placed will be referred to asdyna_umat_directory
-
Install Intel® C and Fortran compilers that are included in the Intel® oneAPI HPC Toolkit which is available for free. Examples below have been compiled using ifort, icc version 2021.1 and Python 3.7.9 & 3.8.5. In addition, some tests use GNU Fortran 9.3.0.
-
Obtain the new interface files from GitLab and position it in
dyna_umat_directory
via
cd dyna_umat_directory
git clone git@gitlab.com:shadialameddin/dae_umat_2scale_lsdyna.git lsdyna_added_files_ref
- Using a terminal, navigate to
lsdyna_added_files_ref
and create a symbolic link to the main setup file via
cd lsdyna_added_files_ref
./create_links.sh
cd ..
-
Edit
set_env.sh
to point to the correctintel_dir
and add python examples withinlsdyna_added_files_ref
toPYTHONPATH
. -
Edit
setup_dyna.sh
to point to the absolute path ofdae_umat_2scale_lsdyna
. -
Now everything is in place to compile the usermat package, to do that, from
dyna_umat_directory
run./setup_dyna.sh
. The new executable will be placed indyna_umat_directory/lsdyna_object_version/lsdynaumat
In case of issues while running from a new shell, setting the correct environmental variables via running
source set_env
should fix the problem.
- External packages: test cases of these packages are included in
external_packages/test_*.sh
test_ttb.sh
test_forpy.sh
test_ezh5.sh
- Mixed language programming
test_call_cpp.sh
: compiles and runs a Fortran function that calls a C++ onetest_call_py.sh
: compiles and runs a Fortran function that calls a Python one via C++
-
examples/two_scale/analytical_mat_parameter
Temperature dependent material parameters are considered here and given as lambda functions in
material_parameters.py
.To get an idea about the implementation check:
umat_elastic_44_14.F90
material_parameters.py
umat.py
-
examples/two_scale/homogeneous_single_track
Here, an RVE effective response under different load temperatures is assumed to exist and stored in a tabulated format in an HDF5 file. Linear interpolation is used to evaluate effective properties at current temperature given the stored response at one higher and one lower temperatures.
To get an idea about the implementation check:
umat_elastic_44_14.F90
umat.py
rve_elastic.py
-
Discontinued
examples/two_scale/3d_rve
examples/two_scale/2d_rve
Here, a thermo-mechanical response of a representative volume element is computed using LS-DYNA.