Skip to content

Commit

Permalink
missed some atomic_mass...oops
Browse files Browse the repository at this point in the history
  • Loading branch information
ejmeitz committed Sep 1, 2024
1 parent 1b32d0e commit a72046a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Crystal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function get_coordinates(lattice::BravaisLattice{D}, basis, N::SVector{D}) where
lattice_pt = Vector(lattice[n...])
for (j,basis_atom) in enumerate(basis)
atoms[N_basis_atoms*i + j] = Atom(atomic_symbol(basis_atom), lattice_pt .+ basis_atom.position;
charge = charge(basis_atom), mass = atomic_mass(basis_atom))
charge = charge(basis_atom), mass = mass(basis_atom))
end
end

Expand Down Expand Up @@ -101,9 +101,9 @@ AtomsBase.velocity(sys::Crystal) = missing #zeros(size(sys.atoms)) * u"m * s^-1"
AtomsBase.velocity(sys::Crystal, i::Integer) = missing #zeros(size(sys.atoms[i]))* u"m * s^-1"
AtomsBase.velocity(sys::Crystal, ::Colon) = missing

AtomsBase.mass(sys::Crystal) = atomic_mass.(sys.atoms)
AtomsBase.mass(sys::Crystal, i::Integer) = atomic_mass(sys.atoms[i])
AtomsBase.mass(sys::Crystal, ::Colon) = atomic_mass.(sys.atoms)
AtomsBase.mass(sys::Crystal) = mass.(sys.atoms)
AtomsBase.mass(sys::Crystal, i::Integer) = mass(sys.atoms[i])
AtomsBase.mass(sys::Crystal, ::Colon) = mass.(sys.atoms)

AtomsBase.atomic_symbol(sys::Crystal) = atomic_symbol.(sys.atoms)
AtomsBase.atomic_symbol(sys::Crystal, i::Integer) = atomic_symbol(sys.atoms[i])
Expand Down
4 changes: 2 additions & 2 deletions src/atom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ AtomsBase.velocity(atom::Atom) = missing
AtomsBase.n_dimensions(::Atom{D}) where D = D

function Base.show(io::IO, atom::Atom)
print(io, "Atom at $(round.(ustrip.(atom.position), digits = 3)), with charge: $(charge(atom)) and mass : $(atomic_mass(atom)) ")
print(io, "Atom at $(round.(ustrip.(atom.position), digits = 3)), with charge: $(charge(atom)) and mass : $(mass(atom)) ")
end


function Base.show(io::IO, ::MIME"text/plain", atom::Atom)
print(io, "Atom at $(round.(ustrip.(atom.position), digits = 3)), with charge: $(charge(atom)) and mass : $(atomic_mass(atom)) ")
print(io, "Atom at $(round.(ustrip.(atom.position), digits = 3)), with charge: $(charge(atom)) and mass : $(mass(atom)) ")
end
2 changes: 1 addition & 1 deletion src/bravais/3D_bravais.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function FCC(a::T, atomic_symbol::Symbol, N::SVector{3}; charge = 0.0u"C") where
return Crystal(lattice, basis, N)
end

function FCC(a, atomic_mass::Number, N::SVector{3}; charge = 0.0u"C") where T
function FCC(a::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
lattice = BravaisLattice(CubicLattice(a), Primitive())
Expand Down

0 comments on commit a72046a

Please sign in to comment.