From a3a546b8cb5795ea4a5b3e14e7be894f446a7bda Mon Sep 17 00:00:00 2001 From: Tero Frondelius Date: Mon, 21 Oct 2019 22:52:49 +0300 Subject: [PATCH] Bug isotropic_elasticity_tensor over written (#56) * Fix #55, isotropic_elasticity_tensor over written. --- Project.toml | 9 +++++++-- src/Materials.jl | 7 +++++++ src/chaboche.jl | 7 ------- src/idealplastic.jl | 7 ------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Project.toml b/Project.toml index 72b477d..79d395a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Materials" uuid = "35fa313e-aa48-52ea-bc82-ddb91c7db87b" -version = "0.2.0" +version = "0.2.1" [deps] Einsum = "b7d42ee7-0b51-5a75-98ca-779d3107e4c0" @@ -11,7 +11,12 @@ Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a" Tensors = "48a634ad-e948-5137-8d70-aa71f2a747f4" [compat] -julia = "≥ 1.0.0" +julia = "1.0.0" +Einsum = "0.4.1" +ForwardDiff = "0.10.3" +NLsolve = "4.1.0" +Parameters = "0.12.0" +Tensors = "1.2.0" [extras] DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" diff --git a/src/Materials.jl b/src/Materials.jl index 91db724..7832675 100644 --- a/src/Materials.jl +++ b/src/Materials.jl @@ -36,6 +36,13 @@ end export integrate_material!, update_material!, reset_material! +function isotropic_elasticity_tensor(lambda, mu) + delta(i,j) = i==j ? 1.0 : 0.0 + g(i,j,k,l) = lambda*delta(i,j)*delta(k,l) + mu*(delta(i,k)*delta(j,l)+delta(i,l)*delta(j,k)) + jacobian = SymmetricTensor{4, 3, Float64}(g) + return jacobian +end + include("idealplastic.jl") export IdealPlastic, IdealPlasticDriverState, IdealPlasticParameterState, IdealPlasticVariableState diff --git a/src/chaboche.jl b/src/chaboche.jl index e70c837..4f62114 100644 --- a/src/chaboche.jl +++ b/src/chaboche.jl @@ -1,13 +1,6 @@ # This file is a part of JuliaFEM. # License is MIT: see https://github.com/JuliaFEM/Materials.jl/blob/master/LICENSE -function isotropic_elasticity_tensor(lambda, mu) - delta(i,j) = i==j ? 1.0 : 0.0 - g(i,j,k,l) = lambda*delta(i,j)*delta(k,l) + mu*(delta(i,k)*delta(j,l)+delta(i,l)*delta(j,k)) - jacobian = SymmetricTensor{4, 3, Float64}(g) - return jacobian -end - @with_kw mutable struct ChabocheDriverState <: AbstractMaterialState time :: Float64 = zero(Float64) strain :: SymmetricTensor{2,3} = zero(SymmetricTensor{2,3,Float64}) diff --git a/src/idealplastic.jl b/src/idealplastic.jl index d55bf1a..50db7e5 100644 --- a/src/idealplastic.jl +++ b/src/idealplastic.jl @@ -1,13 +1,6 @@ # This file is a part of JuliaFEM. # License is MIT: see https://github.com/JuliaFEM/Materials.jl/blob/master/LICENSE -function isotropic_elasticity_tensor(lambda, mu) - delta(i,j) = i==j ? 1.0 : 0.0 - g(i,j,k,l) = lambda*delta(i,j)*delta(k,l) + mu*(delta(i,k)*delta(j,l)+delta(i,l)*delta(j,k)) - jacobian = SymmetricTensor{4, 3, Float64}(g) - return jacobian -end - @with_kw mutable struct IdealPlasticDriverState <: AbstractMaterialState time :: Float64 = zero(Float64) strain :: SymmetricTensor{2,3} = zero(SymmetricTensor{2,3,Float64})