Skip to content

Commit

Permalink
Fix CreateInput & customizer to accept Cell
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Oct 24, 2023
1 parent d290aa5 commit 36d6074
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/EquationOfStateWorkflow/actions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@ using AbInitioSoftwareBase: Setter
using Dates: format, now
using EquationsOfStateOfSolids: PressureEquation, Parameters, getparam, vsolve
using ExpressBase: SelfConsistentField, FixedCellOptimization, VariableCellOptimization
using QuantumESPRESSO.PWscf: PWInput, VerbositySetter, VolumeSetter, PressureSetter
using QuantumESPRESSO.PWscf:
CellParametersCard,
AtomicPositionsCard,
PWInput,
VerbositySetter,
VolumeSetter,
PressureSetter,
CardSetter
using Setfield: @set!
using UnifiedPseudopotentialFormat # To work with `download_potential`
using Unitful: Pressure, Volume, @u_str
using UnitfulAtomic

import Express.EquationOfStateWorkflow: CreateInput, FitEquationOfState

(::CreateInput{T})(template::PWInput, volume) where {T} =
(customizer(volume) normalizer(T()))(template)
(::CreateInput{T})(template::PWInput, volume_or_cell) where {T} =
(customizer(volume_or_cell) normalizer(T()))(template)

struct CalculationSetter{T} <: Setter
calculation::T
Expand Down Expand Up @@ -56,3 +63,6 @@ function (x::OutdirSetter)(template::PWInput)
end

customizer(volume::Volume) = OutdirSetter("Y-m-d_H:M:S") VolumeSetter(volume)
customizer(cell::Cell) =
OutdirSetter("Y-m-d_H:M:S") CardSetter(CellParametersCard(cell))
CardSetter(AtomicPositionsCard(cell))

0 comments on commit 36d6074

Please sign in to comment.