Skip to content

Commit

Permalink
fix change_kpoints!
Browse files Browse the repository at this point in the history
  • Loading branch information
louisponet committed Mar 11, 2018
1 parent d81439e commit f31062a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion notes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TODO:
-> Implement error checking!

TODO: pseudos
TODO:
7 changes: 6 additions & 1 deletion src/DFControl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ module DFControl
using RecipesBase
using StaticArrays
using GeometryTypes
include("types.jl")

include("atom.jl")
export element
export AbstractAtom
export Atom

include("structure.jl")
export AbstractStructure
export Structure
export cif2structure

include("types.jl")
export Band
export DFBand

Expand Down
2 changes: 1 addition & 1 deletion src/job.jl
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ function undo(job::DFJob)
end

"""
add_bands_calculation!(job::DFJob, k_path::Array{Array{<:AbstractFloat,1},1})
add_bands_calculation!(job::DFJob, k_path::Vector{Vector{T}}; filename="bands.in", run=true) where T<:AbstractFloat
Checks if there is an scf calculation in the job and takes it's inputs to generate a bands calculation along the given k-path.
"""
Expand Down
4 changes: 2 additions & 2 deletions src/qe/input.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ end
Changes the data in the k point `DataBlock` inside the specified calculation. The format is `[(ka, kb, kc, nk),...]`. This format is to be used with a `'bands'` calculation.
"""
function change_kpoints!(input::QEInput, k_grid::Vector{NTuple{4, <:AbstractFloat}}; print=true, k_option=:crystal_b)
function change_kpoints!(input::QEInput, k_grid::Vector{NTuple{4, T}}; print=true, k_option=:crystal_b) where T<:AbstractFloat
calc = get_flag(input, :calculation)
@assert calc == "'bands'" warn("Expected calculation to be 'bands', got $calc.")
@assert k_option in [:tpiba_b, :crystal_b, :tpiba_c, :crystal_c] error("Only $([:tpiba_b, :crystal_b, :tpiba_c, :crystal_c]...) are allowed as a k_option, got $k_option.")
Expand All @@ -213,6 +213,6 @@ function change_kpoints!(input::QEInput, k_grid::Vector{NTuple{4, <:AbstractFloa
otherwise bands won't get printed.")
end
end
change_data!(input, :k_points, k_grid, option = k_option, print)
change_data!(input, :k_points, k_grid, option = k_option, print = print)
return input
end
2 changes: 0 additions & 2 deletions src/types.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Base.convert(::Type{Point3{T}}, x::Vector{T}) where T<:AbstractFloat = Point3{T}(x[1], x[2], x[3])

include("atom.jl")
include("structure.jl")

abstract type Band end

Expand Down

0 comments on commit f31062a

Please sign in to comment.