Skip to content

Commit 7c9bd8c

Browse files
committed
Merge branch 'master' into kam/dotmacro
2 parents a5f8a17 + 258540f commit 7c9bd8c

File tree

5 files changed

+27
-10
lines changed

5 files changed

+27
-10
lines changed

CHANGELOG.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## Unreleased
8+
<!-- ## Unreleased -->
9+
10+
## [1.16.1]
11+
12+
### Bugfixes
13+
14+
- Fix that `tovoigt!(::Vector{TA}, ::AbstractTensor{order,dim,TB})` didn't work after v1.15 unless `TA==TB` [#212][github-212]
915

1016
## [1.16.0]
1117

@@ -19,8 +25,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1925
* `dot(::Tensor{D1}, ::Tensor{D2})` for (D1,D2) in ((3,1), (1,3), (2,3), (3,2))
2026

2127
<!-- Release links -->
22-
[Unreleased]: https://github.com/Ferrite-FEM/Tensors.jl/compare/v1.15.1...HEAD
23-
[1.15.1]: https://github.com/Ferrite-FEM/Tensors.jl/compare/v1.15.0...v1.15.1
28+
[Unreleased]: https://github.com/Ferrite-FEM/Tensors.jl/compare/v1.16.1...HEAD
29+
[1.16.1]: https://github.com/Ferrite-FEM/Tensors.jl/compare/v1.16.0...v1.16.1
30+
[1.16.0]: https://github.com/Ferrite-FEM/Tensors.jl/compare/v1.15.0...v1.16.0
2431

2532
<!-- GitHub pull request/issue links -->
26-
[github-205]: https://github.com/Ferrite-FEM/Tensors.jl/pull/205
33+
[github-212]: https://github.com/Ferrite-FEM/Tensors.jl/pull/212
34+
[github-205]: https://github.com/Ferrite-FEM/Tensors.jl/pull/205

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Tensors"
22
uuid = "48a634ad-e948-5137-8d70-aa71f2a747f4"
3-
version = "1.16.0"
3+
version = "1.16.1"
44

55
[deps]
66
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
@@ -15,6 +15,8 @@ ForwardDiff = "0.10"
1515
SIMD = "2, 3"
1616
PrecompileTools = "1"
1717
StaticArrays = "1"
18+
LinearAlgebra = "1"
19+
Statistics = "1"
1820
julia = "1"
1921

2022
[extras]

docs/Manifest.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is machine-generated - editing it directly is not advised
22

3-
julia_version = "1.9.2"
3+
julia_version = "1.9.3"
44
manifest_format = "2.0"
55
project_hash = "063b18da735845e327fc97d98706d227f804d89d"
66

@@ -302,7 +302,7 @@ version = "1.10.0"
302302
deps = ["ForwardDiff", "LinearAlgebra", "PrecompileTools", "SIMD", "StaticArrays", "Statistics"]
303303
path = ".."
304304
uuid = "48a634ad-e948-5137-8d70-aa71f2a747f4"
305-
version = "1.15.0"
305+
version = "1.16.1"
306306

307307
[[deps.Test]]
308308
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]

src/voigt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ Base.@propagate_inbounds function tovoigt!(v::AbstractMatrix{T}, A::SymmetricTen
138138
end
139139

140140
# default voigt order (faster than custom voigt order)
141-
Base.@propagate_inbounds function _tovoigt!(v::AbstractVecOrMat{T}, A::SecondOrderTensor{dim,T}, ::Nothing; offset=0, offdiagscale=one(T)) where {dim,T}
141+
Base.@propagate_inbounds function _tovoigt!(v::AbstractVecOrMat{T}, A::SecondOrderTensor{dim}, ::Nothing; offset=0, offdiagscale=one(T)) where {dim,T}
142142
tuple_data, = _to_voigt_tuple(A, offdiagscale)
143143
for i in eachindex(tuple_data)
144144
v[offset+i] = tuple_data[i]
145145
end
146146
return v
147147
end
148-
Base.@propagate_inbounds function _tovoigt!(v::AbstractVecOrMat{T}, A::SymmetricTensor{4,dim,T}, ::Nothing; offdiagscale=one(T), offset_i=0, offset_j=0) where {dim,T}
148+
Base.@propagate_inbounds function _tovoigt!(v::AbstractVecOrMat{T}, A::SymmetricTensor{4,dim}, ::Nothing; offdiagscale=one(T), offset_i=0, offset_j=0) where {dim,T}
149149
tuple_data, N = _to_voigt_tuple(A, offdiagscale)
150150
cartesian = CartesianIndices(((offset_i+1):(offset_i+N), (offset_j+1):(offset_j+N)))
151151
for i in eachindex(tuple_data)
@@ -154,7 +154,7 @@ Base.@propagate_inbounds function _tovoigt!(v::AbstractVecOrMat{T}, A::Symmetric
154154
return v
155155
end
156156

157-
Base.@propagate_inbounds function _tovoigt!(v::AbstractVecOrMat{T}, A::Tensor{4,dim,T}, ::Nothing; kwargs...) where {dim,T}
157+
Base.@propagate_inbounds function _tovoigt!(v::AbstractVecOrMat{T}, A::Tensor{4,dim}, ::Nothing; kwargs...) where {dim,T}
158158
return _tovoigt!(v, A, DEFAULT_VOIGT_ORDER[dim]; kwargs...)
159159
end
160160

test/test_ops.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,16 @@ end
327327
@test (@inferred frommandel(Tensor{4,dim}, tomandel(AA))) AA
328328

329329
if T==Float64
330+
# Check that Boolean values are supported for fromvoigt
330331
num_components = Int((dim^2+dim)/2)
331332
@test isa(fromvoigt(SymmetricTensor{2,dim}, rand(num_components) .> 0.5), SymmetricTensor{2,dim,Bool})
332333
@test isa(fromvoigt(SymmetricTensor{4,dim}, rand(num_components,num_components) .> 0.5), SymmetricTensor{4,dim,Bool})
334+
335+
# Check that different types in the vector and tensor is supported via conversion
336+
@test tovoigt!(zeros(Float32, nc(A)), A)::Vector{Float32} tovoigt(A)
337+
@test tovoigt!(zeros(Float32, nc(A_sym)), A_sym)::Vector{Float32} tovoigt(A_sym)
338+
@test tovoigt!(zeros(Float32, nc(AA), nc(AA)), AA)::Matrix{Float32} tovoigt(AA)
339+
@test tovoigt!(zeros(Float32, nc(AA_sym), nc(AA_sym)), AA_sym)::Matrix{Float32} tovoigt(AA_sym)
333340
end
334341

335342
# Static voigt/mandel that use default order

0 commit comments

Comments
 (0)