From ec55b10ec83a3904e818b2c25640f40ab7a9f406 Mon Sep 17 00:00:00 2001 From: singularitti Date: Sun, 19 Nov 2023 01:17:55 -0500 Subject: [PATCH 1/4] Add Spglib.jl to deps --- Project.toml | 1 + 1 file changed, 1 insertion(+) 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" From 53e3419d443894a72b1a122c3e04935b850147f9 Mon Sep 17 00:00:00 2001 From: singularitti Date: Sun, 19 Nov 2023 01:18:42 -0500 Subject: [PATCH 2/4] Add action `DetectSymmetries` using `get_dataset` --- src/EquationOfStateWorkflow/actions.jl | 6 ++++++ 1 file changed, 6 insertions(+) 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 From 7248ca6fcfe9f86c2e66d0b47d3ba542c1b93073 Mon Sep 17 00:00:00 2001 From: singularitti Date: Sun, 19 Nov 2023 01:18:52 -0500 Subject: [PATCH 3/4] Add `think` for `DetectSymmetries` --- src/EquationOfStateWorkflow/think.jl | 2 ++ 1 file changed, 2 insertions(+) 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)) From ea305f873a52f457fd12c4335819c2b9d03f7a4a Mon Sep 17 00:00:00 2001 From: singularitti Date: Sun, 19 Nov 2023 01:19:08 -0500 Subject: [PATCH 4/4] Add `DetectSymmetries` to Recipes.jl --- src/EquationOfStateWorkflow/Recipes.jl | 8 ++++++++ 1 file changed, 8 insertions(+) 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,