Skip to content

Commit

Permalink
fix type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ejmeitz committed Sep 1, 2024
1 parent 293e1da commit 1b32d0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/bravais/2D_bravais.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ end

#####

function Rectangular(a, b, atomic_symbol::Symbol, N::SVector{2}; charge = 0.0u"C") where T
function Rectangular(a::T, b::T, atomic_symbol::Symbol, N::SVector{2}; charge = 0.0u"C") where T
lattice = BravaisLattice(RectangularLattice(a, b), Primitive())
basis = [Atom(atomic_symbol, [zero(a),zero(b)], charge = charge)]
return Crystal(lattice,basis,N)
end

function Rectangular(a, b, atomic_mass::Number, N::SVector{2}; charge = 0.0u"C") where T
function Rectangular(a::T, b::T, atomic_mass::Number, N::SVector{2}; charge = 0.0u"C") where T
lattice = BravaisLattice(RectangularLattice(a, b), Primitive())
basis = [Atom([zero(a),zero(b)], atomic_mass, charge = charge)]
return Crystal(lattice,basis,N)
Expand Down Expand Up @@ -55,27 +55,27 @@ end

#####

function Square(a, atomic_symbol::Symbol, N::SVector{2}; charge = 0.0u"C") where T
function Square(a::T, atomic_symbol::Symbol, N::SVector{2}; charge = 0.0u"C") where T
lattice = BravaisLattice(SquareLattice(a), Primitive())
basis = [Atom(atomic_symbol, [zero(a),zero(a)], charge = charge)]
return Crystal(lattice,basis,N)
end

function Square(a, atomic_mass::Number, N::SVector{2}; charge = 0.0u"C") where T
function Square(a::T, atomic_mass::Number, N::SVector{2}; charge = 0.0u"C") where T
lattice = BravaisLattice(SquareLattice(a), Primitive())
basis = [Atom([zero(a),zero(a)], atomic_mass, charge = charge)]
return Crystal(lattice,basis,N)
end

#####

function Hexagonal(a, atomic_symbol::Symbol, N::SVector{2}; charge = 0.0u"C") where T
function Hexagonal(a::T, atomic_symbol::Symbol, N::SVector{2}; charge = 0.0u"C") where T
lattice = BravaisLattice(Hexagonal2DLattice(a), Primitive())
basis = [Atom(atomic_symbol, [zero(a),zero(a)], charge = charge)]
return Crystal(lattice,basis,N)
end

function Hexagonal(a, atomic_mass::Number, N::SVector{2}; charge = 0.0u"C") where T
function Hexagonal(a::T, atomic_mass::Number, N::SVector{2}; charge = 0.0u"C") where T
lattice = BravaisLattice(Hexagonal2DLattice(a), Primitive())
basis = [Atom([zero(a),zero(a)], atomic_mass, charge = charge)]
return Crystal(lattice,basis,N)
Expand Down
4 changes: 2 additions & 2 deletions src/bravais/3D_bravais.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function SC(a::T, atomic_symbol::Symbol, N::SVector{3}; charge = 0.0u"C") where
return Crystal(lattice,basis,N)
end

function SC(a::T, atomic_mass::Number, N::SVector{3}; charge = 0.0u"C")
function SC(a::T, atomic_mass::Number, N::SVector{3}; charge = 0.0u"C") where T
lattice = BravaisLattice(CubicLattice(a), Primitive())
basis = [Atom([zero(a), zero(a), zero(a)], atomic_mass, charge = charge)]
return Crystal(lattice,basis,N)
Expand Down Expand Up @@ -109,7 +109,7 @@ function MonoclinicBaseCentered(a::T, b::T, c::T, β::T, atomic_symbol::Symbol,
return Crystal(lattice,basis,N)
end

function MonoclinicBaseCentered(a::T, b::T, c::T, β::T, atomic_mass::Number, N::SVector{3}; charge = 0.0u"C")
function MonoclinicBaseCentered(a::T, b::T, c::T, β::T, atomic_mass::Number, N::SVector{3}; charge = 0.0u"C") where T
float_type = typeof(ustrip(a))
half_a = float_type(0.5)*a
half_b = float_type(0.5)*b
Expand Down

0 comments on commit 1b32d0e

Please sign in to comment.