Skip to content

Commit

Permalink
Fix type-instability in lattice-field of Cell
Browse files Browse the repository at this point in the history
`MMatrix{3,3,L}` is not a concrete type, unfortunately. I figured I'd suggest changing this so inference of `getfield(::Cell, :lattice)` isn't poisoned.

The same problem affects the `positions` but it cannot be fixed simply while retaining the `MMatrix` approach cf. JuliaLang/julia#18466: personally, I think it'd make more sense to treat that as a `Vector{MVector{3,P}}` - it doesn't seem worthwhile to specialize to how many atoms are in a cell. Anyway, that is a larger change and I just wanted to do the minimal change here.
  • Loading branch information
thchr committed Dec 3, 2021
1 parent 9ec8ed5 commit dbc1db1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The collinear polarizations `magmoms` only work with `get_symmetry` and are give
as a list of ``N`` floating point values.
"""
struct Cell{N,L,P,T,M}
lattice::MMatrix{3,3,L}
lattice::MMatrix{3,3,L,9}
positions::MMatrix{3,N,P}
types::MVector{N,T}
magmoms::MVector{N,M}
Expand Down

0 comments on commit dbc1db1

Please sign in to comment.