Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ DFTKWriteVTKExt = "WriteVTK"
[compat]
AbstractFFTs = "1"
Artifacts = "1"
AtomsBase = "0.3.1"
AtomsCalculators = "0.1"
AtomsBase = "0.4"
AtomsCalculators = "0.2"
Brillouin = "0.5.14"
CUDA = "5"
ChainRulesCore = "1.15"
Expand Down
2 changes: 1 addition & 1 deletion src/Model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# A physical specification of a model.
# Contains the geometry information, but no discretization parameters.
# The exact model used is defined by the list of terms.
struct Model{T <: Real, VT <: Real}
struct Model{T <: Real, VT <: Real} <: AbstractSystem{3}
# T is the default type to express data, VT the corresponding bare value type (i.e. not dual)

# Human-readable name for the model (like LDA, PBE, ...)
Expand Down
8 changes: 8 additions & 0 deletions src/external/atomsbase.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
using AtomsBase
# Key functionality to integrate DFTK and AtomsBase

# implement AtomsBase interface directly on `Model` object
Base.length(m::Model) = length(m.atoms)
Base.getindex(m::Model, i) = m.atoms[i]
position(m::Model, i) = DFTK.vector_red_to_cart(m, m.positions[i]) * u"a0_au"
mass(m::Model, i) = m[i].mass
species(m::Model, i) = m[i].symbol
cell(m::Model) = PeriodicCell((m.lattice[:,1], m.lattice[:,2], m.lattice[:,3]), (true, true, true))

function parse_system(system::AbstractSystem{D}) where {D}
if !all(periodicity(system))
error("DFTK only supports calculations with periodic boundary conditions.")
Expand Down