Open DRollin opened 1 year ago
Regarding mixed tensors, Knut was so nice and started putting something together in this PR: https://github.com/Ferrite-FEM/Tensors.jl/pull/188 .
Perhaps a @setindex
macro could be used for the mutable part, something like
@setindex a[1,:] = a[1,:] + v[:]
# Generates the expression
a = typeof(a)((i,j) -> (i == 1) ? a[i,j] + v[j] : a[i,j]
3rd order (partially) supported by #205
Regarding mutability, perhaps a similar strategy to StaticArrays could be useful, overloading the non-exported Base.setindex
?
https://juliaarrays.github.io/StaticArrays.jl/stable/pages/api/#Base.setindex-Tuple{StaticArray,%20Any,%20Int64}
Hello,
I am currently working with sensitivities in multi-scale modelling. In one case I am considering, third order tensors are used. However, third order tensors are apparently not full supported e.g.
zero(Tensor{3,dim})
errors. I created a quick solution for my code, but probably it would be nice to have that in general.Furthermore, the sensitivities are computed part by part, so they are tensors that need to be adapted. This adaption is like inserting a tensor into another tensor of higher order. In my case I do the operation using arrays, but maybe it would also be nice to have a general solution for that like mutable tensors or functions doing the insertion.
Just two suggestions. What do you think? I am also willing to contribute, I am just still a bit unexperienced.