diff --git a/.github/workflows/conda-packaging.yml b/.github/workflows/conda-packaging.yml index 74a885ce4..c4435e2b4 100644 --- a/.github/workflows/conda-packaging.yml +++ b/.github/workflows/conda-packaging.yml @@ -96,17 +96,17 @@ jobs: # Check Python module in site-packages echo "Checking Python module..." SITE_PACKAGES=$(conda run -n test-install python -c "import sysconfig; print(sysconfig.get_path('purelib'))") - if [ -f "$SITE_PACKAGES/simcoon/simmit.so" ] || ls "$SITE_PACKAGES/simcoon"/simmit.cpython*.so 1>/dev/null 2>&1; then - echo "✓ simmit.so found in site-packages/simcoon" + if [ -f "$SITE_PACKAGES/simcoon/_core.so" ] || ls "$SITE_PACKAGES/simcoon"/_core.cpython*.so 1>/dev/null 2>&1; then + echo "✓ _core.so found in site-packages/simcoon" else - echo "✗ ERROR: simmit.so NOT found in site-packages/simcoon" + echo "✗ ERROR: _core.so NOT found in site-packages/simcoon" ls -la $SITE_PACKAGES/simcoon/ || true exit 1 fi - # Verify simmit links to system libsimcoon (not bundled) - echo "Checking simmit RPATH..." - SIMMIT_PATH=$(find $SITE_PACKAGES/simcoon -name "simmit*.so" | head -1) + # Verify _core links to system libsimcoon (not bundled) + echo "Checking _core RPATH..." + SIMMIT_PATH=$(find $SITE_PACKAGES/simcoon -name "_core*.so" | head -1) if [ -n "$SIMMIT_PATH" ]; then if command -v readelf &> /dev/null; then readelf -d "$SIMMIT_PATH" | grep -E "(RPATH|RUNPATH)" || echo "(no RPATH/RUNPATH found)" @@ -126,7 +126,7 @@ jobs: # Test import echo "Testing Python import..." - conda run -n test-install python -c "import simcoon; import simcoon.simmit; print('✓ Import successful')" + conda run -n test-install python -c "import simcoon; import simcoon._core; print('✓ Import successful')" - name: Install and verify package structure (Windows) if: runner.os == 'Windows' @@ -163,7 +163,7 @@ jobs: # Test import Write-Host "Testing Python import..." - conda run -n test-install python -c "import simcoon; import simcoon.simmit; print('Import successful')" + conda run -n test-install python -c "import simcoon; import simcoon._core; print('Import successful')" - name: Upload to Anaconda if: github.event_name == 'workflow_dispatch' diff --git a/CMakeLists.txt b/CMakeLists.txt index d229db02e..e207fe588 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -325,7 +325,7 @@ target_link_libraries(simcoon ) # On Windows with Python bindings, link libsimcoon to carma to use NumPy's memory allocator. -# This prevents heap corruption when Armadillo objects cross the libsimcoon/simmit boundary. +# This prevents heap corruption when Armadillo objects cross the libsimcoon/_core boundary. # Only needed on Windows due to stricter heap validation. # See: https://github.com/RUrlus/carma/issues/89 if(WIN32 AND BUILD_PYTHON_BINDINGS) diff --git a/Install.bat b/Install.bat index 07c2e4379..8334dbc4d 100755 --- a/Install.bat +++ b/Install.bat @@ -1,4 +1,4 @@ -:: conda install -c conda-forge git cmake python=3.9 boost -y +:: conda install -c conda-forge git cmake python=3.9 -y set PREFIX=%CONDA_PREFIX% set SRC_DIR=%cd% @@ -55,7 +55,7 @@ cd %SP_DIR% mkdir simcoon cd simcoon type NUL > __init__.py -xcopy /s /i %SRC_DIR%\simcoon-python-builder\build\lib\Release\simmit.pyd %SP_DIR%\simcoon +xcopy /s /i %SRC_DIR%\simcoon-python-builder\build\lib\Release\_core.pyd %SP_DIR%\simcoon if errorlevel 1 exit 1 REM xcopy /s /i %SRC_DIR%\armadillo\examples\lib_win64\libopenblas.dll %PREFIX%\Library\bin diff --git a/Install.sh b/Install.sh index 1de0416f4..39af2db26 100755 --- a/Install.sh +++ b/Install.sh @@ -95,7 +95,7 @@ fi #Ask for installation of the simcoon library while true; do - read -p "Do you want to install simcoon library (necessary to use libsimcoon.so and simmit) ? " yn + read -p "Do you want to install simcoon library (necessary to use libsimcoon.so) ? " yn case $yn in [YyOo]* ) Install_check='OK'; break;; [Nn]* ) Install_check='NO'; break;; @@ -221,7 +221,7 @@ then cd .. cd .. - cp ${current_dir}/simcoon-python-builder/build/lib/simmit.so ${current_dir}/python-setup/simcoon/simmit.so + cp ${current_dir}/simcoon-python-builder/build/lib/_core.so ${current_dir}/python-setup/simcoon/_core.so cd ${current_dir}/python-setup #Change the current dir and install python library @@ -233,8 +233,8 @@ then # if [ $OS = "Mac" ] # then # install_name_tool -change libsimcoon.dylib @rpath/libsimcoon.dylib $CONDA_PREFIX/lib/libarma2numpy.dylib -# install_name_tool -change libarma2numpy.dylib @rpath/libarma2numpy.dylib $CONDA_PREFIX/lib/python${python_version}/site-packages/simcoon/simmit.so -# install_name_tool -change libsimcoon.dylib @rpath/libsimcoon.dylib $CONDA_PREFIX/lib/python${python_version}/site-packages/simcoon/simmit.so +# install_name_tool -change libarma2numpy.dylib @rpath/libarma2numpy.dylib $CONDA_PREFIX/lib/python${python_version}/site-packages/simcoon/_core.so +# install_name_tool -change libsimcoon.dylib @rpath/libsimcoon.dylib $CONDA_PREFIX/lib/python${python_version}/site-packages/simcoon/_core.so # fi cd ${current_dir}/simcoon-python-builder/build diff --git a/Notebooks/Continuum_Mechanics/constitutive_relations.ipynb b/Notebooks/Continuum_Mechanics/constitutive_relations.ipynb index 44a21e093..e61d937d5 100644 --- a/Notebooks/Continuum_Mechanics/constitutive_relations.ipynb +++ b/Notebooks/Continuum_Mechanics/constitutive_relations.ipynb @@ -1,533 +1,521 @@ { - "cells": [ - { - "cell_type": "markdown", - "source": [ - "# constitutive : The Constitutive Library\n", - "\n", - "This notebook provide the functions that define the different stiffness tensors considering a Voigt notation" - ], - "metadata": {} - }, - { - "cell_type": "code", - "source": [ - "%matplotlib inline\n", - "\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt\n", - "from simcoon import simmit as sim\n", - "import os" - ], - "outputs": [], - "execution_count": 4, - "metadata": { - "execution": { - "iopub.status.busy": "2022-01-30T22:16:20.210Z", - "iopub.execute_input": "2022-01-30T22:16:20.217Z", - "iopub.status.idle": "2022-01-30T22:16:20.779Z", - "shell.execute_reply": "2022-01-30T22:16:20.771Z" - } - } - }, - { - "cell_type": "markdown", - "source": [ - "## L_iso\n", - "\n", - "Provides the elastic stiffness tensor for an isotropic material.\n", - "The two first arguments are a couple of elastic properties. The third argument specifies which couple has been provided and the nature and order of coefficients.\n", - "Exhaustive list of possible third argument :\n", - "‘Enu’,’nuE,’Kmu’,’muK’, ‘KG’, ‘GK’, ‘lambdamu’, ‘mulambda’, ‘lambdaG’, ‘Glambda’.\n", - "Return a numpy ndarray.\n", - "Example :" - ], - "metadata": {} - }, - { - "cell_type": "code", - "source": [ - "E = 70000.0\n", - "nu = 0.3\n", - "L = sim.L_iso(E,nu,\"Enu\")\n", - "print(np.array_str(L, precision=2, suppress_small=True))\n", - "\n", - "d = sim.check_symetries(L)\n", - "print(d['umat_type'])\n", - "print(d['props'])\n", - "\n", - "x = sim.L_iso_props(L)\n", - "print(x)\n", - "\n" - ], - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "[[94230.77 40384.62 40384.62 0. 0. 0. ]\n", - " [40384.62 94230.77 40384.62 0. 0. 0. ]\n", - " [40384.62 40384.62 94230.77 0. 0. 0. ]\n", - " [ 0. 0. 0. 26923.08 0. 0. ]\n", - " [ 0. 0. 0. 0. 26923.08 0. ]\n", - " [ 0. 0. 0. 0. 0. 26923.08]]\n", - "ELISO\n", - "[7.e+04 3.e-01]\n", - "[7.e+04 3.e-01]\n" - ] - } - ], - "execution_count": 5, - "metadata": { - "execution": { - "iopub.status.busy": "2022-01-30T22:16:21.673Z", - "iopub.execute_input": "2022-01-30T22:16:21.680Z", - "iopub.status.idle": "2022-01-30T22:16:21.693Z", - "shell.execute_reply": "2022-01-30T22:16:21.697Z" - } - } - }, - { - "cell_type": "markdown", - "source": [ - "## M_iso\n", - "\n", - "Provides the elastic compliance tensor for an isotropic material.\n", - "The two first arguments are a couple of elastic properties. The third argument specify which couple has been provided and the nature and order of coefficients.\n", - "Exhaustive list of possible third argument :\n", - "‘Enu’,’nuE,’Kmu’,’muK’, ‘KG’, ‘GK’, ‘lambdamu’, ‘mulambda’, ‘lambdaG’, ‘Glambda’." - ], - "metadata": {} - }, - { - "cell_type": "code", - "source": [ - "E = 70000.0\n", - "nu = 0.3\n", - "M = sim.M_iso(E,nu,\"Enu\")\n", - "print(np.array_str(M, suppress_small=True))\n", - "\n", - "L_inv = np.linalg.inv(M)\n", - "d = sim.check_symetries(L_inv)\n", - "print(d['umat_type'])\n", - "print(d['props'])\n", - "\n", - "x = sim.M_iso_props(M)\n", - "print(x)\n" - ], - "outputs": [], - "execution_count": null, - "metadata": { - "scrolled": true, - "execution": { - "iopub.status.busy": "2022-01-29T14:52:11.807Z", - "iopub.execute_input": "2022-01-29T14:52:11.811Z", - "iopub.status.idle": "2022-01-29T14:52:11.821Z", - "shell.execute_reply": "2022-01-29T14:52:11.966Z" - } - } - }, - { - "cell_type": "markdown", - "source": [ - "## L_cubic\n", - "\n", - "Provides the elastic stiffness tensor for a cubic material. Arguments are the stiffness coefficients C11, C12 and C44, or the elastic constants E, nu, G\n", - "Exhaustive list of possible third argument : ‘Cii’,’EnuG, the by-default argument is 'Cii'" - ], - "metadata": {} - }, - { - "cell_type": "code", - "source": [ - "E = 70000.0\n", - "nu = 0.3\n", - "G = 23000.0\n", - "L = sim.L_cubic(E,nu,G,\"EnuG\")\n", - "print(np.array_str(L, precision=2, suppress_small=True))\n", - "\n", - "d = sim.check_symetries(L)\n", - "print(d['umat_type'])\n", - "print(d['props'])\n", - "\n", - "x = sim.L_cubic_props(L)\n", - "print(x)\n", - "\n", - "C11 = np.random.uniform(10000., 100000.)\n", - "C12 = np.random.uniform(10000., 100000.)\n", - "C44 = np.random.uniform(10000., 100000.)\n", - "Liso = sim.L_cubic(C11,C12,C44, \"Cii\")\n" - ], - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "[[94230.77 40384.62 40384.62 0. 0. 0. ]\n", - " [40384.62 94230.77 40384.62 0. 0. 0. ]\n", - " [40384.62 40384.62 94230.77 0. 0. 0. ]\n", - " [ 0. 0. 0. 23000. 0. 0. ]\n", - " [ 0. 0. 0. 0. 23000. 0. ]\n", - " [ 0. 0. 0. 0. 0. 23000. ]]\n", - "ELCUB\n", - "[7.0e+04 3.0e-01 2.3e+04]\n", - "[7.0e+04 3.0e-01 2.3e+04]\n" - ] - } - ], - "execution_count": 7, - "metadata": { - "execution": { - "iopub.status.busy": "2022-01-30T21:32:38.578Z", - "iopub.execute_input": "2022-01-30T21:32:38.589Z", - "iopub.status.idle": "2022-01-30T21:32:38.607Z", - "shell.execute_reply": "2022-01-30T21:32:38.613Z" - } - } - }, - { - "cell_type": "markdown", - "source": [ - "## M_cubic\n", - "\n", - "Provides the elastic compliance tensor for a cubic material. Arguments are the stiffness coefficients C11, C12 and C44, or the elastic constants E, nu, G\n", - "Exhaustive list of possible third argument : ‘Cii’,’EnuG, the by-default argument is 'Cii'" - ], - "metadata": {} - }, - { - "cell_type": "code", - "source": [ - "E = 70000.0\n", - "nu = 0.3\n", - "G = 23000.0\n", - "M = sim.M_cubic(E,nu,G,\"EnuG\")\n", - "print(np.array_str(M, suppress_small=True))\n", - "\n", - "L = np.linalg.inv(M)\n", - "d = sim.check_symetries(L)\n", - "print(d['umat_type'])\n", - "print(d['props'])\n", - "\n", - "x = sim.L_cubic_props(L)\n", - "print(x)" - ], - "outputs": [], - "execution_count": null, - "metadata": { - "execution": { - "iopub.status.busy": "2022-01-29T14:52:11.847Z", - "iopub.execute_input": "2022-01-29T14:52:11.851Z", - "iopub.status.idle": "2022-01-29T14:52:11.860Z", - "shell.execute_reply": "2022-01-29T14:52:11.974Z" - } - } - }, - { - "cell_type": "markdown", - "source": [ - "## L_isotrans\n", - "\n", - "Provides the elastic stiffness tensor for an isotropic transverse material.\n", - "Arguments are longitudinal Young modulus EL, transverse young modulus, Poisson’s ratio for loading along the longitudinal axis nuTL, Poisson’s ratio for loading along the transverse axis nuTT, shear modulus GLT and the axis of symmetry." - ], - "metadata": {} - }, - { - "cell_type": "code", - "source": [ - "EL = 70000.0\n", - "ET = 20000.0\n", - "nuTL = 0.08\n", - "nuTT = 0.3\n", - "GLT = 12000.0\n", - "axis = 3\n", - "L = sim.L_isotrans(EL,ET,nuTL,nuTT,GLT,axis)\n", - "print(np.array_str(L, precision=2, suppress_small=True))\n", - "\n", - "d = sim.check_symetries(L)\n", - "print(d['umat_type'])\n", - "print(d['axis'])\n", - "print(np.array_str(d['props'], precision=2, suppress_small=True))\n", - "\n", - "x = sim.L_isotrans_props(L,axis)\n", - "print(np.array_str(x, precision=2))" - ], - "outputs": [], - "execution_count": null, - "metadata": { - "execution": { - "iopub.status.busy": "2022-01-29T14:52:11.866Z", - "iopub.execute_input": "2022-01-29T14:52:11.870Z", - "iopub.status.idle": "2022-01-29T14:52:11.880Z", - "shell.execute_reply": "2022-01-29T14:52:11.977Z" - } - } - }, - { - "cell_type": "markdown", - "source": [ - " bp::def(\"L_iso\", L_iso);\n", - " bp::def(\"M_iso\", M_iso);\n", - " bp::def(\"L_cubic\", L_cubic);\n", - " bp::def(\"M_cubic\", M_cubic);\n", - " bp::def(\"L_ortho\", L_ortho);\n", - " bp::def(\"M_ortho\", M_ortho);\n", - " bp::def(\"L_isotrans\", L_isotrans);\n", - " bp::def(\"M_isotrans\", M_isotrans);\n", - " \n", - " bp::def(\"check_symetries\", check_symetries);\n", - " bp::def(\"L_iso_props\", L_iso_props);\n", - " bp::def(\"M_iso_props\", M_iso_props);\n", - " bp::def(\"L_isotrans_props\", L_isotrans_props);\n", - " bp::def(\"M_isotrans_props\", M_isotrans_props);\n", - " bp::def(\"L_cubic_props\", L_cubic_props);\n", - " bp::def(\"M_cubic_props\", M_cubic_props);\n", - " bp::def(\"L_ortho_props\", L_ortho_props);\n", - " bp::def(\"M_ortho_props\", M_ortho_props);\n", - " bp::def(\"M_aniso_props\", M_aniso_props);" - ], - "metadata": {} - }, - { - "cell_type": "markdown", - "source": [ - "## M_isotrans\n", - "\n", - "Provides the elastic compliance tensor for an isotropic transverse material.\n", - "Arguments are longitudinal Young modulus EL, transverse young modulus, Poisson’s ratio for loading along the longitudinal axis nuTL, Poisson’s ratio for loading along the transverse axis nuTT, shear modulus GLT and the axis of symmetry." - ], - "metadata": {} - }, - { - "cell_type": "code", - "source": [ - "EL = 70000.0\n", - "ET = 20000.0\n", - "nuTL = 0.08\n", - "nuTT = 0.3\n", - "GLT = 12000.0\n", - "axis = 3\n", - "M = sim.M_isotrans(EL,ET,nuTL,nuTT,GLT,axis)\n", - "print(np.array_str(M, suppress_small=True))\n", - "\n", - "x = sim.M_isotrans_props(M,axis)\n", - "print(np.array_str(x, precision=2, suppress_small=True))" - ], - "outputs": [], - "execution_count": null, - "metadata": { - "execution": { - "iopub.status.busy": "2022-01-29T14:52:11.885Z", - "iopub.execute_input": "2022-01-29T14:52:11.890Z", - "iopub.status.idle": "2022-01-29T14:52:11.899Z", - "shell.execute_reply": "2022-01-29T14:52:11.981Z" - } - } - }, - { - "cell_type": "markdown", - "source": [ - "## L_ortho\n", - "\n", - "Provides the elastic stiffness tensor for an orthotropic material.\n", - "Arguments are either (convention 'EnuG'):\n", - "\n", - "1. The Young modulus of axis 1 $E_1$,\n", - "2. The Young modulus of axis 2 $E_2$,\n", - "3. The Young modulus of axis 3 $E_3$,\n", - "4. The Poisson ratio of direction 1 with respect to 2 $\\nu_{12}$,\n", - "5. The Poisson ratio of direction 1 with respect to 3 $\\nu_{13}$,\n", - "6. The Poisson ratio of direction 2 with respect to 3 $\\nu_{13}$,\n", - "7. The shear modulus of direction 1 with respect to 2 $G_{12}$,\n", - "8. The shear modulus of direction 1 with respect to 3 $G_{13}$,\n", - "9. The shear modulus of direction 2 with respect to 3 $G_{23}$,\n", - "10. The axial coefficient of thermal expansion in direction 1 $\\alpha_1$,\n", - "11. The axial coefficient of thermal expansion in direction 1 $\\alpha_2$,\n", - "12. The axial coefficient of thermal expansion in direction 1 $\\alpha_3$,\n", - "\n", - "or the list of Cii (C11, C12, C13, C22, C23, C33, C44, C55, C66) (convention 'Cii')" - ], - "metadata": {} - }, - { - "cell_type": "code", - "source": [ - "E_1 = 4500.0\n", - "E_2 = 2300.0\n", - "E_3 = 2700.0\n", - "nu_12 = 0.06\n", - "nu_13 = 0.08\n", - "nu_23 = 0.3\n", - "G_12 = 2200.0\n", - "G_13 = 2100.0\n", - "G_23 = 2400.0\n", - "\n", - "L = sim.L_ortho(E_1,E_2,E_3,nu_12,nu_13,nu_23,G_12,G_13,G_23,'EnuG')\n", - "print(np.array_str(L, precision=2, suppress_small=True))\n", - "\n", - "d = sim.check_symetries(L)\n", - "print(d['umat_type'])\n", - "print(d['axis'])\n", - "print(np.array_str(d['props'], precision=2, suppress_small=True))\n", - "\n", - "x = sim.L_ortho_props(L)\n", - "print(np.array_str(x, precision=2, suppress_small=True))" - ], - "outputs": [], - "execution_count": null, - "metadata": { - "execution": { - "iopub.status.busy": "2022-01-29T14:52:11.906Z", - "iopub.execute_input": "2022-01-29T14:52:11.911Z", - "iopub.status.idle": "2022-01-29T14:52:11.923Z", - "shell.execute_reply": "2022-01-29T14:52:11.984Z" - } - } - }, - { - "cell_type": "markdown", - "source": [ - "## M_ortho\n", - "\n", - "Provides the elastic compliance tensor for an orthotropic material.\n", - "Arguments are either (convention 'EnuG'):\n", - "\n", - "1. The Young modulus of axis 1 $E_1$,\n", - "2. The Young modulus of axis 2 $E_2$,\n", - "3. The Young modulus of axis 3 $E_3$,\n", - "4. The Poisson ratio of direction 1 with respect to 2 $\\nu_{12}$,\n", - "5. The Poisson ratio of direction 1 with respect to 3 $\\nu_{13}$,\n", - "6. The Poisson ratio of direction 2 with respect to 3 $\\nu_{13}$,\n", - "7. The shear modulus of direction 1 with respect to 2 $G_{12}$,\n", - "8. The shear modulus of direction 1 with respect to 3 $G_{13}$,\n", - "9. The shear modulus of direction 2 with respect to 3 $G_{23}$,\n", - "10. The axial coefficient of thermal expansion in direction 1 $\\alpha_1$,\n", - "11. The axial coefficient of thermal expansion in direction 1 $\\alpha_2$,\n", - "12. The axial coefficient of thermal expansion in direction 1 $\\alpha_3$,\n", - "\n", - "or the list of Cii (C11, C12, C13, C22, C23, C33, C44, C55, C66) (convention 'Cii')" - ], - "metadata": {} - }, - { - "cell_type": "code", - "source": [ - "E_1 = 4500.0\n", - "E_2 = 2300.0\n", - "E_3 = 2700.0\n", - "nu_12 = 0.06\n", - "nu_13 = 0.08\n", - "nu_23 = 0.3\n", - "G_12 = 2200.0\n", - "G_13 = 2100.0\n", - "G_23 = 2400.0\n", - "\n", - "M = sim.M_ortho(E_1,E_2,E_3,nu_12,nu_13,nu_23,G_12,G_13,G_23,'EnuG')\n", - "print(np.array_str(M, suppress_small=True))\n", - "\n", - "x = sim.M_ortho_props(M)\n", - "print(np.array_str(x, precision=4, suppress_small=True))" - ], - "outputs": [], - "execution_count": null, - "metadata": { - "execution": { - "iopub.status.busy": "2022-01-29T14:52:11.929Z", - "iopub.execute_input": "2022-01-29T14:52:11.933Z", - "iopub.status.idle": "2022-01-29T14:52:11.943Z", - "shell.execute_reply": "2022-01-29T14:52:11.987Z" - } - } - }, - { - "cell_type": "code", - "source": [ - "L = sim.L_iso(70000.0, 0.3,\"Enu\");\n", - "Eel = np.random.uniform(0., 1., 6);\n", - "ndi = 3\n", - "sigma = sim.el_pred(L, Eel, ndi)\n" - ], - "outputs": [ - { - "output_type": "error", - "ename": "AttributeError", - "evalue": "module 'simcoon.simmit' has no attribute 'el_pred'", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", - "Input \u001b[0;32mIn [6]\u001b[0m, in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 2\u001b[0m Eel \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mrandom\u001b[38;5;241m.\u001b[39muniform(\u001b[38;5;241m0.\u001b[39m, \u001b[38;5;241m1.\u001b[39m, \u001b[38;5;241m6\u001b[39m);\n\u001b[1;32m 3\u001b[0m ndi \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m3\u001b[39m\n\u001b[0;32m----> 4\u001b[0m sigma \u001b[38;5;241m=\u001b[39m \u001b[43msim\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mel_pred\u001b[49m(L, Eel, ndi)\n", - "\u001b[0;31mAttributeError\u001b[0m: module 'simcoon.simmit' has no attribute 'el_pred'" - ] - } - ], - "execution_count": 6, - "metadata": { - "execution": { - "iopub.status.busy": "2022-01-30T22:53:01.061Z", - "iopub.execute_input": "2022-01-30T22:53:01.071Z" - } - } - }, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# constitutive : The Constitutive Library\n", + "\n", + "This notebook provide the functions that define the different stiffness tensors considering a Voigt notation" + ], + "metadata": {} + }, + { + "cell_type": "code", + "source": [ + "%matplotlib inline\n", + "\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "import simcoon as sim\n", + "import os" + ], + "outputs": [], + "execution_count": 4, + "metadata": { + "execution": { + "iopub.status.busy": "2022-01-30T22:16:20.210Z", + "iopub.execute_input": "2022-01-30T22:16:20.217Z", + "iopub.status.idle": "2022-01-30T22:16:20.779Z", + "shell.execute_reply": "2022-01-30T22:16:20.771Z" + } + } + }, + { + "cell_type": "markdown", + "source": [ + "## L_iso\n", + "\n", + "Provides the elastic stiffness tensor for an isotropic material.\n", + "The two first arguments are a couple of elastic properties. The third argument specifies which couple has been provided and the nature and order of coefficients.\n", + "Exhaustive list of possible third argument :\n", + "\u2018Enu\u2019,\u2019nuE,\u2019Kmu\u2019,\u2019muK\u2019, \u2018KG\u2019, \u2018GK\u2019, \u2018lambdamu\u2019, \u2018mulambda\u2019, \u2018lambdaG\u2019, \u2018Glambda\u2019.\n", + "Return a numpy ndarray.\n", + "Example :" + ], + "metadata": {} + }, + { + "cell_type": "code", + "source": [ + "E = 70000.0\n", + "nu = 0.3\n", + "L = sim.L_iso(E,nu,\"Enu\")\n", + "print(np.array_str(L, precision=2, suppress_small=True))\n", + "\n", + "d = sim.check_symetries(L)\n", + "print(d['umat_type'])\n", + "print(d['props'])\n", + "\n", + "x = sim.L_iso_props(L)\n", + "print(x)\n", + "\n" + ], + "outputs": [ { - "cell_type": "code", - "source": [ - "E = 70000.0\n", - "nu = 0.3\n", - "L = sim.L_iso(E,nu,\"Enu\")" - ], - "outputs": [], - "execution_count": 9, - "metadata": { - "execution": { - "iopub.status.busy": "2022-01-31T09:10:23.908Z", - "iopub.execute_input": "2022-01-31T09:10:23.915Z", - "iopub.status.idle": "2022-01-31T09:10:23.927Z", - "shell.execute_reply": "2022-01-31T09:10:23.935Z" - } - } - }, + "output_type": "stream", + "name": "stdout", + "text": [ + "[[94230.77 40384.62 40384.62 0. 0. 0. ]\n", + " [40384.62 94230.77 40384.62 0. 0. 0. ]\n", + " [40384.62 40384.62 94230.77 0. 0. 0. ]\n", + " [ 0. 0. 0. 26923.08 0. 0. ]\n", + " [ 0. 0. 0. 0. 26923.08 0. ]\n", + " [ 0. 0. 0. 0. 0. 26923.08]]\n", + "ELISO\n", + "[7.e+04 3.e-01]\n", + "[7.e+04 3.e-01]\n" + ] + } + ], + "execution_count": 5, + "metadata": { + "execution": { + "iopub.status.busy": "2022-01-30T22:16:21.673Z", + "iopub.execute_input": "2022-01-30T22:16:21.680Z", + "iopub.status.idle": "2022-01-30T22:16:21.693Z", + "shell.execute_reply": "2022-01-30T22:16:21.697Z" + } + } + }, + { + "cell_type": "markdown", + "source": [ + "## M_iso\n", + "\n", + "Provides the elastic compliance tensor for an isotropic material.\n", + "The two first arguments are a couple of elastic properties. The third argument specify which couple has been provided and the nature and order of coefficients.\n", + "Exhaustive list of possible third argument :\n", + "\u2018Enu\u2019,\u2019nuE,\u2019Kmu\u2019,\u2019muK\u2019, \u2018KG\u2019, \u2018GK\u2019, \u2018lambdamu\u2019, \u2018mulambda\u2019, \u2018lambdaG\u2019, \u2018Glambda\u2019." + ], + "metadata": {} + }, + { + "cell_type": "code", + "source": [ + "E = 70000.0\n", + "nu = 0.3\n", + "M = sim.M_iso(E,nu,\"Enu\")\n", + "print(np.array_str(M, suppress_small=True))\n", + "\n", + "L_inv = np.linalg.inv(M)\n", + "d = sim.check_symetries(L_inv)\n", + "print(d['umat_type'])\n", + "print(d['props'])\n", + "\n", + "x = sim.M_iso_props(M)\n", + "print(x)\n" + ], + "outputs": [], + "execution_count": null, + "metadata": { + "scrolled": true, + "execution": { + "iopub.status.busy": "2022-01-29T14:52:11.807Z", + "iopub.execute_input": "2022-01-29T14:52:11.811Z", + "iopub.status.idle": "2022-01-29T14:52:11.821Z", + "shell.execute_reply": "2022-01-29T14:52:11.966Z" + } + } + }, + { + "cell_type": "markdown", + "source": [ + "## L_cubic\n", + "\n", + "Provides the elastic stiffness tensor for a cubic material. Arguments are the stiffness coefficients C11, C12 and C44, or the elastic constants E, nu, G\n", + "Exhaustive list of possible third argument : \u2018Cii\u2019,\u2019EnuG, the by-default argument is 'Cii'" + ], + "metadata": {} + }, + { + "cell_type": "code", + "source": [ + "E = 70000.0\n", + "nu = 0.3\n", + "G = 23000.0\n", + "L = sim.L_cubic(E,nu,G,\"EnuG\")\n", + "print(np.array_str(L, precision=2, suppress_small=True))\n", + "\n", + "d = sim.check_symetries(L)\n", + "print(d['umat_type'])\n", + "print(d['props'])\n", + "\n", + "x = sim.L_cubic_props(L)\n", + "print(x)\n", + "\n", + "C11 = np.random.uniform(10000., 100000.)\n", + "C12 = np.random.uniform(10000., 100000.)\n", + "C44 = np.random.uniform(10000., 100000.)\n", + "Liso = sim.L_cubic(C11,C12,C44, \"Cii\")\n" + ], + "outputs": [ { - "cell_type": "code", - "source": [], - "outputs": [], - "execution_count": null, - "metadata": { - "collapsed": true, - "jupyter": { - "source_hidden": false, - "outputs_hidden": false - }, - "nteract": { - "transient": { - "deleting": false - } - } - } + "output_type": "stream", + "name": "stdout", + "text": [ + "[[94230.77 40384.62 40384.62 0. 0. 0. ]\n", + " [40384.62 94230.77 40384.62 0. 0. 0. ]\n", + " [40384.62 40384.62 94230.77 0. 0. 0. ]\n", + " [ 0. 0. 0. 23000. 0. 0. ]\n", + " [ 0. 0. 0. 0. 23000. 0. ]\n", + " [ 0. 0. 0. 0. 0. 23000. ]]\n", + "ELCUB\n", + "[7.0e+04 3.0e-01 2.3e+04]\n", + "[7.0e+04 3.0e-01 2.3e+04]\n" + ] } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 2", - "language": "python", - "name": "python2" - }, - "language_info": { - "name": "python", - "version": "3.8.12", - "mimetype": "text/x-python", - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "pygments_lexer": "ipython3", - "nbconvert_exporter": "python", - "file_extension": ".py" + ], + "execution_count": 7, + "metadata": { + "execution": { + "iopub.status.busy": "2022-01-30T21:32:38.578Z", + "iopub.execute_input": "2022-01-30T21:32:38.589Z", + "iopub.status.idle": "2022-01-30T21:32:38.607Z", + "shell.execute_reply": "2022-01-30T21:32:38.613Z" + } + } + }, + { + "cell_type": "markdown", + "source": [ + "## M_cubic\n", + "\n", + "Provides the elastic compliance tensor for a cubic material. Arguments are the stiffness coefficients C11, C12 and C44, or the elastic constants E, nu, G\n", + "Exhaustive list of possible third argument : \u2018Cii\u2019,\u2019EnuG, the by-default argument is 'Cii'" + ], + "metadata": {} + }, + { + "cell_type": "code", + "source": [ + "E = 70000.0\n", + "nu = 0.3\n", + "G = 23000.0\n", + "M = sim.M_cubic(E,nu,G,\"EnuG\")\n", + "print(np.array_str(M, suppress_small=True))\n", + "\n", + "L = np.linalg.inv(M)\n", + "d = sim.check_symetries(L)\n", + "print(d['umat_type'])\n", + "print(d['props'])\n", + "\n", + "x = sim.L_cubic_props(L)\n", + "print(x)" + ], + "outputs": [], + "execution_count": null, + "metadata": { + "execution": { + "iopub.status.busy": "2022-01-29T14:52:11.847Z", + "iopub.execute_input": "2022-01-29T14:52:11.851Z", + "iopub.status.idle": "2022-01-29T14:52:11.860Z", + "shell.execute_reply": "2022-01-29T14:52:11.974Z" + } + } + }, + { + "cell_type": "markdown", + "source": [ + "## L_isotrans\n", + "\n", + "Provides the elastic stiffness tensor for an isotropic transverse material.\n", + "Arguments are longitudinal Young modulus EL, transverse young modulus, Poisson\u2019s ratio for loading along the longitudinal axis nuTL, Poisson\u2019s ratio for loading along the transverse axis nuTT, shear modulus GLT and the axis of symmetry." + ], + "metadata": {} + }, + { + "cell_type": "code", + "source": [ + "EL = 70000.0\n", + "ET = 20000.0\n", + "nuTL = 0.08\n", + "nuTT = 0.3\n", + "GLT = 12000.0\n", + "axis = 3\n", + "L = sim.L_isotrans(EL,ET,nuTL,nuTT,GLT,axis)\n", + "print(np.array_str(L, precision=2, suppress_small=True))\n", + "\n", + "d = sim.check_symetries(L)\n", + "print(d['umat_type'])\n", + "print(d['axis'])\n", + "print(np.array_str(d['props'], precision=2, suppress_small=True))\n", + "\n", + "x = sim.L_isotrans_props(L,axis)\n", + "print(np.array_str(x, precision=2))" + ], + "outputs": [], + "execution_count": null, + "metadata": { + "execution": { + "iopub.status.busy": "2022-01-29T14:52:11.866Z", + "iopub.execute_input": "2022-01-29T14:52:11.870Z", + "iopub.status.idle": "2022-01-29T14:52:11.880Z", + "shell.execute_reply": "2022-01-29T14:52:11.977Z" + } + } + }, + { + "cell_type": "markdown", + "source": [ + " bp::def(\"L_iso\", L_iso);\n", + " bp::def(\"M_iso\", M_iso);\n", + " bp::def(\"L_cubic\", L_cubic);\n", + " bp::def(\"M_cubic\", M_cubic);\n", + " bp::def(\"L_ortho\", L_ortho);\n", + " bp::def(\"M_ortho\", M_ortho);\n", + " bp::def(\"L_isotrans\", L_isotrans);\n", + " bp::def(\"M_isotrans\", M_isotrans);\n", + " \n", + " bp::def(\"check_symetries\", check_symetries);\n", + " bp::def(\"L_iso_props\", L_iso_props);\n", + " bp::def(\"M_iso_props\", M_iso_props);\n", + " bp::def(\"L_isotrans_props\", L_isotrans_props);\n", + " bp::def(\"M_isotrans_props\", M_isotrans_props);\n", + " bp::def(\"L_cubic_props\", L_cubic_props);\n", + " bp::def(\"M_cubic_props\", M_cubic_props);\n", + " bp::def(\"L_ortho_props\", L_ortho_props);\n", + " bp::def(\"M_ortho_props\", M_ortho_props);\n", + " bp::def(\"M_aniso_props\", M_aniso_props);" + ], + "metadata": {} + }, + { + "cell_type": "markdown", + "source": [ + "## M_isotrans\n", + "\n", + "Provides the elastic compliance tensor for an isotropic transverse material.\n", + "Arguments are longitudinal Young modulus EL, transverse young modulus, Poisson\u2019s ratio for loading along the longitudinal axis nuTL, Poisson\u2019s ratio for loading along the transverse axis nuTT, shear modulus GLT and the axis of symmetry." + ], + "metadata": {} + }, + { + "cell_type": "code", + "source": [ + "EL = 70000.0\n", + "ET = 20000.0\n", + "nuTL = 0.08\n", + "nuTT = 0.3\n", + "GLT = 12000.0\n", + "axis = 3\n", + "M = sim.M_isotrans(EL,ET,nuTL,nuTT,GLT,axis)\n", + "print(np.array_str(M, suppress_small=True))\n", + "\n", + "x = sim.M_isotrans_props(M,axis)\n", + "print(np.array_str(x, precision=2, suppress_small=True))" + ], + "outputs": [], + "execution_count": null, + "metadata": { + "execution": { + "iopub.status.busy": "2022-01-29T14:52:11.885Z", + "iopub.execute_input": "2022-01-29T14:52:11.890Z", + "iopub.status.idle": "2022-01-29T14:52:11.899Z", + "shell.execute_reply": "2022-01-29T14:52:11.981Z" + } + } + }, + { + "cell_type": "markdown", + "source": [ + "## L_ortho\n", + "\n", + "Provides the elastic stiffness tensor for an orthotropic material.\n", + "Arguments are either (convention 'EnuG'):\n", + "\n", + "1. The Young modulus of axis 1 $E_1$,\n", + "2. The Young modulus of axis 2 $E_2$,\n", + "3. The Young modulus of axis 3 $E_3$,\n", + "4. The Poisson ratio of direction 1 with respect to 2 $\\nu_{12}$,\n", + "5. The Poisson ratio of direction 1 with respect to 3 $\\nu_{13}$,\n", + "6. The Poisson ratio of direction 2 with respect to 3 $\\nu_{13}$,\n", + "7. The shear modulus of direction 1 with respect to 2 $G_{12}$,\n", + "8. The shear modulus of direction 1 with respect to 3 $G_{13}$,\n", + "9. The shear modulus of direction 2 with respect to 3 $G_{23}$,\n", + "10. The axial coefficient of thermal expansion in direction 1 $\\alpha_1$,\n", + "11. The axial coefficient of thermal expansion in direction 1 $\\alpha_2$,\n", + "12. The axial coefficient of thermal expansion in direction 1 $\\alpha_3$,\n", + "\n", + "or the list of Cii (C11, C12, C13, C22, C23, C33, C44, C55, C66) (convention 'Cii')" + ], + "metadata": {} + }, + { + "cell_type": "code", + "source": [ + "E_1 = 4500.0\n", + "E_2 = 2300.0\n", + "E_3 = 2700.0\n", + "nu_12 = 0.06\n", + "nu_13 = 0.08\n", + "nu_23 = 0.3\n", + "G_12 = 2200.0\n", + "G_13 = 2100.0\n", + "G_23 = 2400.0\n", + "\n", + "L = sim.L_ortho(E_1,E_2,E_3,nu_12,nu_13,nu_23,G_12,G_13,G_23,'EnuG')\n", + "print(np.array_str(L, precision=2, suppress_small=True))\n", + "\n", + "d = sim.check_symetries(L)\n", + "print(d['umat_type'])\n", + "print(d['axis'])\n", + "print(np.array_str(d['props'], precision=2, suppress_small=True))\n", + "\n", + "x = sim.L_ortho_props(L)\n", + "print(np.array_str(x, precision=2, suppress_small=True))" + ], + "outputs": [], + "execution_count": null, + "metadata": { + "execution": { + "iopub.status.busy": "2022-01-29T14:52:11.906Z", + "iopub.execute_input": "2022-01-29T14:52:11.911Z", + "iopub.status.idle": "2022-01-29T14:52:11.923Z", + "shell.execute_reply": "2022-01-29T14:52:11.984Z" + } + } + }, + { + "cell_type": "markdown", + "source": [ + "## M_ortho\n", + "\n", + "Provides the elastic compliance tensor for an orthotropic material.\n", + "Arguments are either (convention 'EnuG'):\n", + "\n", + "1. The Young modulus of axis 1 $E_1$,\n", + "2. The Young modulus of axis 2 $E_2$,\n", + "3. The Young modulus of axis 3 $E_3$,\n", + "4. The Poisson ratio of direction 1 with respect to 2 $\\nu_{12}$,\n", + "5. The Poisson ratio of direction 1 with respect to 3 $\\nu_{13}$,\n", + "6. The Poisson ratio of direction 2 with respect to 3 $\\nu_{13}$,\n", + "7. The shear modulus of direction 1 with respect to 2 $G_{12}$,\n", + "8. The shear modulus of direction 1 with respect to 3 $G_{13}$,\n", + "9. The shear modulus of direction 2 with respect to 3 $G_{23}$,\n", + "10. The axial coefficient of thermal expansion in direction 1 $\\alpha_1$,\n", + "11. The axial coefficient of thermal expansion in direction 1 $\\alpha_2$,\n", + "12. The axial coefficient of thermal expansion in direction 1 $\\alpha_3$,\n", + "\n", + "or the list of Cii (C11, C12, C13, C22, C23, C33, C44, C55, C66) (convention 'Cii')" + ], + "metadata": {} + }, + { + "cell_type": "code", + "source": [ + "E_1 = 4500.0\n", + "E_2 = 2300.0\n", + "E_3 = 2700.0\n", + "nu_12 = 0.06\n", + "nu_13 = 0.08\n", + "nu_23 = 0.3\n", + "G_12 = 2200.0\n", + "G_13 = 2100.0\n", + "G_23 = 2400.0\n", + "\n", + "M = sim.M_ortho(E_1,E_2,E_3,nu_12,nu_13,nu_23,G_12,G_13,G_23,'EnuG')\n", + "print(np.array_str(M, suppress_small=True))\n", + "\n", + "x = sim.M_ortho_props(M)\n", + "print(np.array_str(x, precision=4, suppress_small=True))" + ], + "outputs": [], + "execution_count": null, + "metadata": { + "execution": { + "iopub.status.busy": "2022-01-29T14:52:11.929Z", + "iopub.execute_input": "2022-01-29T14:52:11.933Z", + "iopub.status.idle": "2022-01-29T14:52:11.943Z", + "shell.execute_reply": "2022-01-29T14:52:11.987Z" + } + } + }, + { + "cell_type": "code", + "source": [ + "L = sim.L_iso(70000.0, 0.3,\"Enu\");\n", + "Eel = np.random.uniform(0., 1., 6);\n", + "ndi = 3\n", + "sigma = sim.el_pred(L, Eel, ndi)\n" + ], + "outputs": [], + "execution_count": 6, + "metadata": { + "execution": { + "iopub.status.busy": "2022-01-30T22:53:01.061Z", + "iopub.execute_input": "2022-01-30T22:53:01.071Z" + } + } + }, + { + "cell_type": "code", + "source": [ + "E = 70000.0\n", + "nu = 0.3\n", + "L = sim.L_iso(E,nu,\"Enu\")" + ], + "outputs": [], + "execution_count": 9, + "metadata": { + "execution": { + "iopub.status.busy": "2022-01-31T09:10:23.908Z", + "iopub.execute_input": "2022-01-31T09:10:23.915Z", + "iopub.status.idle": "2022-01-31T09:10:23.927Z", + "shell.execute_reply": "2022-01-31T09:10:23.935Z" + } + } + }, + { + "cell_type": "code", + "source": [], + "outputs": [], + "execution_count": null, + "metadata": { + "collapsed": true, + "jupyter": { + "source_hidden": false, + "outputs_hidden": false }, "nteract": { - "version": "0.28.0" + "transient": { + "deleting": false + } } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "name": "python", + "version": "3.8.12", + "mimetype": "text/x-python", + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "pygments_lexer": "ipython3", + "nbconvert_exporter": "python", + "file_extension": ".py" }, - "nbformat": 4, - "nbformat_minor": 2 + "nteract": { + "version": "0.28.0" + } + }, + "nbformat": 4, + "nbformat_minor": 2 } \ No newline at end of file diff --git a/Notebooks/Umats/Mechanical/Elasticity/ELISO.ipynb b/Notebooks/Umats/Mechanical/Elasticity/ELISO.ipynb index fd6bcea76..215fbc7c7 100644 --- a/Notebooks/Umats/Mechanical/Elasticity/ELISO.ipynb +++ b/Notebooks/Umats/Mechanical/Elasticity/ELISO.ipynb @@ -14,7 +14,7 @@ "\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", - "from simcoon import simmit as sim\n", + "import simcoon as sim\n", "import os\n", "dir = os.path.dirname(os.path.realpath('__file__'))" ], diff --git a/Notebooks/Umats/Mechanical/Elasticity/ELITR.ipynb b/Notebooks/Umats/Mechanical/Elasticity/ELITR.ipynb index b9b5eb21e..05f3bc01f 100644 --- a/Notebooks/Umats/Mechanical/Elasticity/ELITR.ipynb +++ b/Notebooks/Umats/Mechanical/Elasticity/ELITR.ipynb @@ -15,7 +15,7 @@ "import pylab\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", - "from simcoon import simmit as sim\n", + "import simcoon as sim\n", "import math\n", "import os\n", "dir = os.path.dirname(os.path.realpath('__file__'))" diff --git a/Notebooks/Umats/Mechanical/Elasticity/ELORT.ipynb b/Notebooks/Umats/Mechanical/Elasticity/ELORT.ipynb index 960cdd7f0..f15bcc484 100644 --- a/Notebooks/Umats/Mechanical/Elasticity/ELORT.ipynb +++ b/Notebooks/Umats/Mechanical/Elasticity/ELORT.ipynb @@ -15,7 +15,7 @@ "import pylab\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", - "from simcoon import simmit as sim\n", + "import simcoon as sim\n", "import math\n", "import os\n", "dir = os.path.dirname(os.path.realpath('__file__'))" diff --git a/Notebooks/Umats/Mechanical/Plasticity/Loop_kin/EPKCP.ipynb b/Notebooks/Umats/Mechanical/Plasticity/Loop_kin/EPKCP.ipynb index fa4971b41..1e96e14cf 100644 --- a/Notebooks/Umats/Mechanical/Plasticity/Loop_kin/EPKCP.ipynb +++ b/Notebooks/Umats/Mechanical/Plasticity/Loop_kin/EPKCP.ipynb @@ -24,7 +24,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import rc\n", - "from simcoon import simmit as sim\n", + "import simcoon as sim\n", "import os\n", "from IPython.display import HTML\n", "dir = os.path.dirname(os.path.realpath('__file__'))\n", @@ -57,7 +57,7 @@ "where ${\\varepsilon}^{\\textrm{p}}_{ij}$ is the plastic strain tensor, $p$ is the plastic multiplier, $\\sigma'_{ij}$ is the deviatoric part of the stress and $\\overline{\\sigma}$ is the von Mises equivalent stress (Lemaitre and Chaboche, 2002). Moreover, $T^{\\textrm{ref}}$ is a reference temperature (usually the temperature at the beginning of the analysis).\n", "\n", "In SMART+ the elastoplastic material constitutive law is implemented using a *return mapping algorithm*, with use of the *convex cutting plane* algorithm (Simo and Hughes, 1998). The updated stress is provided for 1D, plane stress, and generalized plane strain/3D analysis according to the forms of elastic isotropic materials.\n", - "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simmit* documentation.\n", + "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simcoon* documentation.\n", "\n", "As a start we should input the name of the UMAT as well as the list of parameters" ] diff --git a/Notebooks/Umats/Mechanical/Plasticity/Loops_iso/EPICP.ipynb b/Notebooks/Umats/Mechanical/Plasticity/Loops_iso/EPICP.ipynb index e492eb778..3b2b0abdf 100644 --- a/Notebooks/Umats/Mechanical/Plasticity/Loops_iso/EPICP.ipynb +++ b/Notebooks/Umats/Mechanical/Plasticity/Loops_iso/EPICP.ipynb @@ -24,7 +24,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import rc\n", - "from simcoon import simmit as sim\n", + "import simcoon as sim\n", "import os\n", "from IPython.display import HTML\n", "dir = os.path.dirname(os.path.realpath('__file__'))\n", @@ -56,7 +56,7 @@ "where ${\\varepsilon}^{\\textrm{p}}_{ij}$ is the plastic strain tensor, $p$ is the plastic multiplier, $\\sigma'_{ij}$ is the deviatoric part of the stress and $\\overline{\\sigma}$ is the von Mises equivalent stress (Lemaitre and Chaboche, 2002). Moreover, $T^{\\textrm{ref}}$ is a reference temperature (usually the temperature at the beginning of the analysis).\n", "\n", "In SMART+ the elastoplastic material constitutive law is implemented using a *return mapping algorithm*, with use of the *convex cutting plane* algorithm (Simo and Hughes, 1998). The updated stress is provided for 1D, plane stress, and generalized plane strain/3D analysis according to the forms of elastic isotropic materials.\n", - "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simmit* documentation.\n", + "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simcoon* documentation.\n", "\n", "As a start we should input the name of the UMAT as well as the list of parameters" ] diff --git a/Notebooks/Umats/Mechanical/Prony_N/Prony_N.ipynb b/Notebooks/Umats/Mechanical/Prony_N/Prony_N.ipynb index 6bfeefb3c..fea981d32 100644 --- a/Notebooks/Umats/Mechanical/Prony_N/Prony_N.ipynb +++ b/Notebooks/Umats/Mechanical/Prony_N/Prony_N.ipynb @@ -19,7 +19,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import rc\n", - "from simcoon import simmit as sim\n", + "import simcoon as sim\n", "import os\n", "from IPython.display import HTML\n", "dir = os.path.dirname(os.path.realpath('__file__'))\n", @@ -45,7 +45,7 @@ "7. The Viscoelastic shear viscosity of Zener branch $\\eta_s$\n", "\n", "In 'smartplus' the viscoelastic material constitutive law is implemented using a *fast scalar updating method*. The updated stress is provided for 1D, plane stress, and generalized plane strain/3D analysis according to the forms of elastic isotropic materials.\n", - "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simmit* documentation.\n", + "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simcoon* documentation.\n", "\n", "As a start we should input the name of the UMAT as well as the list of parameters" ] diff --git a/Notebooks/Umats/Mechanical/SMA_TR/SMA_TR.ipynb b/Notebooks/Umats/Mechanical/SMA_TR/SMA_TR.ipynb index 9835e30b9..da38208d8 100644 --- a/Notebooks/Umats/Mechanical/SMA_TR/SMA_TR.ipynb +++ b/Notebooks/Umats/Mechanical/SMA_TR/SMA_TR.ipynb @@ -19,7 +19,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import rc\n", - "from simcoon import simmit as sim\n", + "import simcoon as sim\n", "import os\n", "from IPython.display import HTML\n", "dir = os.path.dirname(os.path.realpath('__file__'))\n", @@ -65,7 +65,7 @@ "27. props[26]: alpha_lambda : penalty function power law parameter\n", "\n", "In SMART+ the SMA material constitutive law is implemented using a *return mapping algorithm*, with use of the *convex cutting plane* algorithm (Simo and Hughes, 1998). The updated stress is provided for 1D, plane stress, and generalized plane strain/3D analysis according to the forms of elastic isotropic materials.\n", - "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simmit* documentation.\n", + "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simcoon* documentation.\n", "\n", "As a start we should input the name of the UMAT as well as the list of parameters" ] diff --git a/Notebooks/Umats/Mechanical/Zener/Zener.ipynb b/Notebooks/Umats/Mechanical/Zener/Zener.ipynb index 3ffb6261f..b6fd9ccbd 100644 --- a/Notebooks/Umats/Mechanical/Zener/Zener.ipynb +++ b/Notebooks/Umats/Mechanical/Zener/Zener.ipynb @@ -21,7 +21,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import rc\n", - "from simcoon import simmit as sim\n", + "import simcoon as sim\n", "import os\n", "from IPython.display import HTML\n", "dir = os.path.dirname(os.path.realpath('__file__'))\n", @@ -46,7 +46,7 @@ "7. The Viscoelastic shear viscosity of Zener branch $\\eta_s$\n", "\n", "In 'smartplus' the viscoelastic material constitutive law is implemented using a *fast scalar updating method*. The updated stress is provided for 1D, plane stress, and generalized plane strain/3D analysis according to the forms of elastic isotropic materials.\n", - "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simmit* documentation.\n", + "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simcoon* documentation.\n", "\n", "As a start we should input the name of the UMAT as well as the list of parameters" ] diff --git a/Notebooks/Umats/Mechanical/Zener_N/Zener_N.ipynb b/Notebooks/Umats/Mechanical/Zener_N/Zener_N.ipynb index d05f9db5e..6e043489e 100644 --- a/Notebooks/Umats/Mechanical/Zener_N/Zener_N.ipynb +++ b/Notebooks/Umats/Mechanical/Zener_N/Zener_N.ipynb @@ -21,7 +21,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import rc\n", - "from simcoon import simmit as sim\n", + "import simcoon as sim\n", "import os\n", "from IPython.display import HTML\n", "dir = os.path.dirname(os.path.realpath('__file__'))\n", @@ -47,7 +47,7 @@ "7. The Viscoelastic shear viscosity of Zener branch $\\eta_s$\n", "\n", "In 'smartplus' the viscoelastic material constitutive law is implemented using a *fast scalar updating method*. The updated stress is provided for 1D, plane stress, and generalized plane strain/3D analysis according to the forms of elastic isotropic materials.\n", - "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simmit* documentation.\n", + "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simcoon* documentation.\n", "\n", "As a start we should input the name of the UMAT as well as the list of parameters" ] diff --git a/Notebooks/Umats/Thermomechanical/Elasticity/ELISO.ipynb b/Notebooks/Umats/Thermomechanical/Elasticity/ELISO.ipynb index 7df7a662f..8f85f0a94 100644 --- a/Notebooks/Umats/Thermomechanical/Elasticity/ELISO.ipynb +++ b/Notebooks/Umats/Thermomechanical/Elasticity/ELISO.ipynb @@ -21,7 +21,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import rc\n", - "from simcoon import simmit as sim\n", + "import simcoon as sim\n", "import os\n", "from IPython.display import HTML\n", "dir = os.path.dirname(os.path.realpath('__file__'))\n", diff --git a/Notebooks/Umats/Thermomechanical/Elasticity/ELITR.ipynb b/Notebooks/Umats/Thermomechanical/Elasticity/ELITR.ipynb index 4910d13b9..19f58856b 100644 --- a/Notebooks/Umats/Thermomechanical/Elasticity/ELITR.ipynb +++ b/Notebooks/Umats/Thermomechanical/Elasticity/ELITR.ipynb @@ -20,7 +20,7 @@ "import pylab\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", - "from simmit import smartplus as sim\n", + "import simcoon as sim\n", "import math\n", "import os\n", "dir = os.path.dirname(os.path.realpath('__file__'))" diff --git a/Notebooks/Umats/Thermomechanical/Elasticity/ELORT.ipynb b/Notebooks/Umats/Thermomechanical/Elasticity/ELORT.ipynb index 4e94053fe..f3643bd15 100644 --- a/Notebooks/Umats/Thermomechanical/Elasticity/ELORT.ipynb +++ b/Notebooks/Umats/Thermomechanical/Elasticity/ELORT.ipynb @@ -20,7 +20,7 @@ "import pylab\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", - "from simmit import smartplus as sim\n", + "import simcoon as sim\n", "import math\n", "import os\n", "dir = os.path.dirname(os.path.realpath('__file__'))" diff --git a/Notebooks/Umats/Thermomechanical/Plasticity/Loop_kin/EPKCP.ipynb b/Notebooks/Umats/Thermomechanical/Plasticity/Loop_kin/EPKCP.ipynb index e68c1627d..b92ae4302 100644 --- a/Notebooks/Umats/Thermomechanical/Plasticity/Loop_kin/EPKCP.ipynb +++ b/Notebooks/Umats/Thermomechanical/Plasticity/Loop_kin/EPKCP.ipynb @@ -21,7 +21,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import rc\n", - "from simcoon import simmit as sim\n", + "import simcoon as sim\n", "import os\n", "from IPython.display import HTML\n", "dir = os.path.dirname(os.path.realpath('__file__'))\n", @@ -54,7 +54,7 @@ "where ${\\varepsilon}^{\\textrm{p}}_{ij}$ is the plastic strain tensor, $p$ is the plastic multiplier, $\\sigma'_{ij}$ is the deviatoric part of the stress and $\\overline{\\sigma}$ is the von Mises equivalent stress (Lemaitre and Chaboche, 2002). Moreover, $T^{\\textrm{ref}}$ is a reference temperature (usually the temperature at the beginning of the analysis).\n", "\n", "In SMART+ the elastoplastic material constitutive law is implemented using a *return mapping algorithm*, with use of the *convex cutting plane* algorithm (Simo and Hughes, 1998). The updated stress is provided for 1D, plane stress, and generalized plane strain/3D analysis according to the forms of elastic isotropic materials.\n", - "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simmit* documentation.\n", + "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simcoon* documentation.\n", "\n", "As a start we should input the name of the UMAT as well as the list of parameters" ] diff --git a/Notebooks/Umats/Thermomechanical/Plasticity/Loops_iso/EPICP.ipynb b/Notebooks/Umats/Thermomechanical/Plasticity/Loops_iso/EPICP.ipynb index cfaf8596f..c5ef31b2a 100644 --- a/Notebooks/Umats/Thermomechanical/Plasticity/Loops_iso/EPICP.ipynb +++ b/Notebooks/Umats/Thermomechanical/Plasticity/Loops_iso/EPICP.ipynb @@ -21,7 +21,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import rc\n", - "from simmit import smartplus as sim\n", + "import simcoon as sim\n", "import os\n", "from IPython.display import HTML\n", "dir = os.path.dirname(os.path.realpath('__file__'))\n", @@ -53,7 +53,7 @@ "where ${\\varepsilon}^{\\textrm{p}}_{ij}$ is the plastic strain tensor, $p$ is the plastic multiplier, $\\sigma'_{ij}$ is the deviatoric part of the stress and $\\overline{\\sigma}$ is the von Mises equivalent stress (Lemaitre and Chaboche, 2002). Moreover, $T^{\\textrm{ref}}$ is a reference temperature (usually the temperature at the beginning of the analysis).\n", "\n", "In SMART+ the elastoplastic material constitutive law is implemented using a *return mapping algorithm*, with use of the *convex cutting plane* algorithm (Simo and Hughes, 1998). The updated stress is provided for 1D, plane stress, and generalized plane strain/3D analysis according to the forms of elastic isotropic materials.\n", - "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simmit* documentation.\n", + "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simcoon* documentation.\n", "\n", "As a start we should input the name of the UMAT as well as the list of parameters" ] diff --git a/Notebooks/Umats/Thermomechanical/SMA_T/SMA_T.ipynb b/Notebooks/Umats/Thermomechanical/SMA_T/SMA_T.ipynb index 3e0f595c9..b3e535aa6 100644 --- a/Notebooks/Umats/Thermomechanical/SMA_T/SMA_T.ipynb +++ b/Notebooks/Umats/Thermomechanical/SMA_T/SMA_T.ipynb @@ -19,7 +19,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import rc\n", - "from simmit import smartplus as sim\n", + "import simcoon as sim\n", "import os\n", "from IPython.display import HTML\n", "dir = os.path.dirname(os.path.realpath('__file__'))\n", @@ -65,7 +65,7 @@ "27. props[26]: alpha_lambda : penalty function power law parameter\n", "\n", "In SMART+ the SMA material constitutive law is implemented using a *return mapping algorithm*, with use of the *convex cutting plane* algorithm (Simo and Hughes, 1998). The updated stress is provided for 1D, plane stress, and generalized plane strain/3D analysis according to the forms of elastic isotropic materials.\n", - "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simmit* documentation.\n", + "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simcoon* documentation.\n", "\n", "As a start we should input the name of the UMAT as well as the list of parameters" ] diff --git a/Notebooks/Umats/Thermomechanical/Viscoelasticity/Zener/Zener.ipynb b/Notebooks/Umats/Thermomechanical/Viscoelasticity/Zener/Zener.ipynb index c768ff099..04424c6a3 100644 --- a/Notebooks/Umats/Thermomechanical/Viscoelasticity/Zener/Zener.ipynb +++ b/Notebooks/Umats/Thermomechanical/Viscoelasticity/Zener/Zener.ipynb @@ -21,7 +21,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import rc\n", - "from simmit import smartplus as sim\n", + "import simcoon as sim\n", "import os\n", "from IPython.display import HTML\n", "dir = os.path.dirname(os.path.realpath('__file__'))\n", @@ -49,7 +49,7 @@ "9. The Viscoelastic shear viscosity of Zener branch $\\eta_s$\n", "\n", "In 'smartplus' the viscoelastic material constitutive law is implemented using a *fast scalar updating method*. The updated stress is provided for 1D, plane stress, and generalized plane strain/3D analysis according to the forms of elastic isotropic materials.\n", - "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simmit* documentation.\n", + "The updated work, and internal heat production $r$ are determined with the algorithm presented in the *simcoon* documentation.\n", "\n", "As a start we should input the name of the UMAT as well as the list of parameters" ] diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 52505d8b6..32bdd4316 100755 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -36,7 +36,6 @@ requirements: - numpy >=2.0 - libblas - liblapack - - boost >=1.84 run: - python - numpy >=2.0 @@ -47,10 +46,9 @@ requirements: - mkl # [x86] - blas * openblas # [not (osx and arm64) and not x86] - lapack * openblas # [not (osx and arm64) and not x86] - - boost >=1.84 - armadillo >=12.6 # [not win] test: imports: - simcoon - - simcoon.simmit + - simcoon._core diff --git a/docs/continuum_mechanics/functions/doc_constitutive.rst b/docs/continuum_mechanics/functions/doc_constitutive.rst index e9644bb4b..a1310856e 100644 --- a/docs/continuum_mechanics/functions/doc_constitutive.rst +++ b/docs/continuum_mechanics/functions/doc_constitutive.rst @@ -1,20 +1,20 @@ The Constitutive Library ======================== -.. autofunction:: simcoon.simmit.Ireal -.. autofunction:: simcoon.simmit.Ivol -.. autofunction:: simcoon.simmit.Idev -.. autofunction:: simcoon.simmit.Ireal2 -.. autofunction:: simcoon.simmit.Idev2 -.. autofunction:: simcoon.simmit.Ith -.. autofunction:: simcoon.simmit.Ir2 -.. autofunction:: simcoon.simmit.Ir05 -.. autofunction:: simcoon.simmit.L_iso -.. autofunction:: simcoon.simmit.M_iso -.. autofunction:: simcoon.simmit.L_cubic -.. autofunction:: simcoon.simmit.M_cubic -.. autofunction:: simcoon.simmit.L_ortho -.. autofunction:: simcoon.simmit.M_ortho -.. autofunction:: simcoon.simmit.L_isotrans -.. autofunction:: simcoon.simmit.M_isotrans -.. autofunction:: simcoon.simmit.H_iso +.. autofunction:: simcoon.Ireal +.. autofunction:: simcoon.Ivol +.. autofunction:: simcoon.Idev +.. autofunction:: simcoon.Ireal2 +.. autofunction:: simcoon.Idev2 +.. autofunction:: simcoon.Ith +.. autofunction:: simcoon.Ir2 +.. autofunction:: simcoon.Ir05 +.. autofunction:: simcoon.L_iso +.. autofunction:: simcoon.M_iso +.. autofunction:: simcoon.L_cubic +.. autofunction:: simcoon.M_cubic +.. autofunction:: simcoon.L_ortho +.. autofunction:: simcoon.M_ortho +.. autofunction:: simcoon.L_isotrans +.. autofunction:: simcoon.M_isotrans +.. autofunction:: simcoon.H_iso diff --git a/docs/continuum_mechanics/functions/doc_contimech.rst b/docs/continuum_mechanics/functions/doc_contimech.rst index 3cf102c4e..6f1227137 100644 --- a/docs/continuum_mechanics/functions/doc_contimech.rst +++ b/docs/continuum_mechanics/functions/doc_contimech.rst @@ -1,27 +1,27 @@ The Contimech Library ===================== -.. autofunction:: simcoon.simmit.dev -.. autofunction:: simcoon.simmit.sph -.. autofunction:: simcoon.simmit.tr -.. autofunction:: simcoon.simmit.Mises_stress -.. autofunction:: simcoon.simmit.eta_stress -.. autofunction:: simcoon.simmit.Mises_strain -.. autofunction:: simcoon.simmit.eta_strain -.. autofunction:: simcoon.simmit.J2_stress -.. autofunction:: simcoon.simmit.J2_strain -.. autofunction:: simcoon.simmit.J3_stress -.. autofunction:: simcoon.simmit.J3_strain -.. autofunction:: simcoon.simmit.Macaulay_p -.. autofunction:: simcoon.simmit.Macaulay_n -.. autofunction:: simcoon.simmit.sign -.. autofunction:: simcoon.simmit.normal_ellipsoid -.. autofunction:: simcoon.simmit.curvature_ellipsoid -.. autofunction:: simcoon.simmit.sigma_int -.. autofunction:: simcoon.simmit.p_ikjl -.. autofunction:: simcoon.simmit.auto_sym_dyadic -.. autofunction:: simcoon.simmit.sym_dyadic -.. autofunction:: simcoon.simmit.auto_dyadic -.. autofunction:: simcoon.simmit.dyadic_4vectors_sym -.. autofunction:: simcoon.simmit.auto_sym_dyadic_operator -.. autofunction:: simcoon.simmit.sym_dyadic_operator \ No newline at end of file +.. autofunction:: simcoon.dev +.. autofunction:: simcoon.sph +.. autofunction:: simcoon.tr +.. autofunction:: simcoon.Mises_stress +.. autofunction:: simcoon.eta_stress +.. autofunction:: simcoon.Mises_strain +.. autofunction:: simcoon.eta_strain +.. autofunction:: simcoon.J2_stress +.. autofunction:: simcoon.J2_strain +.. autofunction:: simcoon.J3_stress +.. autofunction:: simcoon.J3_strain +.. autofunction:: simcoon.Macaulay_p +.. autofunction:: simcoon.Macaulay_n +.. autofunction:: simcoon.sign +.. autofunction:: simcoon.normal_ellipsoid +.. autofunction:: simcoon.curvature_ellipsoid +.. autofunction:: simcoon.sigma_int +.. autofunction:: simcoon.p_ikjl +.. autofunction:: simcoon.auto_sym_dyadic +.. autofunction:: simcoon.sym_dyadic +.. autofunction:: simcoon.auto_dyadic +.. autofunction:: simcoon.dyadic_4vectors_sym +.. autofunction:: simcoon.auto_sym_dyadic_operator +.. autofunction:: simcoon.sym_dyadic_operator \ No newline at end of file diff --git a/docs/continuum_mechanics/functions/doc_criteria.rst b/docs/continuum_mechanics/functions/doc_criteria.rst index 7a153973a..fe3732d14 100644 --- a/docs/continuum_mechanics/functions/doc_criteria.rst +++ b/docs/continuum_mechanics/functions/doc_criteria.rst @@ -1,18 +1,18 @@ The Criteria Library ==================== -.. autofunction:: simcoon.simmit.Drucker_stress -.. autofunction:: simcoon.simmit.dDrucker_stress -.. autofunction:: simcoon.simmit.Tresca_stress -.. autofunction:: simcoon.simmit.dTresca_stress -.. autofunction:: simcoon.simmit.P_Ani -.. autofunction:: simcoon.simmit.P_Hill -.. autofunction:: simcoon.simmit.P_DFA -.. autofunction:: simcoon.simmit.Hill_stress -.. autofunction:: simcoon.simmit.dHill_stress -.. autofunction:: simcoon.simmit.Ani_stress -.. autofunction:: simcoon.simmit.dAni_stress -.. autofunction:: simcoon.simmit.DFA_stress -.. autofunction:: simcoon.simmit.dDFA_stress -.. autofunction:: simcoon.simmit.Eq_stress -.. autofunction:: simcoon.simmit.dEq_stress \ No newline at end of file +.. autofunction:: simcoon.Drucker_stress +.. autofunction:: simcoon.dDrucker_stress +.. autofunction:: simcoon.Tresca_stress +.. autofunction:: simcoon.dTresca_stress +.. autofunction:: simcoon.P_Ani +.. autofunction:: simcoon.P_Hill +.. autofunction:: simcoon.P_DFA +.. autofunction:: simcoon.Hill_stress +.. autofunction:: simcoon.dHill_stress +.. autofunction:: simcoon.Ani_stress +.. autofunction:: simcoon.dAni_stress +.. autofunction:: simcoon.DFA_stress +.. autofunction:: simcoon.dDFA_stress +.. autofunction:: simcoon.Eq_stress +.. autofunction:: simcoon.dEq_stress \ No newline at end of file diff --git a/docs/continuum_mechanics/functions/doc_damage.rst b/docs/continuum_mechanics/functions/doc_damage.rst index 22de594f9..df8ede4e1 100644 --- a/docs/continuum_mechanics/functions/doc_damage.rst +++ b/docs/continuum_mechanics/functions/doc_damage.rst @@ -1,7 +1,7 @@ The Damage Library ==================== -.. autofunction:: simcoon.simmit.damage_weibull -.. autofunction:: simcoon.simmit.damage_kachanov -.. autofunction:: simcoon.simmit.damage_miner -.. autofunction:: simcoon.simmit.damage_manson +.. autofunction:: simcoon.damage_weibull +.. autofunction:: simcoon.damage_kachanov +.. autofunction:: simcoon.damage_miner +.. autofunction:: simcoon.damage_manson diff --git a/docs/continuum_mechanics/functions/doc_kinematics.rst b/docs/continuum_mechanics/functions/doc_kinematics.rst index 66497b0ed..c7f0f675e 100644 --- a/docs/continuum_mechanics/functions/doc_kinematics.rst +++ b/docs/continuum_mechanics/functions/doc_kinematics.rst @@ -1,21 +1,21 @@ The Kinematics Library ===================================== -.. autofunction:: simcoon.simmit.ER_to_F -.. autofunction:: simcoon.simmit.eR_to_F -.. autofunction:: simcoon.simmit.G_UdX -.. autofunction:: simcoon.simmit.G_Udx -.. autofunction:: simcoon.simmit.R_Cauchy_Green -.. autofunction:: simcoon.simmit.L_Cauchy_Green -.. autofunction:: simcoon.simmit.RU_decomposition -.. autofunction:: simcoon.simmit.VR_decomposition -.. autofunction:: simcoon.simmit.Inv_X -.. autofunction:: simcoon.simmit.Cauchy -.. autofunction:: simcoon.simmit.Green_Lagrange -.. autofunction:: simcoon.simmit.Euler_Almansi -.. autofunction:: simcoon.simmit.Log_strain -.. autofunction:: simcoon.simmit.finite_L -.. autofunction:: simcoon.simmit.finite_D -.. autofunction:: simcoon.simmit.finite_W -.. autofunction:: simcoon.simmit.finite_Omega -.. autofunction:: simcoon.simmit.finite_DQ +.. autofunction:: simcoon.ER_to_F +.. autofunction:: simcoon.eR_to_F +.. autofunction:: simcoon.G_UdX +.. autofunction:: simcoon.G_Udx +.. autofunction:: simcoon.R_Cauchy_Green +.. autofunction:: simcoon.L_Cauchy_Green +.. autofunction:: simcoon.RU_decomposition +.. autofunction:: simcoon.VR_decomposition +.. autofunction:: simcoon.Inv_X +.. autofunction:: simcoon.Cauchy +.. autofunction:: simcoon.Green_Lagrange +.. autofunction:: simcoon.Euler_Almansi +.. autofunction:: simcoon.Log_strain +.. autofunction:: simcoon.finite_L +.. autofunction:: simcoon.finite_D +.. autofunction:: simcoon.finite_W +.. autofunction:: simcoon.finite_Omega +.. autofunction:: simcoon.finite_DQ diff --git a/docs/continuum_mechanics/functions/doc_recovery_props.rst b/docs/continuum_mechanics/functions/doc_recovery_props.rst index fa86d7ee4..14d86142a 100644 --- a/docs/continuum_mechanics/functions/doc_recovery_props.rst +++ b/docs/continuum_mechanics/functions/doc_recovery_props.rst @@ -1,13 +1,13 @@ Recovery of Elastic Properties ================================ -.. autofunction:: simcoon.simmit.check_symetries -.. autofunction:: simcoon.simmit.L_iso_props -.. autofunction:: simcoon.simmit.M_iso_props -.. autofunction:: simcoon.simmit.L_isotrans_props -.. autofunction:: simcoon.simmit.M_isotrans_props -.. autofunction:: simcoon.simmit.L_cubic_props -.. autofunction:: simcoon.simmit.M_cubic_props -.. autofunction:: simcoon.simmit.L_ortho_props -.. autofunction:: simcoon.simmit.M_ortho_props -.. autofunction:: simcoon.simmit.M_aniso_props +.. autofunction:: simcoon.check_symetries +.. autofunction:: simcoon.L_iso_props +.. autofunction:: simcoon.M_iso_props +.. autofunction:: simcoon.L_isotrans_props +.. autofunction:: simcoon.M_isotrans_props +.. autofunction:: simcoon.L_cubic_props +.. autofunction:: simcoon.M_cubic_props +.. autofunction:: simcoon.L_ortho_props +.. autofunction:: simcoon.M_ortho_props +.. autofunction:: simcoon.M_aniso_props diff --git a/docs/continuum_mechanics/functions/doc_stress.rst b/docs/continuum_mechanics/functions/doc_stress.rst index 0d6fb0184..95269058b 100644 --- a/docs/continuum_mechanics/functions/doc_stress.rst +++ b/docs/continuum_mechanics/functions/doc_stress.rst @@ -1,4 +1,4 @@ Stress conversions ================== -.. autofunction:: simcoon.simmit.stress_convert +.. autofunction:: simcoon.stress_convert diff --git a/docs/continuum_mechanics/functions/doc_transfer.rst b/docs/continuum_mechanics/functions/doc_transfer.rst index d87093856..d8976041b 100644 --- a/docs/continuum_mechanics/functions/doc_transfer.rst +++ b/docs/continuum_mechanics/functions/doc_transfer.rst @@ -1,7 +1,7 @@ Transfer helpers (Voigt <-> matrix) =================================== -.. autofunction:: simcoon.simmit.v2t_strain -.. autofunction:: simcoon.simmit.t2v_strain -.. autofunction:: simcoon.simmit.v2t_stress -.. autofunction:: simcoon.simmit.t2v_stress +.. autofunction:: simcoon.v2t_strain +.. autofunction:: simcoon.t2v_strain +.. autofunction:: simcoon.v2t_stress +.. autofunction:: simcoon.t2v_stress diff --git a/docs/homogenization/doc_eshelby.rst b/docs/homogenization/doc_eshelby.rst index 12a864d85..f6b7bfe5b 100644 --- a/docs/homogenization/doc_eshelby.rst +++ b/docs/homogenization/doc_eshelby.rst @@ -1,10 +1,10 @@ The Eshelby Library ======================== -.. autofunction:: simcoon.simmit.Eshelby_sphere -.. autofunction:: simcoon.simmit.Eshelby_cylinder -.. autofunction:: simcoon.simmit.Eshelby_prolate -.. autofunction:: simcoon.simmit.Eshelby_oblate -.. autofunction:: simcoon.simmit.Eshelby_penny -.. autofunction:: simcoon.simmit.Eshelby -.. autofunction:: simcoon.simmit.T_II \ No newline at end of file +.. autofunction:: simcoon.Eshelby_sphere +.. autofunction:: simcoon.Eshelby_cylinder +.. autofunction:: simcoon.Eshelby_prolate +.. autofunction:: simcoon.Eshelby_oblate +.. autofunction:: simcoon.Eshelby_penny +.. autofunction:: simcoon.Eshelby +.. autofunction:: simcoon.T_II \ No newline at end of file diff --git a/docs/simulation/solver.rst b/docs/simulation/solver.rst index 3307202f9..4f3ce0dbb 100755 --- a/docs/simulation/solver.rst +++ b/docs/simulation/solver.rst @@ -8,12 +8,12 @@ Elastic tensile test Probably the first thing you would like to do with Simcoon is to simulate the mechanical response corresponding to a simple tension test, considering an elastic isotropic material. -We first import *simmit* (the Python simulation module of simcoon) and *numpy*: +We first import *simcoon* (the Python simulation module of simcoon) and *numpy*: .. code-block:: python import numpy as np - from simcoon import simmit as sim + import simcoon as sim Next we shall define the material constitutive law to be utilized and the associated material properties. We will pass them as a numpy array: diff --git a/docs_old/Python/Continuum_Mechanics/Functions/constitutive.rst b/docs_old/Python/Continuum_Mechanics/Functions/constitutive.rst index 499036665..2a6978e7d 100755 --- a/docs_old/Python/Continuum_Mechanics/Functions/constitutive.rst +++ b/docs_old/Python/Continuum_Mechanics/Functions/constitutive.rst @@ -1,11 +1,11 @@ The Constitutive Library ======================== -Import of the simmit module +Import simcoon .. code-block:: python - from simcoon import simmit as sim + import simcoon as sim .. function:: np.ndarray Ireal() diff --git a/docs_old/Python/Continuum_Mechanics/Functions/contimech.rst b/docs_old/Python/Continuum_Mechanics/Functions/contimech.rst index 7cbf1ffeb..51e96af5d 100755 --- a/docs_old/Python/Continuum_Mechanics/Functions/contimech.rst +++ b/docs_old/Python/Continuum_Mechanics/Functions/contimech.rst @@ -1,11 +1,11 @@ The Continuum Mechanics Library =============================== -Import of the simmit module +Import simcoon .. code-block:: python - from simcoon import simmit as sim + import simcoon as sim .. function:: float tr(np.ndarray v) diff --git a/examples/analysis/directional_stiffness.py b/examples/analysis/directional_stiffness.py index 6b735e14f..a54f63fdf 100644 --- a/examples/analysis/directional_stiffness.py +++ b/examples/analysis/directional_stiffness.py @@ -8,7 +8,7 @@ import numpy as np import matplotlib.pyplot as plt from matplotlib import cm, colors -from simcoon import simmit as sim +import simcoon as sim import os diff --git a/examples/analysis/eshelby_numerical_vs_analytical.py b/examples/analysis/eshelby_numerical_vs_analytical.py index 3483d517d..60a3b0044 100644 --- a/examples/analysis/eshelby_numerical_vs_analytical.py +++ b/examples/analysis/eshelby_numerical_vs_analytical.py @@ -6,7 +6,7 @@ """ import numpy as np -from simcoon import simmit as sim +import simcoon as sim import matplotlib.pyplot as plt ################################################################################### diff --git a/examples/analysis/objective_rates.py b/examples/analysis/objective_rates.py index e7a2a5b02..f4c6a1338 100644 --- a/examples/analysis/objective_rates.py +++ b/examples/analysis/objective_rates.py @@ -9,7 +9,7 @@ import numpy as np import matplotlib.pyplot as plt -from simcoon import simmit as sim +import simcoon as sim import os plt.rcParams["figure.figsize"] = (18, 10) # configure the figure output size diff --git a/examples/continuum_mechanics/constitutive_relations.py b/examples/continuum_mechanics/constitutive_relations.py index 1a90fe651..2c95330a5 100644 --- a/examples/continuum_mechanics/constitutive_relations.py +++ b/examples/continuum_mechanics/constitutive_relations.py @@ -12,7 +12,7 @@ import numpy as np import matplotlib.pyplot as plt -from simcoon import simmit as sim +import simcoon as sim ################################################################################### # L_iso diff --git a/examples/continuum_mechanics/rotation.py b/examples/continuum_mechanics/rotation.py index d54484633..44a4c16ba 100644 --- a/examples/continuum_mechanics/rotation.py +++ b/examples/continuum_mechanics/rotation.py @@ -6,7 +6,7 @@ import numpy as np import matplotlib.pyplot as plt from scipy.spatial.transform import Rotation as R -from simcoon import simmit as sim +import simcoon as sim import os @@ -27,7 +27,7 @@ # 1. Rotate a vector using a rotation matrix # # This example shows how to build a rotation matrix and rotate a vector. -# It uses :func:`simcoon.simmit.fillR_angle` and :func:`simcoon.simmit.rotate_vec_R`. +# It uses :func:`simcoon.fillR_angle` and :func:`simcoon.rotate_vec_R`. Rmat = sim.fillR_angle(angle, axis, active, copy) @@ -40,7 +40,7 @@ # 2. Rotate a vector using angle/axis # # This example shows how to rotate a vector using an angle and an axis directly. -# It uses :func:`simcoon.simmit.rotate_vec_angle`. +# It uses :func:`simcoon.rotate_vec_angle`. v_rot2 = sim.rotate_vec_angle(v, angle, axis, copy) @@ -51,7 +51,7 @@ # 3. Rotate a matrix using a rotation matrix # # This example shows how to rotate a matrix using a rotation matrix. -# It uses :func:`simcoon.simmit.rotate_mat_R`. +# It uses :func:`simcoon.rotate_mat_R`. m_rot1 = sim.rotate_mat_R(m, Rmat, copy) @@ -62,7 +62,7 @@ # 4. Rotate a matrix using angle/axis # # This example shows how to rotate a matrix using an angle and an axis directly. -# It uses :func:`simcoon.simmit.rotate_mat_angle`. +# It uses :func:`simcoon.rotate_mat_angle`. m_rot2 = sim.rotate_mat_angle(m, angle, axis, copy) @@ -73,7 +73,7 @@ # 5. Build a rotation matrix from Euler angles # # This example shows how to create a rotation matrix from Euler angles. -# It uses :func:`simcoon.simmit.fillR_euler`. +# It uses :func:`simcoon.fillR_euler`. psi, theta, phi = np.pi / 6, np.pi / 4, np.pi / 3 R_euler = sim.fillR_euler(psi, theta, phi, active, "zxz", copy) @@ -90,7 +90,7 @@ # %% # 6. Rotate a stress vector (single and batch) # -# This example uses :func:`simcoon.simmit.rotate_stress_angle`. +# This example uses :func:`simcoon.rotate_stress_angle`. stress = np.array([1, 2, 3, 4, 5, 6], dtype=float) stress_batch = np.stack([stress, stress * 2], axis=1) @@ -103,7 +103,7 @@ # %% # 7. Rotate a strain vector (single and batch) # -# This example uses :func:`simcoon.simmit.rotate_strain_angle`. +# This example uses :func:`simcoon.rotate_strain_angle`. strain = np.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], dtype=float) strain_batch = np.stack([strain, strain * 2], axis=1) @@ -116,8 +116,8 @@ # %% # 8. Rotate a stiffness matrix (L) # -# This example uses both :func:`simcoon.simmit.rotateL_angle` and -# :func:`simcoon.simmit.rotateL_R`. +# This example uses both :func:`simcoon.rotateL_angle` and +# :func:`simcoon.rotateL_R`. L6 = np.eye(6) rotL1 = sim.rotateL_angle(L6, angle, axis, active, copy) @@ -129,8 +129,8 @@ # %% # 9. Rotate a compliance matrix (M) # -# This example uses both :func:`simcoon.simmit.rotateM_angle` and -# :func:`simcoon.simmit.rotateM_R`. +# This example uses both :func:`simcoon.rotateM_angle` and +# :func:`simcoon.rotateM_R`. M6 = np.eye(6) rotM1 = sim.rotateM_angle(M6, angle, axis, active, copy) @@ -142,8 +142,8 @@ # %% # 10. Rotate a strain concentration matrix (A) # -# This example uses both :func:`simcoon.simmit.rotateA_angle` and -# :func:`simcoon.simmit.rotateA_R`. +# This example uses both :func:`simcoon.rotateA_angle` and +# :func:`simcoon.rotateA_R`. A6 = np.eye(6) rotA1 = sim.rotateA_angle(A6, angle, axis, active, copy) @@ -155,8 +155,8 @@ # %% # 11. Rotate a stress concentration matrix (B) # -# This example uses both :func:`simcoon.simmit.rotateB_angle` and -# :func:`simcoon.simmit.rotateB_R`. +# This example uses both :func:`simcoon.rotateB_angle` and +# :func:`simcoon.rotateB_R`. B6 = np.eye(6) rotB1 = sim.rotateB_angle(B6, angle, axis, active, copy) diff --git a/examples/continuum_mechanics/stress_measures.py b/examples/continuum_mechanics/stress_measures.py index 47238b0e4..fc237bb94 100644 --- a/examples/continuum_mechanics/stress_measures.py +++ b/examples/continuum_mechanics/stress_measures.py @@ -2,10 +2,10 @@ ================================================ This example is an *hands-on* demo of the stress “transfer” helpers in -:mod:`simcoon.simmit` to switch between different stress measures. +:mod:`simcoon` to switch between different stress measures. We compute the Cauchy stress for a compressible Neo-Hookean material, then use -:func:`simcoon.simmit.stress_convert` to obtain other stress measures: +:func:`simcoon.stress_convert` to obtain other stress measures: * First Piola-Kirchhoff stress (PKI) * Second Piola-Kirchhoff stress (PKII) @@ -28,7 +28,7 @@ from __future__ import annotations import numpy as np -from simcoon import simmit as sim +import simcoon as sim import matplotlib.pyplot as plt from scipy.optimize import fsolve diff --git a/examples/continuum_mechanics/stress_transfer_helpers.py b/examples/continuum_mechanics/stress_transfer_helpers.py index 0dc503183..07e7dd168 100644 --- a/examples/continuum_mechanics/stress_transfer_helpers.py +++ b/examples/continuum_mechanics/stress_transfer_helpers.py @@ -3,11 +3,11 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This example demonstrates the stress transfer helpers exposed in -:mod:`simcoon.simmit`. +:mod:`simcoon`. The goal is to show (in a single place) how to use: -* :func:`simcoon.simmit.stress_convert` for stress-measure conversions +* :func:`simcoon.stress_convert` for stress-measure conversions * the batch conventions expected by the Python bindings **Batch conventions** @@ -34,7 +34,7 @@ from __future__ import annotations import numpy as np -from simcoon import simmit as sim +import simcoon as sim ################################################################################### # Helper: pretty printing diff --git a/examples/continuum_mechanics/yield_criteria.py b/examples/continuum_mechanics/yield_criteria.py index b8bf41b40..175293b7c 100644 --- a/examples/continuum_mechanics/yield_criteria.py +++ b/examples/continuum_mechanics/yield_criteria.py @@ -7,7 +7,7 @@ """ import numpy as np -from simcoon import simmit as sim +import simcoon as sim import matplotlib.pyplot as plt ################################################################################### diff --git a/examples/heterogeneous/effective_props.py b/examples/heterogeneous/effective_props.py index a2dd6a1bf..016e2f3d4 100644 --- a/examples/heterogeneous/effective_props.py +++ b/examples/heterogeneous/effective_props.py @@ -8,7 +8,7 @@ import numpy as np import matplotlib.pyplot as plt -from simcoon import simmit as sim +import simcoon as sim from simcoon import parameter as par import os diff --git a/examples/heterogeneous/eshelby_tensors.py b/examples/heterogeneous/eshelby_tensors.py index 75c51d2a8..360889de6 100644 --- a/examples/heterogeneous/eshelby_tensors.py +++ b/examples/heterogeneous/eshelby_tensors.py @@ -5,7 +5,7 @@ """ import numpy as np -from simcoon import simmit as sim +import simcoon as sim import matplotlib.pyplot as plt ################################################################################### diff --git a/examples/heterogeneous/homogenization.py b/examples/heterogeneous/homogenization.py index 2bd897378..a3d1ce547 100644 --- a/examples/heterogeneous/homogenization.py +++ b/examples/heterogeneous/homogenization.py @@ -6,7 +6,7 @@ """ import numpy as np -from simcoon import simmit as sim +import simcoon as sim import matplotlib.pyplot as plt import os diff --git a/examples/hyperelasticity/HYPER_numerical.py b/examples/hyperelasticity/HYPER_numerical.py index 5b4c31b09..2ab8d3a4f 100644 --- a/examples/hyperelasticity/HYPER_numerical.py +++ b/examples/hyperelasticity/HYPER_numerical.py @@ -15,7 +15,7 @@ from math import fabs import numpy as np import pandas as pd -from simcoon import simmit as sim +import simcoon as sim import matplotlib.pyplot as plt import os from typing import NamedTuple, List, Tuple @@ -501,7 +501,7 @@ def run_case( # Inputs: # `parameters_by_case['UT'|'PS'|'ET']['NEOHC']`: model parameters [mu, kappa] # `comparison/Treloar.txt`: experimental Treloar data (lambda, P_MPa) -# Simcoon Python bindings (`simcoon.simmit`) for stress helpers +# Simcoon Python bindings (`simcoon`) for stress helpers # # Outputs: # A figure with 3 subplots (UT, PS, ET) showing PK1_11 vs lambda. @@ -573,7 +573,7 @@ def run_case( # Inputs: # `parameters_by_case['UT'|'PS'|'ET']['MOORI']`: model parameters [C10, C01, kappa] # `comparison/Treloar.txt`: experimental Treloar data (lambda, P_MPa) -# Simcoon Python bindings (`simcoon.simmit`) for stress helpers +# Simcoon Python bindings (`simcoon`) for stress helpers # # Outputs: # A figure with 3 subplots (UT, PS, ET) showing PK1_11 vs lambda. @@ -637,7 +637,7 @@ def run_case( # `parameters_by_case[case]['SWANS']`: flattened series parameters # [N_series, kappa, A1, B1, alpha1, beta1, ...] # `comparison/Treloar.txt`: experimental Treloar data (lambda, P_MPa) -# Simcoon Python bindings (`simcoon.simmit`) for stress helpers +# Simcoon Python bindings (`simcoon`) for stress helpers # # Outputs: # A figure with 3 subplots (UT, PS, ET) showing PK1_11 vs lambda. diff --git a/examples/hyperelasticity/HYPER_umat.py b/examples/hyperelasticity/HYPER_umat.py index b6082219a..db87297cc 100644 --- a/examples/hyperelasticity/HYPER_umat.py +++ b/examples/hyperelasticity/HYPER_umat.py @@ -14,7 +14,7 @@ import numpy as np import pandas as pd -from simcoon import simmit as sim +import simcoon as sim import matplotlib.pyplot as plt import os from typing import NamedTuple, List, Tuple diff --git a/examples/umats/ELISO.py b/examples/umats/ELISO.py index 435ff59f2..9f7f49336 100644 --- a/examples/umats/ELISO.py +++ b/examples/umats/ELISO.py @@ -4,7 +4,7 @@ """ import numpy as np -from simcoon import simmit as sim +import simcoon as sim import matplotlib.pyplot as plt import os diff --git a/examples/umats/ELIST.py b/examples/umats/ELIST.py index 6b45ff8fb..52957e5bf 100644 --- a/examples/umats/ELIST.py +++ b/examples/umats/ELIST.py @@ -4,7 +4,7 @@ """ import numpy as np -from simcoon import simmit as sim +import simcoon as sim import matplotlib.pyplot as plt import os diff --git a/examples/umats/ELORT.py b/examples/umats/ELORT.py index e085261b0..c888a91dd 100644 --- a/examples/umats/ELORT.py +++ b/examples/umats/ELORT.py @@ -4,7 +4,7 @@ """ import numpy as np -from simcoon import simmit as sim +import simcoon as sim import matplotlib.pyplot as plt import os diff --git a/examples/umats/EPCHA.py b/examples/umats/EPCHA.py index 9c3c36d38..c5a535d35 100644 --- a/examples/umats/EPCHA.py +++ b/examples/umats/EPCHA.py @@ -5,7 +5,7 @@ import numpy as np import matplotlib.pyplot as plt -from simcoon import simmit as sim +import simcoon as sim import os plt.rcParams["figure.figsize"] = (18, 10) diff --git a/examples/umats/EPICP.py b/examples/umats/EPICP.py index b1c3022a7..67fe2c451 100644 --- a/examples/umats/EPICP.py +++ b/examples/umats/EPICP.py @@ -6,7 +6,7 @@ import pylab import numpy as np import matplotlib.pyplot as plt -from simcoon import simmit as sim +import simcoon as sim import os plt.rcParams["figure.figsize"] = (18, 10) # configure the figure output size @@ -46,7 +46,7 @@ # with use of the *convex cutting plane* algorithm (Simo and Hughes, 1998). The updated stress is provided for 1D, # plane stress, and generalized plane strain/3D analysis according to the forms of elastic isotropic materials. # -# The updated work, and internal heat production :math:`r` are determined with the algorithm presented in the *simmit* documentation. +# The updated work, and internal heat production :math:`r` are determined with the algorithm presented in the *simcoon* documentation. # # As a start we should input the name of the UMAT as well as the list of parameters @@ -94,10 +94,10 @@ # -------------------------------------- # This is it, now we just need to plot the results. # In the left, we plot the stress vs strain curve, and in the right the different work terms vs time: -# - :meth:`Wm ` the mechanical work, -# - :meth:`Wm_r ` the recoverable mechanical work, -# - :meth:`Wm_ir ` the irrecoverable mechanical work, -# - :meth:`Wm_d ` the dissipated mechanical work. +# - :meth:`Wm ` the mechanical work, +# - :meth:`Wm_r ` the recoverable mechanical work, +# - :meth:`Wm_ir ` the irrecoverable mechanical work, +# - :meth:`Wm_d ` the dissipated mechanical work. # ################################################################################### # prepare the load diff --git a/examples/umats/EPKCP.py b/examples/umats/EPKCP.py index 6c31db1cf..abbe5f172 100644 --- a/examples/umats/EPKCP.py +++ b/examples/umats/EPKCP.py @@ -5,7 +5,7 @@ import numpy as np import matplotlib.pyplot as plt -from simcoon import simmit as sim +import simcoon as sim import os plt.rcParams["figure.figsize"] = (18, 10) diff --git a/external/readme.txt b/external/readme.txt index 899047c66..da1666bb3 100644 --- a/external/readme.txt +++ b/external/readme.txt @@ -1,10 +1,10 @@ -1. Compile the plugin in /scratch/source/boost_plugin/external +1. Compile the plugin in the external directory clang++ -w -c -std=c++14 -fPIC my_plugin_sum.cpp clang++ -w -std=c++14 -shared my_plugin_sum.o -o my_plugin_sum -lsimcoon -larmadillo -2. Compile the software test in /scratch/source/boost_plugin -clang++ -w -std=c++14 -o test test.cpp -lsimcoon -larmadillo -lboost_system -lboost_filesystem +2. Compile the software test +clang++ -w -std=c++14 -o test test.cpp -lsimcoon -larmadillo For the simcoon plugin diff --git a/install_conda.md b/install_conda.md index 2656f1417..cd3ed3ced 100755 --- a/install_conda.md +++ b/install_conda.md @@ -11,7 +11,6 @@ conda create --name scientific #Install packages conda install -c conda-forge armadillo -conda install -c conda-forge boost conda install -c conda-forge numpy @@ -46,7 +45,7 @@ make test To finally it, it is best to copy the additional simcoon include folders (arma2numpy and python_wrappers) files that are in the simcoon-python-builder/include folder in the /path/to/anaconda3/envs/scientific/include, and the arma2numpy library (libarma2numpy.so) in the /path/to/anaconda3/envs/scientific/lib folder manually. The last library should be situated in the simcoon-python-builder/build/lib folder (or /build/lib/Relase, or /build/lib/Debug) -Finally you should copy the 'simmit.so' file situated in the simcoon-python-builder/build/lib folder (or /build/lib/Relase, or /build/lib/Debug) in the folder 'python-setup/simcoon' +Finally you should copy the '_core.so' file situated in the simcoon-python-builder/build/lib folder (or /build/lib/Relase, or /build/lib/Debug) in the folder 'python-setup/simcoon' Go to he folder 'python-setup/simcoon' and finally run: 'python setup.py install' diff --git a/python-setup/simcoon/__init__.py b/python-setup/simcoon/__init__.py index 4c062f908..266fd2118 100755 --- a/python-setup/simcoon/__init__.py +++ b/python-setup/simcoon/__init__.py @@ -1,2 +1,5 @@ -from simcoon.simmit import * -from simcoon.__version__ import __version__ \ No newline at end of file +from simcoon._core import * +from simcoon.__version__ import __version__ + +# Backward compatibility alias - simmit was the legacy module name +from simcoon import _core as simmit diff --git a/python-setup/simcoon/solver.py.py b/python-setup/simcoon/solver.py similarity index 100% rename from python-setup/simcoon/solver.py.py rename to python-setup/simcoon/solver.py diff --git a/simcoon-python-builder/CMakeLists.txt b/simcoon-python-builder/CMakeLists.txt index 78302a69a..168ffa22b 100755 --- a/simcoon-python-builder/CMakeLists.txt +++ b/simcoon-python-builder/CMakeLists.txt @@ -2,7 +2,7 @@ # This is called from the parent CMakeLists.txt when building Python bindings # # Two modes: -# 1. SKBUILD (pip install): Bundle libsimcoon with simmit in wheel, RPATH=$ORIGIN +# 1. SKBUILD (pip install): Bundle libsimcoon with _core in wheel, RPATH=$ORIGIN # 2. CONDA_BUILD (conda-build): Link to system libsimcoon, install to site-packages if(DEFINED SKBUILD) @@ -16,11 +16,11 @@ endif() # All dependencies (Python, pybind11, carma, Armadillo, simcoon) are already found by parent ################################################################################ -# SIMCOON PYBIND11 MODULE (simmit) +# SIMCOON PYBIND11 MODULE (_core) -pybind11_add_module(simmit +pybind11_add_module(_core # Main wrapper - src/python_wrappers/boostpython_smartplus_wrappers.cpp + src/python_wrappers/python_module.cpp # Continuum Mechanics src/python_wrappers/Libraries/Continuum_mechanics/constitutive.cpp @@ -61,25 +61,25 @@ pybind11_add_module(simmit if(CONDA_BUILD) # Conda: link to system libsimcoon in $PREFIX/lib if(APPLE) - set_target_properties(simmit PROPERTIES + set_target_properties(_core PROPERTIES INSTALL_RPATH "@loader_path/../../../" BUILD_WITH_INSTALL_RPATH ON ) elseif(UNIX) - set_target_properties(simmit PROPERTIES + set_target_properties(_core PROPERTIES INSTALL_RPATH "$ORIGIN/../../../" BUILD_WITH_INSTALL_RPATH ON ) endif() else() - # Wheel: libsimcoon is in same directory as simmit + # Wheel: libsimcoon is in same directory as _core if(APPLE) - set_target_properties(simmit PROPERTIES + set_target_properties(_core PROPERTIES INSTALL_RPATH "@loader_path" BUILD_WITH_INSTALL_RPATH ON ) elseif(UNIX) - set_target_properties(simmit PROPERTIES + set_target_properties(_core PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_WITH_INSTALL_RPATH ON ) @@ -88,19 +88,19 @@ endif() # Set output file extension if(MSVC) - set_target_properties(simmit PROPERTIES PREFIX "" SUFFIX ".pyd") + set_target_properties(_core PROPERTIES PREFIX "" SUFFIX ".pyd") else() - set_target_properties(simmit PROPERTIES PREFIX "" SUFFIX ".so") + set_target_properties(_core PROPERTIES PREFIX "" SUFFIX ".so") endif() # Disable precompiled headers for this target (causes issues with carma includes) -set_target_properties(simmit PROPERTIES DISABLE_PRECOMPILE_HEADERS ON) +set_target_properties(_core PROPERTIES DISABLE_PRECOMPILE_HEADERS ON) # Add include directories for Python wrapper headers -target_include_directories(simmit PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) +target_include_directories(_core PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) # Link dependencies (simcoon provides Armadillo transitively) -target_link_libraries(simmit PRIVATE carma::carma Python3::Module simcoon) +target_link_libraries(_core PRIVATE carma::carma Python3::Module simcoon) ################################################################################ # INSTALL @@ -117,8 +117,8 @@ if(CONDA_BUILD) file(TO_CMAKE_PATH "${PYTHON_SITE_PACKAGES_RAW}" PYTHON_SITE_PACKAGES) message(STATUS "Python site-packages: ${PYTHON_SITE_PACKAGES}") - # Install simmit.so to site-packages/simcoon/ - install(TARGETS simmit + # Install _core.so to site-packages/simcoon/ + install(TARGETS _core LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}/simcoon RUNTIME DESTINATION ${PYTHON_SITE_PACKAGES}/simcoon) @@ -133,7 +133,7 @@ else() # Wheel: scikit-build-core handles the wheel packaging # Install Python extension module to wheel - install(TARGETS simmit + install(TARGETS _core DESTINATION . COMPONENT python) diff --git a/simcoon-python-builder/cmake/README.txt b/simcoon-python-builder/cmake/README.txt index 806d9fa59..535191316 100755 --- a/simcoon-python-builder/cmake/README.txt +++ b/simcoon-python-builder/cmake/README.txt @@ -3,7 +3,4 @@ folder came from the numexpr project at http://code.google.com/p/numexpr. The numexpr project was also a valuable resource in making many of the -cmake constructs used in the cmake lists files written for -Boost.NumPy. The boost-python-examples project at -https://github.com/TNG/boost-python-examples was another helpful -resource for understanding how to use cmake with boost.python. +cmake constructs used in the cmake lists files. diff --git a/simcoon-python-builder/include/simcoon/docs/Libraries/Continuum_mechanics/doc_hyperelastic.hpp b/simcoon-python-builder/include/simcoon/docs/Libraries/Continuum_mechanics/doc_hyperelastic.hpp index 65890519a..3bfcc6879 100644 --- a/simcoon-python-builder/include/simcoon/docs/Libraries/Continuum_mechanics/doc_hyperelastic.hpp +++ b/simcoon-python-builder/include/simcoon/docs/Libraries/Continuum_mechanics/doc_hyperelastic.hpp @@ -114,7 +114,7 @@ constexpr auto tau_iso_hyper_invariants = R"pbdoc( .. code-block:: python import numpy as np - from simcoon import simmit as sim + import simcoon as sim # Neo-Hookean material: W = (mu/2)(I1_bar - 3) # dW/dI1_bar = mu/2, dW/dI2_bar = 0 @@ -160,7 +160,7 @@ constexpr auto sigma_iso_hyper_invariants = R"pbdoc( .. code-block:: python import numpy as np - from simcoon import simmit as sim + import simcoon as sim # Neo-Hookean material: W = (mu/2)(I1_bar - 3) mu = 1000.0 # Shear modulus in Pa @@ -204,7 +204,7 @@ constexpr auto tau_vol_hyper = R"pbdoc( .. code-block:: python import numpy as np - from simcoon import simmit as sim + import simcoon as sim # Volumetric penalty: U(J) = (kappa/2)(J-1)^2 # dU/dJ = kappa(J-1) @@ -250,7 +250,7 @@ constexpr auto sigma_vol_hyper = R"pbdoc( .. code-block:: python import numpy as np - from simcoon import simmit as sim + import simcoon as sim # Volumetric penalty: U(J) = (kappa/2)(J-1)^2 # dU/dJ = kappa(J-1) diff --git a/simcoon-python-builder/src/python_wrappers/boostpython_smartplus_wrappers.cpp b/simcoon-python-builder/src/python_wrappers/python_module.cpp similarity index 99% rename from simcoon-python-builder/src/python_wrappers/boostpython_smartplus_wrappers.cpp rename to simcoon-python-builder/src/python_wrappers/python_module.cpp index 467e96609..c9aabf5a3 100755 --- a/simcoon-python-builder/src/python_wrappers/boostpython_smartplus_wrappers.cpp +++ b/simcoon-python-builder/src/python_wrappers/python_module.cpp @@ -50,7 +50,7 @@ using namespace simpy; using namespace pybind11::literals; -PYBIND11_MODULE(simmit, m) +PYBIND11_MODULE(_core, m) { m.doc() = "pybind11 example plugin"; // optional module docstring diff --git a/simcoon-python-builder/test/parameter_test/test.py b/simcoon-python-builder/test/parameter_test/test.py index 028076ec4..e38709203 100644 --- a/simcoon-python-builder/test/parameter_test/test.py +++ b/simcoon-python-builder/test/parameter_test/test.py @@ -1,7 +1,7 @@ import pytest import numpy as np import numpy.typing as npt -from simcoon import simmit as sim +from simcoon import _core as sim from simcoon import parameter as par dir = os.path.dirname(os.path.realpath('__file__')) diff --git a/simcoon-python-builder/test/simmit_test/data/material.dat b/simcoon-python-builder/test/test_core/data/material.dat similarity index 100% rename from simcoon-python-builder/test/simmit_test/data/material.dat rename to simcoon-python-builder/test/test_core/data/material.dat diff --git a/simcoon-python-builder/test/simmit_test/data/path.txt b/simcoon-python-builder/test/test_core/data/path.txt similarity index 100% rename from simcoon-python-builder/test/simmit_test/data/path.txt rename to simcoon-python-builder/test/test_core/data/path.txt diff --git a/simcoon-python-builder/test/simmit_test/run_test.py b/simcoon-python-builder/test/test_core/run_test.py similarity index 96% rename from simcoon-python-builder/test/simmit_test/run_test.py rename to simcoon-python-builder/test/test_core/run_test.py index bb4a50ac6..ea022b3eb 100755 --- a/simcoon-python-builder/test/simmit_test/run_test.py +++ b/simcoon-python-builder/test/test_core/run_test.py @@ -1,7 +1,7 @@ import pytest import numpy as np import numpy.typing as npt -from simcoon import simmit as sim +from simcoon import _core as sim @pytest.fixture(scope="session") diff --git a/tutorials/01A-Composites/test.py b/tutorials/01A-Composites/test.py index e38417574..65f625667 100644 --- a/tutorials/01A-Composites/test.py +++ b/tutorials/01A-Composites/test.py @@ -1,7 +1,7 @@ import numpy as np import pandas as pd import matplotlib.pyplot as plt -from simcoon import simmit as sim +import simcoon as sim import os import itertools diff --git a/tutorials/01B-Composites/test.py b/tutorials/01B-Composites/test.py index d25854fa7..3d304b461 100644 --- a/tutorials/01B-Composites/test.py +++ b/tutorials/01B-Composites/test.py @@ -1,7 +1,7 @@ import numpy as np import pandas as pd import matplotlib.pyplot as plt -from simcoon import simmit as sim +import simcoon as sim import os import itertools