Skip to content

Commit

Permalink
Merge pull request #126 from TRACER-LULab/DifferentiationInterfaceBac…
Browse files Browse the repository at this point in the history
…kend

Updated docstrings and removed typos
  • Loading branch information
cfarm6 authored Apr 3, 2024
2 parents d0e480c + 801ca1d commit eacd8d1
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 47 deletions.
Empty file.
91 changes: 45 additions & 46 deletions src/general_form_incompressible_isotropic_models.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
export GeneralMooneyRivlin, GeneralDarijaniNaghdabadi, GeneralBeda

"""
$(SIGNATURES)
struct GeneralMooneyRivlin{T} <: AbstractIncompressibleModel{T}
f::Function
"""
$(SIGNATURES)
Model:
# Model:
```math
W = \\sum\\limits_{i,j = 0}^{N,M} C_{i,j}(I_1-3)^i(I_2-3)^j
```
```math
W = \\sum\\limits_{i,j = 0}^{N,M} C_{i,j}(I_1-3)^i(I_2-3)^j
```
Parameters:
- C: Matrix of coefficients for Cⱼᵢ coefficients
# Parameters:
- C: Matrix of coefficients for Cⱼᵢ coefficients
> Mooney M. A theory of large elastic deformation. Journal of applied physics. 1940 Sep;11(9):582-92.
"""
> Mooney M. A theory of large elastic deformation. Journal of applied physics. 1940 Sep;11(9):582-92.
"""
struct GeneralMooneyRivlin{T} <: AbstractIncompressibleModel{T}
f::Function
function GeneralMooneyRivlin(
I::Union{InvariantForm,PrincipalValueForm} = PrincipalValueForm(),
I::Union{InvariantForm,PrincipalValueForm}=PrincipalValueForm(),
)
function f(x, (; I1, I2, C))
return C[x] * (I1 - 3)^(x[2] - 1) * (I2 - 3)^(x[1] - 1)
Expand All @@ -33,7 +33,7 @@ function ContinuumMechanicsBase.StrainEnergyDensity(
) where {I<:PrincipalValueForm,T}
I1 = I₁(λ⃗)
I2 = I₂(λ⃗)
W = sum(Base.Fix2.f, (I1 = I1, I2 = I2, C = C⃗)), CartesianIndices(C⃗))
W = sum(Base.Fix2.f, (I1=I1, I2=I2, C=C⃗)), CartesianIndices(C⃗))
return W
end

Expand All @@ -42,32 +42,31 @@ function ContinuumMechanicsBase.StrainEnergyDensity(
I⃗::Vector{T},
(; C⃗),
) where {I<:InvariantForm,T}
W = sum(Base.Fix2.f, (I1 = I⃗[1], I2 = I⃗[2], C = C⃗)), CartesianIndices(C⃗))
W = sum(Base.Fix2.f, (I1=I⃗[1], I2=I⃗[2], C=C⃗)), CartesianIndices(C⃗))
return W
end

parameters(::GeneralMooneyRivlin) = (:C⃗,)

"""
$(SIGNATURES)
struct GeneralDarijaniNaghdabadi{T} <: AbstractIncompressibleModel{T}
"""
$(SIGNATURES)
# Model:
Model:
```math
W = \\sum\\limits_{i = 1}^{3}\\sum\\limits_{j=0}^{N} A_j (\\lambda_i^{m_j}-1) + B_j(\\lambda_i^{-n_j}-1)
```
```math
W = \\sum\\limits_{i = 1}^{3}\\sum\\limits_{j=0}^{N} A_j (\\lambda_i^{m_j}-1) + B_j(\\lambda_i^{-n_j}-1)
```
# Parameters:
- A⃗
- B⃗
- m⃗
- n⃗
Parameters:
- A⃗
- B⃗
- m⃗
- n⃗
> Bahreman M, Darijani H. New polynomial strain energy function; application to rubbery circular cylinders under finite extension and torsion. Journal of Applied Polymer Science. 2015 Apr 5;132(13).
"""
GeneralDarijaniNaghdabadi(::T = PrincipalValueForm()) where {T<:PrincipalValueForm} =
> Bahreman M, Darijani H. New polynomial strain energy function; application to rubbery circular cylinders under finite extension and torsion. Journal of Applied Polymer Science. 2015 Apr 5;132(13).
"""
struct GeneralDarijaniNaghdabadi{T} <: AbstractIncompressibleModel{T}
GeneralDarijaniNaghdabadi(::T=PrincipalValueForm()) where {T<:PrincipalValueForm} =
new{T}()
end

Expand All @@ -89,25 +88,25 @@ function parameters(::GeneralDarijaniNaghdabadi)
end


struct GeneralBeda{T} <: AbstractIncompressibleModel{T}
"""
$(SIGNATURES)
"""
$(SIGNATURES)
Model:
# Model:
```math
W = \\sum\\limits_{i = 1}^{N}\\frac{C_i}{\\alpha_i}(I_1-3)^{\\alpha_i} + \\sum\\limits_{j=1}^{M}\\frac{K_j}{\\beta_j}(I_2-3)^{\\beta_j}
```
```math
W = \\sum\\limits_{i = 1}^{N}\\frac{C_i}{\\alpha_i}(I_1-3)^{\\alpha_i} + \\sum\\limits_{j=1}^{M}\\frac{K_j}{\\beta_j}(I_2-3)^{\\beta_j}
```
Parameters:
- C
- K
- α
- β
# Parameters:
- C
- K
- α
- β
> Beda T. Reconciling the fundamental phenomenological expression of the strain energy of rubber with established experimental facts. Journal of Polymer Science Part B: Polymer Physics. 2005 Jan 15;43(2):125-34.
"""
GeneralBeda(I::Union{InvariantForm,PrincipalValueForm} = PrincipalValueForm()) =
> Beda T. Reconciling the fundamental phenomenological expression of the strain energy of rubber with established experimental facts. Journal of Polymer Science Part B: Polymer Physics. 2005 Jan 15;43(2):125-34.
"""
struct GeneralBeda{T} <: AbstractIncompressibleModel{T}
GeneralBeda(I::Union{InvariantForm,PrincipalValueForm}=PrincipalValueForm()) =
new{typeof(I)}()
end

Expand Down
32 changes: 31 additions & 1 deletion src/isotropic_incompressible_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1881,7 +1881,7 @@ W = C_1(I_1-3)+C_2\\log(\\frac{I_2}{3})
# Arguments:
- `type=PrincipalValueForm()`: Sets the form of the strain energy density function. Either `PrincipalValueForm()` or `InvariantForm()
# Paramters:
# Parameters:
- `C1`
- `C2`
Expand Down Expand Up @@ -3625,7 +3625,22 @@ end
# return f
# end

"""
$(SIGNATURES)
# Model:
```math
W = G_c N \\log\\bigg(\\frac{3N+\\frac{1}{2}I_1}{3N-I_1}\\bigg)
```
# Parameters:
- `Gc`
- `N`
> Xiang Y, Zhong D, Wang P, Mao G, Yu H, Qu S. A general constitutive model of soft elastomers. Journal of the Mechanics and Physics of Solids. 2018 Aug 1;117:110-22.
"""
struct GeneralConstitutiveModel_Network{T} <: AbstractIncompressibleModel{T}
GeneralConstitutiveModel_Network(
::T = PrincipalValueForm(),
Expand Down Expand Up @@ -3665,6 +3680,21 @@ function parameter_bounds(
return (lb = lb, ub = ub)
end

"""
$(SIGNATURES)
# Model:
```math
W = G_e\\sum\\limits_{i=1}^{3}\\frac{1}{\\lambda_I}
```
# Parameters:
- `Ge`
> Xiang Y, Zhong D, Wang P, Mao G, Yu H, Qu S. A general constitutive model of soft elastomers. Journal of the Mechanics and Physics of Solids. 2018 Aug 1;117:110-22.
"""
struct GeneralConstitutiveModel_Tube{T} <: AbstractIncompressibleModel{T}
GeneralConstitutiveModel_Tube(
::T = PrincipalValueForm(),
Expand Down

0 comments on commit eacd8d1

Please sign in to comment.