From c1e9f43d47dc23e33e9bd6532a51aa25d3968481 Mon Sep 17 00:00:00 2001 From: singularitti Date: Thu, 16 Feb 2023 11:38:49 -0500 Subject: [PATCH] Rename `elastic_energy_density` to `energydensity` --- src/energy.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/energy.jl b/src/energy.jl index 0f8e3d5..5b3cc48 100644 --- a/src/energy.jl +++ b/src/energy.jl @@ -1,13 +1,13 @@ using LinearAlgebra: dot -export elastic_energy_density +export energydensity -elastic_energy_density(σ::EngineeringStress, ϵ::EngineeringStrain) = dot(σ, ϵ) / 2 -elastic_energy_density(σ::TensorStress, ε::TensorStrain) = double_contraction(σ, ε) / 2 -elastic_energy_density(ε, σ) = elastic_energy_density(ε, σ) -elastic_energy_density(cᵢⱼ::StiffnessMatrix, ϵ::EngineeringStrain) = dot(ϵ, cᵢⱼ, ϵ) / 2 -elastic_energy_density(sᵢⱼ::ComplianceMatrix, σ::EngineeringStress) = dot(σ, sᵢⱼ, σ) / 2 -elastic_energy_density(cᵢⱼₖₗ::StiffnessTensor, ε::TensorStrain) = - elastic_energy_density(StiffnessMatrix(cᵢⱼₖₗ), EngineeringStrain(ε)) -elastic_energy_density(sᵢⱼₖₗ::ComplianceTensor, σ::TensorStress) = - elastic_energy_density(ComplianceMatrix(sᵢⱼₖₗ), EngineeringStress(σ)) +energydensity(σ::EngineeringStress, ϵ::EngineeringStrain) = dot(σ, ϵ) / 2 +energydensity(σ::TensorStress, ε::TensorStrain) = double_contraction(σ, ε) / 2 +energydensity(ε, σ) = energydensity(ε, σ) +energydensity(c::StiffnessMatrix, ϵ::EngineeringStrain) = dot(ϵ, c, ϵ) / 2 +energydensity(s::ComplianceMatrix, σ::EngineeringStress) = dot(σ, s, σ) / 2 +energydensity(c::StiffnessTensor, ε::TensorStrain) = + energydensity(StiffnessMatrix(c), EngineeringStrain(ε)) +energydensity(s::ComplianceTensor, σ::TensorStress) = + energydensity(ComplianceMatrix(s), EngineeringStress(σ))