From 480a6146d00d06cd2c774f84173ce09f6a34cf39 Mon Sep 17 00:00:00 2001 From: Jacob Gunnarsson Date: Wed, 28 Jan 2026 14:22:12 +0100 Subject: [PATCH 01/12] Added SaintVenant --- src/MechanicalMaterialModels.jl | 3 ++- src/hyper_elasticity/SaintVenant.jl | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/hyper_elasticity/SaintVenant.jl diff --git a/src/MechanicalMaterialModels.jl b/src/MechanicalMaterialModels.jl index 6c1e5c6..8a6ccff 100644 --- a/src/MechanicalMaterialModels.jl +++ b/src/MechanicalMaterialModels.jl @@ -51,7 +51,8 @@ export CrystalPlasticity include("hyper_elasticity/HyperElastic.jl") include("hyper_elasticity/NeoHooke.jl") -export NeoHooke, CompressibleNeoHooke +include("hyper_elasticity/SaintVenant.jl") +export NeoHooke, CompressibleNeoHooke, SaintVenant include("FiniteStrainPlastic.jl") export FiniteStrainPlastic diff --git a/src/hyper_elasticity/SaintVenant.jl b/src/hyper_elasticity/SaintVenant.jl new file mode 100644 index 0000000..83e9920 --- /dev/null +++ b/src/hyper_elasticity/SaintVenant.jl @@ -0,0 +1,21 @@ + +""" + SaintVenant(; G, K) + +The-Saint Venant formulation with shear modulus `G` and bulk modulus `K` defined by the potential +```math +\\varPsi(\\boldsymbol{E}) = G\\boldsymbol{E}_{dev}:\\boldsymbol{E}_{dev} \\frac{K}{2} \\mathrm{tr}(\\boldsymbol{E})^2 +``` +where ``\\boldsymbol{E}`` is the Green-Lagrange strain tensor. + +""" +@kwdef struct SaintVenant{T} <: AbstractHyperElastic + G::T + K::T +end + +function compute_potential(m::SaintVenant, C::SymmetricTensor) + E = 0.5 * (C - one(C)) + return m.G * dev(E)⊡dev(E)+m.K/2 * (tr(E))^2 +end +MMB.get_vector_eltype(::SaintVenant{T}) where {T} = T \ No newline at end of file From 0ece848a56d43e9219d47d1a431be4e625a6ef15 Mon Sep 17 00:00:00 2001 From: Jacob Gunnarsson Date: Wed, 28 Jan 2026 17:16:06 +0100 Subject: [PATCH 02/12] Changed SainVenant to be a wrapper around LinearElastic and added test --- src/hyper_elasticity/SaintVenant.jl | 8 ++++---- test/test_hyperelastic.jl | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hyper_elasticity/SaintVenant.jl b/src/hyper_elasticity/SaintVenant.jl index 83e9920..bf195ef 100644 --- a/src/hyper_elasticity/SaintVenant.jl +++ b/src/hyper_elasticity/SaintVenant.jl @@ -9,13 +9,13 @@ The-Saint Venant formulation with shear modulus `G` and bulk modulus `K` defined where ``\\boldsymbol{E}`` is the Green-Lagrange strain tensor. """ -@kwdef struct SaintVenant{T} <: AbstractHyperElastic - G::T - K::T +@kwdef struct SaintVenant{E} <: AbstractHyperElastic + elastic::E end function compute_potential(m::SaintVenant, C::SymmetricTensor) + println("Using SaintVenant model") E = 0.5 * (C - one(C)) - return m.G * dev(E)⊡dev(E)+m.K/2 * (tr(E))^2 + return 1/2 * E ⊡ m.elastic.C ⊡ E end MMB.get_vector_eltype(::SaintVenant{T}) where {T} = T \ No newline at end of file diff --git a/test/test_hyperelastic.jl b/test/test_hyperelastic.jl index 09c7967..e486959 100644 --- a/test/test_hyperelastic.jl +++ b/test/test_hyperelastic.jl @@ -1,5 +1,5 @@ @testset "HyperElastic" begin - models = (NeoHooke(;G=rand()), CompressibleNeoHooke(;G=rand(), K=rand())) + models = (NeoHooke(;G=rand()), CompressibleNeoHooke(;G=rand(), K=rand()), SaintVenant(LinearElastic(E=rand(), ν=rand()))) F = rand(Tensor{2,3}) for model in models state = initial_material_state(model) From f4d7fe609a325155b397aa9436a9088b525df45c Mon Sep 17 00:00:00 2001 From: Jacob Gunnarsson Date: Wed, 28 Jan 2026 17:25:55 +0100 Subject: [PATCH 03/12] removed print in function --- src/hyper_elasticity/SaintVenant.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyper_elasticity/SaintVenant.jl b/src/hyper_elasticity/SaintVenant.jl index bf195ef..1da1393 100644 --- a/src/hyper_elasticity/SaintVenant.jl +++ b/src/hyper_elasticity/SaintVenant.jl @@ -14,8 +14,8 @@ where ``\\boldsymbol{E}`` is the Green-Lagrange strain tensor. end function compute_potential(m::SaintVenant, C::SymmetricTensor) - println("Using SaintVenant model") E = 0.5 * (C - one(C)) return 1/2 * E ⊡ m.elastic.C ⊡ E end + MMB.get_vector_eltype(::SaintVenant{T}) where {T} = T \ No newline at end of file From f9c39e5bbfc0b27d6a99b3e6cb2fdd0e6bc29c30 Mon Sep 17 00:00:00 2001 From: Jacob Gunnarsson Date: Thu, 29 Jan 2026 17:53:24 +0100 Subject: [PATCH 04/12] Added documentation for Saint-Venant --- docs/src/finite_strains.md | 4 ++++ src/hyper_elasticity/SaintVenant.jl | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/src/finite_strains.md b/docs/src/finite_strains.md index 9a4755d..fce7d2b 100644 --- a/docs/src/finite_strains.md +++ b/docs/src/finite_strains.md @@ -12,6 +12,10 @@ the `MaterialModelsBase.jl` interface. NeoHooke CompressibleNeoHooke ``` +### Saint-Venant Elasticity +```@docs +SaintVenant +``` ## [Plasticity](@id finite_strain_plasticity) ```@docs diff --git a/src/hyper_elasticity/SaintVenant.jl b/src/hyper_elasticity/SaintVenant.jl index 1da1393..f257294 100644 --- a/src/hyper_elasticity/SaintVenant.jl +++ b/src/hyper_elasticity/SaintVenant.jl @@ -1,13 +1,12 @@ """ - SaintVenant(; G, K) + SaintVenant(; elastic) -The-Saint Venant formulation with shear modulus `G` and bulk modulus `K` defined by the potential +The Saint-Venant formulation defined by the potential ```math -\\varPsi(\\boldsymbol{E}) = G\\boldsymbol{E}_{dev}:\\boldsymbol{E}_{dev} \\frac{K}{2} \\mathrm{tr}(\\boldsymbol{E})^2 +\\varPsi(\\boldsymbol{E}) = \\frac{1}{2}\\boldsymbol{E}:\\boldsymbol{C}:\\boldsymbol{E} ``` -where ``\\boldsymbol{E}`` is the Green-Lagrange strain tensor. - +where ``\\boldsymbol{E}`` is the Green-Lagrange strain tensor and ``\\boldsymbol{C}`` is the elastic stiffness tensor. """ @kwdef struct SaintVenant{E} <: AbstractHyperElastic elastic::E From d2a4b9692a8b8203f8d40d7265674edf436ea4f0 Mon Sep 17 00:00:00 2001 From: GunnarssonJ Date: Fri, 30 Jan 2026 16:40:38 +0100 Subject: [PATCH 05/12] Update src/hyper_elasticity/SaintVenant.jl Co-authored-by: Knut Andreas Meyer --- src/hyper_elasticity/SaintVenant.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyper_elasticity/SaintVenant.jl b/src/hyper_elasticity/SaintVenant.jl index f257294..87be4ca 100644 --- a/src/hyper_elasticity/SaintVenant.jl +++ b/src/hyper_elasticity/SaintVenant.jl @@ -8,7 +8,7 @@ The Saint-Venant formulation defined by the potential ``` where ``\\boldsymbol{E}`` is the Green-Lagrange strain tensor and ``\\boldsymbol{C}`` is the elastic stiffness tensor. """ -@kwdef struct SaintVenant{E} <: AbstractHyperElastic +struct SaintVenant{E} <: AbstractHyperElastic elastic::E end From 91cf2e541abe20a8bab5f82706b4eb53627abd0e Mon Sep 17 00:00:00 2001 From: GunnarssonJ Date: Fri, 30 Jan 2026 16:40:59 +0100 Subject: [PATCH 06/12] Update src/hyper_elasticity/SaintVenant.jl Co-authored-by: Knut Andreas Meyer --- src/hyper_elasticity/SaintVenant.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyper_elasticity/SaintVenant.jl b/src/hyper_elasticity/SaintVenant.jl index 87be4ca..ed8b6f7 100644 --- a/src/hyper_elasticity/SaintVenant.jl +++ b/src/hyper_elasticity/SaintVenant.jl @@ -17,4 +17,4 @@ function compute_potential(m::SaintVenant, C::SymmetricTensor) return 1/2 * E ⊡ m.elastic.C ⊡ E end -MMB.get_vector_eltype(::SaintVenant{T}) where {T} = T \ No newline at end of file +MMB.get_vector_eltype(m::SaintVenant) = MMB.get_vector_eltype(m.elastic) From 109aa9b82cd48e16775f00338a25dd62931c56bb Mon Sep 17 00:00:00 2001 From: GunnarssonJ Date: Fri, 30 Jan 2026 16:41:14 +0100 Subject: [PATCH 07/12] Update src/hyper_elasticity/SaintVenant.jl Co-authored-by: Knut Andreas Meyer --- src/hyper_elasticity/SaintVenant.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyper_elasticity/SaintVenant.jl b/src/hyper_elasticity/SaintVenant.jl index ed8b6f7..38f33ea 100644 --- a/src/hyper_elasticity/SaintVenant.jl +++ b/src/hyper_elasticity/SaintVenant.jl @@ -1,6 +1,6 @@ """ - SaintVenant(; elastic) + SaintVenant(elastic::LinearElastic) The Saint-Venant formulation defined by the potential ```math From 975fbc95e63254f4bf327313ef1fef307a801c21 Mon Sep 17 00:00:00 2001 From: GunnarssonJ Date: Fri, 30 Jan 2026 16:41:44 +0100 Subject: [PATCH 08/12] Update src/hyper_elasticity/SaintVenant.jl Co-authored-by: Knut Andreas Meyer --- src/hyper_elasticity/SaintVenant.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyper_elasticity/SaintVenant.jl b/src/hyper_elasticity/SaintVenant.jl index 38f33ea..2007276 100644 --- a/src/hyper_elasticity/SaintVenant.jl +++ b/src/hyper_elasticity/SaintVenant.jl @@ -4,7 +4,7 @@ The Saint-Venant formulation defined by the potential ```math -\\varPsi(\\boldsymbol{E}) = \\frac{1}{2}\\boldsymbol{E}:\\boldsymbol{C}:\\boldsymbol{E} +\\varPsi(\\boldsymbol{E}) = \\frac{1}{2}\\boldsymbol{E}:\\mathsf{\\boldsymbol{C}}:\\boldsymbol{E} ``` where ``\\boldsymbol{E}`` is the Green-Lagrange strain tensor and ``\\boldsymbol{C}`` is the elastic stiffness tensor. """ From 2ea919d9a37d46bd10459f03c1fa4c072d70cd73 Mon Sep 17 00:00:00 2001 From: GunnarssonJ Date: Fri, 30 Jan 2026 16:42:04 +0100 Subject: [PATCH 09/12] Update src/hyper_elasticity/SaintVenant.jl Co-authored-by: Knut Andreas Meyer --- src/hyper_elasticity/SaintVenant.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hyper_elasticity/SaintVenant.jl b/src/hyper_elasticity/SaintVenant.jl index 2007276..51a7c86 100644 --- a/src/hyper_elasticity/SaintVenant.jl +++ b/src/hyper_elasticity/SaintVenant.jl @@ -6,7 +6,8 @@ The Saint-Venant formulation defined by the potential ```math \\varPsi(\\boldsymbol{E}) = \\frac{1}{2}\\boldsymbol{E}:\\mathsf{\\boldsymbol{C}}:\\boldsymbol{E} ``` -where ``\\boldsymbol{E}`` is the Green-Lagrange strain tensor and ``\\boldsymbol{C}`` is the elastic stiffness tensor. +where ``\\boldsymbol{E}`` is the Green-Lagrange strain tensor and ``\\mathsf{\\boldsymbol{C}}`` is the +elastic stiffness tensor defined in `elastic`. """ struct SaintVenant{E} <: AbstractHyperElastic elastic::E From f2946e8b90ac04aead9399b8700827d80249df26 Mon Sep 17 00:00:00 2001 From: GunnarssonJ Date: Fri, 30 Jan 2026 16:44:13 +0100 Subject: [PATCH 10/12] Update src/hyper_elasticity/SaintVenant.jl Co-authored-by: Knut Andreas Meyer --- src/hyper_elasticity/SaintVenant.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hyper_elasticity/SaintVenant.jl b/src/hyper_elasticity/SaintVenant.jl index 51a7c86..9376fac 100644 --- a/src/hyper_elasticity/SaintVenant.jl +++ b/src/hyper_elasticity/SaintVenant.jl @@ -14,8 +14,8 @@ struct SaintVenant{E} <: AbstractHyperElastic end function compute_potential(m::SaintVenant, C::SymmetricTensor) - E = 0.5 * (C - one(C)) - return 1/2 * E ⊡ m.elastic.C ⊡ E + E = (C - one(C)) / 2 + return (E ⊡ m.elastic.C ⊡ E) / 2 end MMB.get_vector_eltype(m::SaintVenant) = MMB.get_vector_eltype(m.elastic) From 637c9d11163583bde8bc0cc747d894ba32cddf21 Mon Sep 17 00:00:00 2001 From: GunnarssonJ Date: Fri, 30 Jan 2026 16:44:36 +0100 Subject: [PATCH 11/12] Update test/test_hyperelastic.jl Co-authored-by: Knut Andreas Meyer --- test/test_hyperelastic.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_hyperelastic.jl b/test/test_hyperelastic.jl index e486959..cb1549f 100644 --- a/test/test_hyperelastic.jl +++ b/test/test_hyperelastic.jl @@ -1,5 +1,5 @@ @testset "HyperElastic" begin - models = (NeoHooke(;G=rand()), CompressibleNeoHooke(;G=rand(), K=rand()), SaintVenant(LinearElastic(E=rand(), ν=rand()))) + models = (NeoHooke(;G=rand()), CompressibleNeoHooke(;G=rand(), K=rand()), SaintVenant(LinearElastic(E=rand(), ν=rand()/2))) F = rand(Tensor{2,3}) for model in models state = initial_material_state(model) From 614c1ea5e354d61864f2c227e86aec4bf47b18fc Mon Sep 17 00:00:00 2001 From: Jacob Gunnarsson Date: Fri, 30 Jan 2026 17:05:20 +0100 Subject: [PATCH 12/12] Changed C to 4th order and switched place of Sain-Venant and Neo-Hooke in docs --- docs/src/finite_strains.md | 9 +++++---- src/Elastic.jl | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/src/finite_strains.md b/docs/src/finite_strains.md index fce7d2b..4454512 100644 --- a/docs/src/finite_strains.md +++ b/docs/src/finite_strains.md @@ -6,16 +6,17 @@ Implementations of mechanical (stress-strain) material models following the `MaterialModelsBase.jl` interface. +### Saint-Venant Elasticity +```@docs +SaintVenant +``` + ## Hyperelasticity ### Neo-Hookean Materials ```@docs NeoHooke CompressibleNeoHooke ``` -### Saint-Venant Elasticity -```@docs -SaintVenant -``` ## [Plasticity](@id finite_strain_plasticity) ```@docs diff --git a/src/Elastic.jl b/src/Elastic.jl index 108564d..7d8141b 100644 --- a/src/Elastic.jl +++ b/src/Elastic.jl @@ -20,8 +20,8 @@ LinearElastic(::Val{:isotropic}) LinearElastic{:general}(C::SymmetricTensor{4,3}) Create a general `LinearElastic` material with the 4th order elastic stiffness tensor -``\\boldsymbol{C}``, such that -``\\boldsymbol{\\sigma} = \\boldsymbol{C}:\\boldsymbol{\\epsilon}``. +``\\mathsf{\\boldsymbol{C}}``, such that +``\\boldsymbol{\\sigma} = \\mathsf{\\boldsymbol{C}}:\\boldsymbol{\\epsilon}``. """ LinearElastic(::Val{:general}) @@ -29,11 +29,11 @@ LinearElastic(::Val{:general}) LinearElastic{:cubicsymmetry}(; C1111::T, C1122::T, C1212::T) where {T} Create a `LinearElastic` material where the stiffness tensor, -``\\boldsymbol{C}``, possesses cubic symmetry along the coordinate axes. -Using the 9-component Voigt notation, ``\\boldsymbol{C}`` can be expressed as +``\\mathsf{\\boldsymbol{C}}``, possesses cubic symmetry along the coordinate axes. +Using the 9-component Voigt notation, ``\\mathsf{\\boldsymbol{C}}`` can be expressed as ```math -\\boldsymbol{C} = +\\mathsf{\\boldsymbol{C}} = \\begin{bmatrix} C_{1111} & C_{1122} & C_{1122} & 0 & 0 & 0 & 0 & 0 & 0 \\\\ C_{1122} & C_{1111} & C_{1122} & 0 & 0 & 0 & 0 & 0 & 0 \\\\