Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
cpignedoli committed Sep 25, 2024
1 parent 75d2f93 commit 84256d6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 273 deletions.
1 change: 0 additions & 1 deletion aiida_nanotech_empa/workflows/gaussian/nics_workchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from .relax_workchain import GaussianRelaxWorkChain
from .scf_workchain import GaussianScfWorkChain


@engine.calcfunction
def prepare_nmr_structure(structure, height):
ase_geo = structure.get_ase()
Expand Down
267 changes: 0 additions & 267 deletions aiida_nanotech_empa/workflows/gaussian/oldnics_workchain.py

This file was deleted.

25 changes: 20 additions & 5 deletions examples/workflows/example_gaussian_nics.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
import pathlib
import click
import numpy as np
from aiida import engine, orm
from aiida.plugins import WorkflowFactory
from ase.build import molecule
from ase.io import read

import aiida_nanotech_empa.utils.gaussian_wcs_postprocess as pp

GaussianNicsWorkChain = WorkflowFactory("nanotech_empa.gaussian.nics")

DATA_DIR = pathlib.Path(__file__).parent.absolute()
GEO_FILE="naphthalene.xyz"

def _example_gaussian_nics(gaussian_code, opt):
ase_geom = molecule("C6H6")
ase_geom.cell = np.diag([10.0, 10.0, 10.0])
# Check test geometry is already in database.
qb = orm.QueryBuilder()
qb.append(orm.Node, filters={"label": {"==": GEO_FILE}})
structure = None
for node_tuple in qb.iterall():
node = node_tuple[0]
structure = node
if structure is not None:
print("found existing structure: ", structure.pk)
else:
structure = orm.StructureData(ase=read(DATA_DIR / GEO_FILE))
structure.label = GEO_FILE
structure.store()
print("created new structure: ", structure.pk)

builder = GaussianNicsWorkChain.get_builder()
builder.gaussian_code = gaussian_code
builder.structure = orm.StructureData(ase=ase_geom)
builder.structure = structure
builder.functional = orm.Str("B3LYP")
builder.basis_set = orm.Str("6-311G(d,p)")
builder.opt = orm.Bool(opt)
Expand Down Expand Up @@ -43,7 +58,7 @@ def run_nics(gaussian_code):
# uuid = _example_gaussian_nics(orm.load_code(gaussian_code),True)
# print(f"WorkChain completed uuid: {uuid}")
print("#### Running Gaussian NICS WorkChain without geo_opt ####")
uuid = _example_gaussian_nics(orm.load_code(gaussian_code), False)
uuid = _example_gaussian_nics(orm.load_code(gaussian_code), True)
print(f"WorkChain completed uuid: {uuid}")


Expand Down
20 changes: 20 additions & 0 deletions examples/workflows/naphthalene.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
18
Properties=species:S:1:pos:R:3 napthalene=T pbc="F F F"
C 0.00000000 1.42000000 0.00000000
C 0.00000000 0.00000000 0.00000000
C 1.22975600 2.13000000 0.00000000
C 2.45951200 1.42000000 0.00000000
C 2.45951200 0.00000000 0.00000000
C 1.22975600 -0.71000000 0.00000000
C 3.68926800 -0.71000000 0.00000000
C 4.91902400 0.00000000 0.00000000
C 4.91902400 1.42000000 0.00000000
H -0.98726900 1.99000000 0.00000000
H -0.98726900 -0.57000000 0.00000000
H 1.22975600 3.27000000 0.00000000
H 1.22975600 -1.85000000 0.00000000
H 3.68926800 -1.85000000 0.00000000
H 3.68926800 3.27000000 0.00000000
H 5.90629300 1.99000000 0.00000000
H 5.90629300 -0.57000000 0.00000000
C 3.68926800 2.13000000 0.00000000

0 comments on commit 84256d6

Please sign in to comment.