Ferrite-FEM / Ferrite-FEM/Tensors.jl

zero(x::MixedTensor) returns an array

Open
#245 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
182
Forks
40
PR merge metrics
No merged PRs in 30d

Description

```julia
julia> x = MixedTensor2{3,2}((1.0, 0.0, 0.0, 0.0, 1.0, 1.0))
3×2 MixedTensor2{3, 2, Float64, 6}:
1.0 0.0
0.0 1.0
0.0 1.0

julia> zero(x)
3×2 Matrix{Float64}:
0.0 0.0
0.0 0.0
0.0 0.0

julia> zero(typeof(x))
3×2 MixedTensor2{3, 2, Float64, 6}:
0.0 0.0
0.0 0.0
0.0 0.0
```
Because `MixedTensor` is not part of `Tensors.AllTensors` union, see constructors.jl, `@eval @inline Base.$op(t::AllTensors) = $op(typeof(t))` missing

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.