-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add aiida-pseudo dependency. - Install SSSP/1.3/PBE/efficiency pseudo using aiida-sssp - Add an example run
- Loading branch information
1 parent
4258780
commit 9d986c1
Showing
7 changed files
with
165 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
8 | ||
Lattice="5.43 0.0 0.0 0.0 5.43 0.0 0.0 0.0 5.43" Properties=species:S:1:pos:R:3:spacegroup_kinds:I:1 spacegroup="F d -3 m" unit_cell=conventional pbc="T T T" | ||
Si 0.00000000 0.00000000 0.00000000 0 | ||
Si 0.00000000 2.71500000 2.71500000 0 | ||
Si 2.71500000 2.71500000 0.00000000 0 | ||
Si 2.71500000 0.00000000 2.71500000 0 | ||
Si 4.07250000 1.35750000 4.07250000 0 | ||
Si 1.35750000 1.35750000 1.35750000 0 | ||
Si 1.35750000 4.07250000 4.07250000 0 | ||
Si 4.07250000 4.07250000 1.35750000 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
############################################################################### | ||
# Copyright (c), The AiiDA-CP2K authors. # | ||
# SPDX-License-Identifier: MIT # | ||
# AiiDA-CP2K is hosted on GitHub at https://github.com/aiidateam/aiida-cp2k # | ||
# For further information on the license, see the LICENSE.txt file. # | ||
############################################################################### | ||
"""Run simple DFT with calculation with SIRIUS.""" | ||
|
||
import os | ||
import sys | ||
|
||
import ase.io | ||
import click | ||
from aiida import common, engine, orm, plugins | ||
|
||
StructureData = plugins.DataFactory("core.structure") | ||
|
||
|
||
def example_sirius(cp2k_code): | ||
"""Run simple DFT calculation.""" | ||
|
||
print("Testing CP2K SIRIUS ENERGY on Si (DFT)...") | ||
|
||
thisdir = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
# Structure. | ||
structure = StructureData( | ||
ase=ase.io.read(os.path.join(thisdir, "..", "files", "si.xyz")) | ||
) | ||
|
||
# Parameters. | ||
parameters = orm.Dict( | ||
{ | ||
"FORCE_EVAL": { | ||
"METHOD": "SIRIUS", | ||
"STRESS_TENSOR": "ANALYTICAL", | ||
"PRINT": { | ||
"FORCES": {"FILENAME": "requested-forces", "ADD_LAST": "SYMBOLIC"} | ||
}, | ||
"PW_DFT": { | ||
"CONTROL": {"VERBOSITY": 2}, | ||
"PARAMETERS": { | ||
"ELECTRONIC_STRUCTURE_METHOD": "pseudopotential", | ||
"USE_SYMMETRY": True, | ||
"GK_CUTOFF": 10, | ||
"PW_CUTOFF": 55, | ||
"ENERGY_TOL": 1e-15, | ||
"NUM_DFT_ITER": 400, | ||
"SMEARING": "FERMI_DIRAC", | ||
"SMEARING_WIDTH": 0.00225, | ||
}, | ||
"ITERATIVE_SOLVER": { | ||
"ENERGY_TOLERANCE": 0.001, | ||
"NUM_STEPS": 20, | ||
"SUBSPACE_SIZE": 4, | ||
"CONVERGE_BY_ENERGY": 1, | ||
}, | ||
}, | ||
"DFT": { | ||
"XC": { | ||
"XC_FUNCTIONAL": { | ||
"GGA_X_PBE": {"_": ""}, | ||
"GGA_C_PBE": {"_": ""}, | ||
} | ||
}, | ||
"PRINT": { | ||
"MO": { | ||
"_": "OFF", | ||
"ADD_LAST": "SYMBOLIC", | ||
"EIGENVALUES": True, | ||
"OCCUPATION_NUMBERS": True, | ||
"NDIGITS": 12, | ||
"EACH": {"CELL_OPT": 0, "GEO_OPT": 0, "MD": 0, "QS_SCF": 0}, | ||
}, | ||
"MULLIKEN": { | ||
"_": "ON", | ||
"ADD_LAST": "SYMBOLIC", | ||
"EACH": {"CELL_OPT": 0, "GEO_OPT": 0, "MD": 0}, | ||
}, | ||
"LOWDIN": {"_": "OFF"}, | ||
"HIRSHFELD": {"_": "OFF"}, | ||
}, | ||
}, | ||
"SUBSYS": { | ||
"KIND": [ | ||
{ | ||
"_": "Si", | ||
"POTENTIAL": "UPF Si.json", | ||
}, | ||
], | ||
}, | ||
}, | ||
} | ||
) | ||
|
||
# Construct process builder. | ||
builder = cp2k_code.get_builder() | ||
builder.structure = structure | ||
builder.parameters = parameters | ||
builder.code = cp2k_code | ||
pseudo_family = orm.load_group("SSSP/1.3/PBE/efficiency") | ||
builder.pseudos_upf = pseudo_family.get_pseudos(structure=structure) | ||
builder.metadata.options.resources = { | ||
"num_machines": 1, | ||
"num_mpiprocs_per_machine": 1, | ||
} | ||
builder.metadata.options.max_wallclock_seconds = 1 * 3 * 60 | ||
|
||
print("Submitted calculation...") | ||
engine.run(builder) | ||
|
||
|
||
@click.command("cli") | ||
@click.argument("codelabel") | ||
def cli(codelabel): | ||
"""Click interface.""" | ||
try: | ||
code = orm.load_code(codelabel) | ||
except common.NotExistent: | ||
print(f"The code '{codelabel}' does not exist.") | ||
sys.exit(1) | ||
example_sirius(code) | ||
|
||
|
||
if __name__ == "__main__": | ||
cli() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters