{"id":19918118,"url":"https://github.com/jfriedlein/logarithmic_strain_space-fortran","last_synced_at":"2026-03-03T08:47:33.095Z","repository":{"id":126956833,"uuid":"270992496","full_name":"jfriedlein/Logarithmic_Strain_Space-Fortran","owner":"jfriedlein","description":"Fortran code for the transformation into the logarithmic strain space","archived":false,"fork":false,"pushed_at":"2023-07-17T06:05:22.000Z","size":156,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T09:46:28.613Z","etag":null,"topics":["fortran90","logarithmic-strain-space","ls-dyna","ttb","umat","utan"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jfriedlein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-09T12:09:00.000Z","updated_at":"2024-05-31T10:53:05.000Z","dependencies_parsed_at":"2025-03-01T09:56:17.058Z","dependency_job_id":null,"html_url":"https://github.com/jfriedlein/Logarithmic_Strain_Space-Fortran","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jfriedlein/Logarithmic_Strain_Space-Fortran","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfriedlein%2FLogarithmic_Strain_Space-Fortran","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfriedlein%2FLogarithmic_Strain_Space-Fortran/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfriedlein%2FLogarithmic_Strain_Space-Fortran/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfriedlein%2FLogarithmic_Strain_Space-Fortran/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfriedlein","download_url":"https://codeload.github.com/jfriedlein/Logarithmic_Strain_Space-Fortran/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfriedlein%2FLogarithmic_Strain_Space-Fortran/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30038538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T06:58:30.252Z","status":"ssl_error","status_checked_at":"2026-03-03T06:58:15.329Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fortran90","logarithmic-strain-space","ls-dyna","ttb","umat","utan"],"created_at":"2024-11-12T21:53:06.163Z","updated_at":"2026-03-03T08:47:33.089Z","avatar_url":"https://github.com/jfriedlein.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logarithmic_Strain_Space-Fortran\nFortran code for the transformation into the logarithmic strain space (ln-space)\n\n(also available for C++ library deal.II [here](https://github.com/jfriedlein/Logarithmic_Strain_Space-dealii))\n\n## Requirements\n* The here published version of the ln-space is implemented in tensor notation using the tensor toolbox ttb that is also required and available [here](https://github.com/adtzlr/ttb).\n* Moreover, for convenience the ttb extension for LS-Dyna (ttbXLSDYNA) needs to be used, which, at the moment, is only available [here](https://github.com/jfriedlein/ttb/tree/extension_test_XLSDYNA/ttbXLSDYNA). However, this is only being used to transform the deformation gradient from the LS-Dyna list storage into a second order tensor, which is trivial if you know the storage convention (see LS-Dyna user manual, appendix A).\n* The example below uses some more modules, namely the [history hsv-manager](https://github.com/jfriedlein/history_hsv-manager_LS-Dyna), [material parameter cm-manager](https://github.com/jfriedlein/material-parameter_manager_LS-Dyna) and the ttbXkinematics extension for the stress and tangent push forwards. The former modules simplify the access of history variables and material parameters.\n\n\n## Note\nThis code is not optimised. We are probably able to speed things up in many places (recompute/save data, Voigt notation, ...). The ln-space can also be set up such that it directly outputs the spatial stress and tangent. Unfortunately, the current implementation does not enable a simple switch between material and spatial output, because it is based on an older ln-space paper. So, it is simpler to do a separate push-forward in the end.\n\n## The goal/When to use this code\nThe logarithmic strain space (herein often abbreviated as ln-space) is a very simple (in terms of the application) way to apply small strain material models to finite strains. So, in case you have a small strain model that you would like to use for applications exposed to large deformations/finite strains, the ln-space it probably the easiest way to achieve this.\n\nAll you need are three steps as schematically (simplified) shown in the figure:\n1. Pre-processing from the world of finite strains into the logarithmic strain space\n2. Calling your small strain model with the Hencky strain computed in the pre-processing\n3. Post-processing the computed stress and tangent(s) by transforming them from the ln-space back into the real world.\nAnd the best is, steps 1 and 3 are always the same (copy-paste) and the second step is the same as done for the small strain implementation.\n\n\u003cimg src=\"https://github.com/jfriedlein/Logarithmic_Strain_Space-Fortran/blob/master/images/ln-space%20-%20overview.png\" width=\"700\"\u003e\n\nDrawbacks?\n\nEspecially step 3, the post-processing is expensive independent of your material model. So, as far as efficiency is concerned, a simple material model utilising the ln-space is most certainly slower, than its derived finite strain equivalent (a model that was developed for finite strains). However, for complicated material models it can be faster to use the small strain model in the ln-space, instead of a finite strain equivalent (and it requires no further derivations/development to get from small to finite strains). Another disadvantage, is the limitation to small elastic strains. The latter is usually satisfied for metal forming and similar applications, where elastic strain are small and large plastic strain occur.\n\n## Background\n@todo add some equations\n\nThe transformation consists of three steps. First, we transform the deformation gradient `F` into the logarithmic strain space (ln-space) and obtain the Hencky strain (preprocessing). Secondly, the standard small strain material model is called using the Hencky strain and the usual history. The outcome is the stress measure `T` and the fourth order tangent `C`. Finally, we transform the stress and tangent modulus back from the logarithmic strain space to obtain e.g. the Second Piola-Kirchhoff stress tensor `S` and the Lagrangian tangent modulus `L` (postprocessing).\n\n## Interface/How to use this code\nTo show how easy the usage is and to give you the boilerplate code snippets, here an example from an LS-DYNA UMAT (For details on LS-Dyna umats see [here](https://github.com/jfriedlein/usrmat_LS-Dyna_Fortran)).\n\nWe implement our user-defined material model in the file \"dyn21umats.F\", were we start with the includes. This ln-space is based on tensors, so we use the [ttb tensor toolbox for Fortran](https://github.com/adtzlr/ttb).\n\n[dyn21umats.F]\n```fortran\nc Tensor Toolbox for Fortran by Andreas Dutzler\n#define NOR4\n#include '../ttb/ttb/ttb_library.F'\n```\nAs mentioned above, we require the eigenproblem solver developed by Joachim Kopp, optimised for symmetric 3x3 matrices.\n```fortran\nc Subroutine for the computation of the eigenproblem by Joachim Kopp\nc [https://www.mpi-hd.mpg.de/personalhomes/globes/3x3/index.html]\n      include '../dsyevj3-F-1.0/dsyevj3.f'\n```\nAnd of course we have to include the ln-space itself, as follows.\n```fortran\nc Logarthmic strain space\n      include \"../Logarithmic_Strain_Space-Fortran/ln_space.F\"\n```\n\nIn the desired umat (here umat44), we follow the three steps (preprocessing, small strain model, postprocessing).\nEverything until the next text block is boilerplate code, so can be reused without changes.\n\n```fortran\n      subroutine umat44 (cm,eps,sig,epsp,hsv,dt1,capa,etype,tt,\n     1 temper,failel,crv,nnpcrv,cma,qmat,elsiz,idele,reject)\nc\nc******************************************************************\nc|  Livermore Software Technology Corporation  (LSTC)             |\nc|  ------------------------------------------------------------  |\nc|  Copyright 1987-2008 Livermore Software Tech. Corp             |\nc|  All rights reserved                                           |\nc******************************************************************\nc Elastoplasticity - finite strain\nc******************************************************************\nc Thanks to the tensor module we can utilise our tensorial equations, but LS-Dyna\nc still only provides (input) and desires (output) vectorial quantities.\n      use Tensor\n      use TensorXkinematics\n      use hsv_manager\n      use cm_manager\nc\n      include 'nlqparm'\n      include 'bk06.inc'\n      include 'iounits.inc'\n      dimension cm(*),eps(*),sig(*),hsv(*),crv(lq1,2,*),cma(*),qmat(3,3)\n      integer nnpcrv(*)\n      character*5 etype\n      logical failel,reject\n      INTEGER8 idele\nc\nc Declarations:\nc Arrays must be declared as such\nc But nevertheless declare every single variable,\nc else you will get utter bs at some point.\n      type(Tensor2) :: Hencky_strain_E,\n     \u0026                 stress_T, stress_S, stress_Cauchy,\n     \u0026                 defoGrad_F\n      type(Tensor4) :: tangent_C, tangent_E, tangent_EE\n      double precision eigenvalues(3)\n      double precision ea(3), da(3), fa(3)\n      type(Tensor2), dimension(3) :: Ma\n      type(Tensor2) :: Eye\nc\n      double precision, dimension(6,6) :: es\n      real :: fstrain\n      logical failedIt\n      failedIt = .false.\nc      \nc ###############################################################################\nc ln-space - preprocessing\nc inputs:\nc * hsv ! contains the deformation gradient via flag IHYPER=1\nc outputs:\nc * eigenvalues\nc * eigenbasis 'Ma'\nc * ea, da, fa\nc * Hencky_strain_E\nc\nc Finite strain (via ln-space) on/off\n      fstrain = cm_get('finiteStrain____',cm)\nc\n      if ( fstrain\u003e0.5 ) then\n      call pre_ln( hsv_get_unsymTen2('defoG',hsv), \n     \u0026             eigenvalues, Ma,ea, da, fa, Hencky_strain_E )\n      else ! small strain\n          Eye = identity2(Eye)\n          Hencky_strain_E =\n     \u0026             symmetrize(hsv_get_unsymTen2('defoG',hsv) - Eye)\n      endif\nc\nc ###############################################################################\n```\n\nNow step 2 begins, where we call our small strain material model with the computed Hencky_strain_E. In this example, the actual material model was outsourced into a separate file and hence the subroutine is called via \"call\".\n\n```fortran\nc Be aware that we now call our small strain material model with\nc the \"pseudo\" small strain Hencky strain.\nc The latter is, however, \nc a total strain, because it is computed from the deformation gradient\nc instead of the incremental strain 'eps'. As a consequence the equations\nc will differ from an LS-Dyna small strain model\nc\nc ###############################################################################\nc Small strain material model\nc inputs:\nc * material parameters\nc * Hencky_strain_E\nc * history\nc outputs:\nc * stress\nc * tangent\nc * history\nc\n      call elasto_plasticity_code ( Hencky_strain_E, hsv, cm,\n     \u0026     stress_T, tangent_C, failedIt )\n      \nc\nc ###############################################################################\nc\nc This ends our actual small strain material model, but before we can take\nc the resulting stress tensor and go home, we have to transform it from the \nc logarithmic strain space (ln-space) back into the real world (post). Which is\nc admittedly a complicated and expensive task.\n```\n\nAnd boilerplate code again, where we postprocess the stress and tangent and push\nthem forward, because LS-Dyna wants the spatial quantities.\n\n```fortran\nc ###############################################################################\nc ln-space - postprocessing\nc inputs:\nc * eigenvalues\nc * ea, da, fa\nc * Ma\nc output:\nc * stress_S \nc * tangent_E \nc\n      if ( fstrain\u003e0.5 ) then\n      call post_ln( stress_T, tangent_C, eigenvalues, Ma,\n     \u0026              ea, da, fa, stress_S, tangent_E )\n      else\n          stress_S = stress_T\n          tangent_E = tangent_C\n      endif\nc\nc ###############################################################################\nc\nc Save the stress into the return argument      \n      sig(1:6) = asarray(voigt(stress_S),6)\nc\nc Push-Forward\n       if ( fstrain\u003e0.5 ) then          \n         defoGrad_F = hsv_get_unsymTen2('defoG',hsv)\n\n         ! Push-Forward of the 2. Piola-Kirchhoff stress\n         stress_Cauchy = stress_push_forward( stress_S,\n     \u0026                                      defoGrad_F )\n         sig(1:6) =  asarray(voigt(stress_Cauchy),6)\n       endif\nc      \nc Push-Forward of the tangent\n      es(1:6,1:6) = asarray(voigt(tangent_E),6,6)\nc         \n      if ( fstrain\u003e0.5 ) then\n          tangent_EE = tangent_push_forward( tangent_E,\n     \u0026                                       defoGrad_F )\n          es(1:6,1:6) = asarray(voigt(tangent_EE),6,6)\n      endif\nc            \n      call hsv_set_6x6(es,'es___',hsv)\nc\n      return\n      end\n```\n\n\n## ToDo:\n* test the use of include dsyevj in ln_space.F\n* remove the need for all these modules, to make the code and the example standalone\n\nAdd a note (where to save it) and the download link\n* \"always existing lines of code\" (maybe colored blocks)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfriedlein%2Flogarithmic_strain_space-fortran","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfriedlein%2Flogarithmic_strain_space-fortran","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfriedlein%2Flogarithmic_strain_space-fortran/lists"}