Skip to content

Commit 5520e62

Browse files
authored
Merge pull request #130 from MultiSimOLab/sqrt-dev
Stable `sqrt`
2 parents 9bbe401 + ad7309b commit 5520e62

3 files changed

Lines changed: 4 additions & 17 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ AbstractTrees = "0.4"
3434
BlockArrays = "1.9"
3535
DrWatson = "2.19"
3636
ForwardDiff = "1.3"
37-
Gridap = "0.19.7"
37+
Gridap = "0.19.8"
3838
GridapDistributed = "0.4"
3939
GridapGmsh = "0.7"
4040
GridapPETSc = "0.5"

src/TensorAlgebra/Functions.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11

2-
"""
3-
sqrt(A::TensorValue{3})::TensorValue{3}
4-
5-
Compute the square root of a 3x3 matrix by means of eigen decomposition.
6-
"""
7-
function sqrt(A::TensorValue{3})
8-
λ, Q = eigen(A)
9-
λ = sqrt.(λ)
10-
TensorValue{3}(λ[1]*Q[1:3]*Q[1:3]' + λ[2]*Q[4:6]*Q[4:6]' + λ[3]*Q[7:9]*Q[7:9]')
11-
end
12-
132

143
"""
154
cof(A::TensorValue)::TensorValue

src/TensorAlgebra/TensorAlgebra.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ using StaticArrays
66
using LinearAlgebra
77
import Base: *
88
import Base: +
9-
import Base: sqrt
109

1110
export (*)
1211
export (×ᵢ⁴)
@@ -32,7 +31,6 @@ export δᵢₗδⱼₖ2D
3231
export δᵢⱼδₖₗ3D
3332
export δᵢₖδⱼₗ3D
3433
export δᵢₗδⱼₖ3D
35-
export sqrt
3634
export cof
3735
export contraction_IP_JPKL
3836
export contraction_IP_PJKL
@@ -42,9 +40,9 @@ export Ellipsoid
4240

4341
# outer ⊗ \otimes
4442
# inner ⊙ \odot
45-
# cross × \times
46-
# sum +
47-
# dot *
43+
# cross × \times
44+
# sum + +
45+
# dot *
4846

4947
include("FlatIndexing.jl")
5048

0 commit comments

Comments
 (0)