diff --git a/Project.toml b/Project.toml index 647c5449..58ad5d2b 100644 --- a/Project.toml +++ b/Project.toml @@ -12,6 +12,7 @@ EquationsOfStateOfSolids = "1eaa2786-f833-4167-8397-974edad0881e" ExpressBase = "6bf22d12-b2e3-4e51-8f6d-9d050a32c5d5" PyQHA = "5a1273f0-a906-4eb0-8178-7035f457d819" SimpleWorkflows = "6a97d125-85da-4b66-b300-4bba10360563" +Spglib = "f761d5c5-86db-4880-b97f-9680a7cccfb5" Thinkers = "6d80a3f9-a943-41fa-97b3-3004c0daf7a3" Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" UnitfulParsableString = "06c00241-927a-4d5b-bb5e-6b5a2ada3567" diff --git a/src/EquationOfStateWorkflow/Recipes.jl b/src/EquationOfStateWorkflow/Recipes.jl index cefcd5b6..ca7f8262 100644 --- a/src/EquationOfStateWorkflow/Recipes.jl +++ b/src/EquationOfStateWorkflow/Recipes.jl @@ -16,6 +16,7 @@ using ..EquationOfStateWorkflow: RunCmd, ExtractData, ExtractCell, + DetectSymmetries, SaveCell, GatherData, SaveData, @@ -102,6 +103,7 @@ function stage(::VariableCellOptimization, r::ParallelEosFittingRecipe, ::Val{2} RunCmd(VariableCellOptimization()), ExtractCell(VariableCellOptimization()), SaveCell(VariableCellOptimization()), + DetectSymmetries(VariableCellOptimization()), ExtractData(VariableCellOptimization()), GatherData(VariableCellOptimization()), SaveData(VariableCellOptimization()), @@ -133,6 +135,10 @@ function stage(::VariableCellOptimization, r::ParallelEosFittingRecipe, ::Val{2} savecells = map( thunk -> ArgDependentJob(thunk; name="save cell in vc-relax"), first(iterate(steps)) ) + detectsymmetries = map( + thunk -> ArgDependentJob(thunk; name="detect symmetries of cells"), + first(iterate(steps)), + ) extractdata = map( thunk -> ConditionalJob(thunk; name="extract E(V) data in vc-relax"), first(iterate(steps)), @@ -147,6 +153,7 @@ function stage(::VariableCellOptimization, r::ParallelEosFittingRecipe, ::Val{2} makeinputs .→ writeinputs .→ runcmds .→ extractdata .→ gatherdata → fiteos → saveparams gatherdata → savedata runcmds .→ extractcells .→ savecells + extractcells .→ detectsymmetries return (; compute=compute, makeinputs=makeinputs, @@ -154,6 +161,7 @@ function stage(::VariableCellOptimization, r::ParallelEosFittingRecipe, ::Val{2} runcmds=runcmds, extractcells=extractcells, savecells=savecells, + detectsymmetries=detectsymmetries, extractdata=extractdata, gatherdata=gatherdata, savedata=savedata, diff --git a/src/EquationOfStateWorkflow/actions.jl b/src/EquationOfStateWorkflow/actions.jl index 9f11066d..9ed200d1 100644 --- a/src/EquationOfStateWorkflow/actions.jl +++ b/src/EquationOfStateWorkflow/actions.jl @@ -26,6 +26,7 @@ using ExpressBase: WriteInput using ExpressBase.Config: _uparse using ExpressBase.Files: save, load, extension +using Spglib: get_dataset using Unitful: Pressure, Volume using UnitfulParsableString: string @@ -58,6 +59,11 @@ struct ExtractCell{T} <: Action{T} calculation::T end +struct DetectSymmetries{T} <: Action{T} + calculation::T +end +(::DetectSymmetries)(cell) = get_dataset(cell) + struct GatherData{T} <: Action{T} calculation::T end diff --git a/src/EquationOfStateWorkflow/think.jl b/src/EquationOfStateWorkflow/think.jl index 9f3b2200..ee00595e 100644 --- a/src/EquationOfStateWorkflow/think.jl +++ b/src/EquationOfStateWorkflow/think.jl @@ -38,6 +38,8 @@ think(action::SaveCell, conf::Conf) = collect( ), ) for file in last.(conf.io) ) +think(action::DetectSymmetries, conf::Conf) = + collect(Thunk(action, file) for file in last.(conf.io)) think(action::GatherData, ::Conf) = Thunk(action) think(action::SaveData, conf::Conf) = Thunk(action(conf.data.raw)) think(action::SaveParameters, conf::Conf) = Thunk(action(conf.data.eos_params))