From d13ed86d5dddfd7e05a79e16716ab1857936b6f2 Mon Sep 17 00:00:00 2001 From: singularitti Date: Sun, 19 Nov 2023 23:11:56 -0500 Subject: [PATCH] Rename `DensityFunctionalPerturbationTheory` & `RealSpaceForceConstants` --- src/Phonon/Config.jl | 8 ++++---- src/Phonon/actions.jl | 20 +++++++++----------- src/QuantumESPRESSOExpress.jl | 8 ++++---- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/Phonon/Config.jl b/src/Phonon/Config.jl index d700ab7..4db34fb 100644 --- a/src/Phonon/Config.jl +++ b/src/Phonon/Config.jl @@ -4,8 +4,8 @@ using Configurations: OptionField using Express.Phonon.Config: StaticConfig using ExpressBase: SelfConsistentField, - DensityFunctionalPerturbationTheory, - RealSpaceForceConstants, + LinearResponse, + FourierTransform, PhononDispersion, PhononDensityOfStates using ExpressBase.Config: SoftwareConfig @@ -21,9 +21,9 @@ import Express.Phonon.Config: StaticConfig, _update! function _update!(conf, templates::Vector{String}) stage, T = if conf.calculation isa SelfConsistentField 1, PWInput - elseif conf.calculation isa DensityFunctionalPerturbationTheory + elseif conf.calculation isa LinearResponse 2, PhInput - elseif conf.calculation isa RealSpaceForceConstants + elseif conf.calculation isa FourierTransform 3, Q2rInput elseif conf.calculation isa PhononDispersion 4, MatdynInput diff --git a/src/Phonon/actions.jl b/src/Phonon/actions.jl index 06d42ee..9bd5e0e 100644 --- a/src/Phonon/actions.jl +++ b/src/Phonon/actions.jl @@ -3,8 +3,8 @@ using Dates: format, now using ExpressBase: Calculation, SelfConsistentField, - DensityFunctionalPerturbationTheory, - RealSpaceForceConstants, + LinearResponse, + FourierTransform, PhononDispersion, PhononDensityOfStates using QuantumESPRESSO.PWscf: @@ -32,13 +32,11 @@ end function (::CreateInput{SelfConsistentField})(template::PWInput, args...) return (customizer(args...) ∘ normalizer(SelfConsistentField(), template))(template) end -function (::CreateInput{DensityFunctionalPerturbationTheory})( - template::PhInput, previnp::PWInput -) - return normalizer(DensityFunctionalPerturbationTheory(), previnp)(template) +function (::CreateInput{LinearResponse})(template::PhInput, previnp::PWInput) + return normalizer(LinearResponse(), previnp)(template) end -function (::CreateInput{RealSpaceForceConstants})(template::Q2rInput, previnp::PhInput) - return normalizer(RealSpaceForceConstants(), previnp)(template) +function (::CreateInput{FourierTransform})(template::Q2rInput, previnp::PhInput) + return normalizer(FourierTransform(), previnp)(template) end function (::CreateInput{T})( template::MatdynInput, set::Set @@ -54,7 +52,7 @@ end action(template, b, a) struct CalculationSetter <: Setter - calc::Union{SelfConsistentField,DensityFunctionalPerturbationTheory} + calc::Union{SelfConsistentField,LinearResponse} end function (::CalculationSetter)(template::PWInput) @reset template.control.calculation = "scf" @@ -95,10 +93,10 @@ function normalizer(::SelfConsistentField, args...) return VerbositySetter("high") ∘ CalculationSetter(SelfConsistentField()) ∘ PseudoDirSetter() end -function normalizer(::DensityFunctionalPerturbationTheory, input::PWInput) +function normalizer(::LinearResponse, input::PWInput) return RelayArgumentsSetter(input) ∘ VerbositySetter("high") ∘ RecoverySetter() end -normalizer(::RealSpaceForceConstants, input::PhInput) = RelayArgumentsSetter(input) +normalizer(::FourierTransform, input::PhInput) = RelayArgumentsSetter(input) function normalizer( ::PhononDispersion, inputs::Union{Tuple{Q2rInput,PhInput},Tuple{PhInput,Q2rInput}} ) diff --git a/src/QuantumESPRESSOExpress.jl b/src/QuantumESPRESSOExpress.jl index a588797..918ed22 100644 --- a/src/QuantumESPRESSOExpress.jl +++ b/src/QuantumESPRESSOExpress.jl @@ -4,8 +4,8 @@ using AbInitioSoftwareBase: AbInitioSoftware using ExpressBase: SelfConsistentField, VariableCellOptimization, - DensityFunctionalPerturbationTheory, - RealSpaceForceConstants, + LinearResponse, + FourierTransform, PhononDispersion, PhononDensityOfStates using ExpressBase.Files: parentdir @@ -35,12 +35,12 @@ function (x::RunCmd{VariableCellOptimization})( ) return pw(input, output; kwargs...) end -function (x::RunCmd{DensityFunctionalPerturbationTheory})( +function (x::RunCmd{LinearResponse})( input, output=mktemp(parentdir(input))[1]; kwargs... ) return ph(input, output; kwargs...) end -function (x::RunCmd{RealSpaceForceConstants})( +function (x::RunCmd{FourierTransform})( input, output=mktemp(parentdir(input))[1]; kwargs... ) return q2r(input, output; kwargs...)