Skip to content

Commit 30df952

Browse files
wip
1 parent 54cd8dd commit 30df952

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

src/Geometry/axistensors.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,7 @@ struct AxisTensor{
136136
T,
137137
N,
138138
A <: NTuple{N, AbstractAxis},
139-
S <: Union{
140-
SimpleSymmetric{N, T},
141-
StaticArray{<:Tuple, T, N},
142-
},
139+
S <: Union{SimpleSymmetric{N, T}, StaticArray{<:Tuple, T, N}},
143140
} <: AbstractArray{T, N}
144141
axes::A
145142
components::S
@@ -150,10 +147,7 @@ AxisTensor(
150147
components::S,
151148
) where {
152149
A <: Tuple{Vararg{AbstractAxis}},
153-
S <: Union{
154-
SimpleSymmetric{N, T},
155-
StaticArray{<:Tuple, T, N},
156-
},
150+
S <: Union{SimpleSymmetric{N, T}, StaticArray{<:Tuple, T, N}},
157151
} where {T, N} = AxisTensor{T, N, A, S}(axes, components)
158152

159153
AxisTensor(axes::Tuple{Vararg{AbstractAxis}}, components) =

src/Geometry/localgeometry.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,16 @@ struct LocalGeometry{I, C <: AbstractPoint, FT, S, N, L}
6060
gᵢⱼ = SimpleSymmetric(gᵢⱼ₀)
6161
L = triangular_nonzeros(S)
6262
N = size(components(gⁱʲ₀), 1)
63-
return new{I, C, FT, S, N, L}(coordinates, J, WJ, Jinv, ∂x∂ξ, ∂ξ∂x, gⁱʲ, gᵢⱼ)
63+
return new{I, C, FT, S, N, L}(
64+
coordinates,
65+
J,
66+
WJ,
67+
Jinv,
68+
∂x∂ξ,
69+
∂ξ∂x,
70+
gⁱʲ,
71+
gᵢⱼ,
72+
)
6473
end
6574
end
6675

src/Geometry/simple_symmetric.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ StaticArrays.check_parameters(
5353

5454
triangular_nonzeros(::SMatrix{N}) where {N} = Int(N * (N + 1) / 2)
5555
triangular_nonzeros(::Type{<:SMatrix{N}}) where {N} = Int(N * (N + 1) / 2)
56-
tail_params(::Type{S}) where {N,T, S<:SMatrix{N,N,T}} = (T, S, N, triangular_nonzeros(S))
56+
tail_params(::Type{S}) where {N, T, S <: SMatrix{N, N, T}} =
57+
(T, S, N, triangular_nonzeros(S))
5758

5859
# function SimpleSymmetric(A::SMatrix)
5960
# @assert size(A, 1) == size(A, 2)

test/Geometry/unit_simple_symmetric.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ simple_symmetric(A::Matrix) = SimpleSymmetric(SMatrix{size(A)..., eltype(A)}(A))
2828
A = @SMatrix [1 2; 2 4]
2929
@test SimpleSymmetric(A) / 2 === SimpleSymmetric(A / 2)
3030
@test_opt SimpleSymmetric(A)
31-
@test Geometry.tail_params(typeof(@SMatrix Float32[1 2; 2 4])) == (Float32, SMatrix{2, 2, Float32, 4}, 2, 3)
31+
@test Geometry.tail_params(typeof(@SMatrix Float32[1 2; 2 4])) ==
32+
(Float32, SMatrix{2, 2, Float32, 4}, 2, 3)
3233
end
3334

3435
@testset "sizs" begin
35-
for N in (1,2,3,5,8,10)
36-
simple_symmetric(rand(N,N)) # pass in non-symmetric matrix
37-
end
36+
for N in (1, 2, 3, 5, 8, 10)
37+
simple_symmetric(rand(N, N)) # pass in non-symmetric matrix
38+
end
3839
end

0 commit comments

Comments
 (0)