From 8e1d868b083d83298d1c954697633942cf581d62 Mon Sep 17 00:00:00 2001 From: Patrick Jaap Date: Tue, 3 Dec 2024 13:25:36 +0100 Subject: [PATCH] Add symmetric gradient operators --- CHANGELOG.md | 10 +++++++--- src/ExtendableFEM.jl | 4 ++-- src/unknowns.jl | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9abc480..c212733 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,13 @@ # CHANGES ## next version - - added tests for explicit imports and undocumented names - - JuliaFormatter - + +### Added + + - tests for explicit imports and undocumented names + - Runic.jl code formatting + - new operators `symgrad_Voigt` and `εV` for symmetric gradients in Voigt notation + ## v0.8 November 1, 2024 - started changelog - first registered version since repository move (fixed some URL links in the doc and readme) diff --git a/src/ExtendableFEM.jl b/src/ExtendableFEM.jl index ec4d347..311fc78 100644 --- a/src/ExtendableFEM.jl +++ b/src/ExtendableFEM.jl @@ -33,7 +33,7 @@ using ExtendableFEMBase: ExtendableFEMBase, AbstractFiniteElement, integrate_segment!, lazy_interpolate!, nodevalues, nodevalues!, nodevalues_subset!, nodevalues_view, norms, unicode_gridplot, unicode_scalarplot, - update_basis! + update_basis!, SymmetricGradient using ExtendableGrids: ExtendableGrids, AT_NODES, AbstractElementGeometry, Adjacency, AssemblyType, BEdgeNodes, BFaceFaces, BFaceNodes, BFaceRegions, CellAssemblyGroups, @@ -113,7 +113,7 @@ export print_table include("unknowns.jl") export Unknown export grid, dofgrid -export id, grad, hessian, div, normalflux, tangentialflux, Δ, apply, curl1, curl2, curl3, laplace, tangentialgrad +export id, grad, hessian, div, normalflux, tangentialflux, Δ, apply, curl1, curl2, curl3, laplace, tangentialgrad, symgrad_voigt, εV include("operators.jl") #export AbstractOperator diff --git a/src/unknowns.jl b/src/unknowns.jl index 5bdb404..a7fa855 100644 --- a/src/unknowns.jl +++ b/src/unknowns.jl @@ -179,6 +179,23 @@ alias for (u, TangentialGradient) """ tangentialgrad(u) = (u, TangentialGradient) +""" + symgrad_voigt(u, factor) + +alias for (u, SymmetricGradient{factor}) in Voigt notation. + +The `factor` is a real number applied to the (summed) off-diagonal entries. +In the current implementation in ExtendableFEMBase, factor = 0.5 represents the Voigt strain mapping [σ₁₁ σ₂₂ σ₃₃ σ₁₃ σ₂₃ σ₁₂], +while factor = 1.0 represents the Voigt strain mapping [ε₁₁ ε₂₂ ε₃₃ 2ε₁₃ 2ε₂₃ 2ε₁₂]. +""" +symgrad_voigt(u, factor) = (u, SymmetricGradient{factor}) + +""" + εV(u, factor) + +unicode alias for [`symgrad_voigt(u, factor)`](@ref). +""" +εV(u, factor) = symgrad_voigt(u, factor) """ grid(u)