Skip to content

Commit

Permalink
Merge pull request #300 from MineralsCloud:checksymmetry
Browse files Browse the repository at this point in the history
Add `DetectSymmetries`
  • Loading branch information
singularitti authored Nov 19, 2023
2 parents 4ba5618 + ea305f8 commit b9df6d9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions src/EquationOfStateWorkflow/Recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ using ..EquationOfStateWorkflow:
RunCmd,
ExtractData,
ExtractCell,
DetectSymmetries,
SaveCell,
GatherData,
SaveData,
Expand Down Expand Up @@ -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()),
Expand Down Expand Up @@ -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)),
Expand All @@ -147,13 +153,15 @@ 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,
writeinputs=writeinputs,
runcmds=runcmds,
extractcells=extractcells,
savecells=savecells,
detectsymmetries=detectsymmetries,
extractdata=extractdata,
gatherdata=gatherdata,
savedata=savedata,
Expand Down
6 changes: 6 additions & 0 deletions src/EquationOfStateWorkflow/actions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/EquationOfStateWorkflow/think.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b9df6d9

Please sign in to comment.