Skip to content

Commit

Permalink
fix some naming stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ejmeitz committed Nov 10, 2023
1 parent 807d78e commit 439345d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/ForceConstants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import CUDA: i32 #TODO: move to weakdep https://pkgdocs.julialang.org/v1/creatin


include("types.jl")
include("helper_funcs.jl")
include("interactions/LennardJones.jl")
include("interactions/SW.jl")
include("helper_funcs.jl")
include("second_order.jl")
include("third_order.jl")
include("fourth_order.jl")
Expand Down
14 changes: 7 additions & 7 deletions src/io.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export save_second_order, save_third_order,
parse_TDEP_second_order, parse_TDEP_second_order,
parse_TDEP_second_order, parse_TDEP_third_order,
parse_ModeCode_third_order, parse_LAMMPS_dynmat, parse_LAMMPS_third_order


Expand Down Expand Up @@ -127,7 +127,7 @@ function parse_TDEP_second_order(ifc_path::String, N_modes, energy_units::Symbol
throw(ArgumentError("Unsupported unit type: $(energy_units)"))
end

return SecondOrderMatrix(Φ, units, 0.0)
return DenseForceConstants(Φ, units, 0.0)

end

Expand All @@ -138,7 +138,7 @@ This function assumes that the force constants were calculated for the supercell
the unit-cell was remapped to the supercell with remap_forceconstants. This function is
not guranteed to work with the most recent version of TDEP.
"""
function parse_TDEP_thrid_order(ifc_path::String, N_modes, energy_units = :REAL)
function parse_TDEP_third_order(ifc_path::String, N_modes, energy_units = :REAL)
Ψ = zeros(N_modes, N_modes, N_modes)

open(ifc_path, "r") do f
Expand Down Expand Up @@ -190,7 +190,7 @@ function parse_TDEP_thrid_order(ifc_path::String, N_modes, energy_units = :REAL)
throw(ArgumentError("Unsupported unit type: $(energy_units)"))
end

return ThirdOrderMatrix(Ψ, units, 0.0)
return DenseForceConstants(Ψ, units, 0.0)
end

"""
Expand Down Expand Up @@ -220,7 +220,7 @@ function parse_ModeCode_third_order(path::String, N_atoms::Int, unit_system::Sym
i, α, j, β, k, γ, data = F3_file_contents[line,:]
F3[Int((3*(i-1)) + α), Int((3*(j-1)) + β), Int((3*(k-1)) + γ)] = data*conversion_factor
end
return ThirdOrderMatrix(F3, units, 0.0)
return DenseForceConstants(F3, units, 0.0)
end

"""
Expand Down Expand Up @@ -253,7 +253,7 @@ function parse_LAMMPS_dynmat(path::String, N_atoms::Integer, units)
throw(ArgumentError("Unsupported unit_system: $(unit_system)"))
end

return SecondOrderMatrix(dynmat, units, 0.0)
return DenseForceConstants(dynmat, units, 0.0)
end
"""
Parses output from LAMMPS `third_order` command in the PHONON package
Expand All @@ -279,5 +279,5 @@ function parse_LAMMPS_third_order(path::String, N_atoms::Int, unit_system::Symbo
throw(ArgumentError("Unsupported unit_system: $(unit_system)"))
end

return ThirdOrderMatrix(F3, units, 0.0)
return DenseForceConstants(F3, units, 0.0)
end
18 changes: 9 additions & 9 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ end
#& Check that calculating sparse 3rd equals generating it from the dense
#& Various U_TEP tests, per mode vs total vs parallel vs serial

pot = LJ(3.4u"", 0.24037u"kcal * mol^-1", 8.5u"")
fcc_crystal = FCC(5.2468u"", :Ar, SVector(4,4,4))
sys = SuperCellSystem(fcc_crystal)
dynmat = dynamicalMatrix(sys, pot, 1e-12);
freqs_sq, phi = get_modes(dynmat, 3)
ifc3 = third_order_IFC(sys, pot, 1e-12)
m = 39.95
ifc3_mw = mass_weight_third_order!(ifc3, m*ones(length(fcc_crystal)))
K3 = mcc3(CuArray{Float32}(ifc3_mw.values), CuArray{Float32}(phi), 256, 1e-12)
# pot = LJ(3.4u"Å", 0.24037u"kcal * mol^-1", 8.5u"Å")
# fcc_crystal = FCC(5.2468u"Å", :Ar, SVector(4,4,4))
# sys = SuperCellSystem(fcc_crystal)
# dynmat = dynamicalMatrix(sys, pot, 1e-12);
# freqs_sq, phi = get_modes(dynmat, 3)
# ifc3 = third_order_IFC(sys, pot, 1e-12)
# m = 39.95
# ifc3_mw = mass_weight_third_order!(ifc3, m*ones(length(fcc_crystal)))
# K3 = mcc3(CuArray{Float32}(ifc3_mw.values), CuArray{Float32}(phi), 256, 1e-12)

# @testset "Supercell vs Unitcell" begin

Expand Down

0 comments on commit 439345d

Please sign in to comment.