Skip to content

Commit

Permalink
Rename CrystalCoordinates to CrystalCoordinates, but keep an alias
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Sep 25, 2023
1 parent 45923e3 commit fee1e4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ using StructEquality: @struct_hash_equal_isequal

export Cell, natoms, atomtypes

struct CrystalCoordinates{T} <: FieldVector{3,T}
struct ReducedCoordinates{T} <: FieldVector{3,T}
x::T
y::T
z::T
end
const CrystalCoordinates = ReducedCoordinates

abstract type AbstractCell end
@struct_hash_equal_isequal struct Cell{N,L,P,T} <: AbstractCell
lattice::Lattice{L}
positions::SVector{N,CrystalCoordinates{P}}
positions::SVector{N,ReducedCoordinates{P}}
atoms::SVector{N,T}
end
"""
Expand All @@ -36,7 +37,7 @@ function Cell(lattice, positions, atoms)
end
N = length(positions)
P = reduce(promote_type, eltype.(positions))
positions = map(CrystalCoordinates{P}, positions)
positions = map(ReducedCoordinates{P}, positions)
L, T = eltype(lattice), eltype(atoms)
return Cell{N,L,P,T}(lattice, positions, atoms)
end
Expand Down

0 comments on commit fee1e4c

Please sign in to comment.