Skip to content

Commit

Permalink
Merge pull request #28 from nanotech-empa/release/1.8.5
Browse files Browse the repository at this point in the history
Release/1.8.5
  • Loading branch information
eimrek authored Jul 24, 2022
2 parents cb5b9bd + c01a3e1 commit 2cb0f88
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
27 changes: 18 additions & 9 deletions pdos/pdos_workchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,19 @@ def setup(self):

def run_scfs(self):
self.report("Running CP2K diagonalization SCF")


emax1 = float(self.inputs.overlap_params.get_dict()['--emax1'])
nlumo2 = int(self.inputs.overlap_params.get_dict()['--nlumo2'])

self.ctx.n_all_atoms = len(self.inputs.slabsys_structure.sites)

slab_inputs = self.build_slab_cp2k_inputs(
self.inputs.slabsys_structure,
self.inputs.pdos_lists,
self.inputs.cp2k_code,
self.inputs.wfn_file_path.value,
self.inputs.dft_params.get_dict())
self.inputs.dft_params.get_dict(),
emax1)
self.report("slab_inputs: "+str(slab_inputs))

slab_future = self.submit(Cp2kCalculation, **slab_inputs)
Expand All @@ -106,7 +110,8 @@ def run_scfs(self):
mol_inputs = self.build_mol_cp2k_inputs(
self.inputs.mol_structure,
self.inputs.cp2k_code,
self.ctx.mol_dft_params)
self.ctx.mol_dft_params,
nlumo2)
self.report("mol_inputs: "+str(mol_inputs))

mol_future = self.submit(Cp2kCalculation, **mol_inputs)
Expand Down Expand Up @@ -152,7 +157,7 @@ def finalize(self):
# ==========================================================================
@classmethod
def build_slab_cp2k_inputs(cls, structure, pdos_lists, code,
wfn_file_path, dft_params):
wfn_file_path, dft_params, emax):

inputs = {}
inputs['metadata'] = {}
Expand Down Expand Up @@ -192,11 +197,14 @@ def build_slab_cp2k_inputs(cls, structure, pdos_lists, code,
wfn_file = ""
if wfn_file_path != "":
wfn_file = os.path.basename(wfn_file_path)

added_mos = np.max([100, int(n_atoms*emax/5.0)])

inp = cls.get_cp2k_input(dft_params,
cell_abc,
walltime*0.97,
wfn_file,
added_mos,
atoms,
pdos_lists)

Expand All @@ -220,7 +228,7 @@ def build_slab_cp2k_inputs(cls, structure, pdos_lists, code,

# ==========================================================================
@classmethod
def build_mol_cp2k_inputs(cls, structure, code, dft_params):
def build_mol_cp2k_inputs(cls, structure, code, dft_params, nlumo):

inputs = {}
inputs['metadata'] = {}
Expand Down Expand Up @@ -256,6 +264,7 @@ def build_mol_cp2k_inputs(cls, structure, code, dft_params):
cell_abc,
walltime*0.97,
"",
nlumo+2,
atoms)

inputs['parameters'] = Dict(dict=inp)
Expand All @@ -276,7 +285,7 @@ def build_mol_cp2k_inputs(cls, structure, code, dft_params):

# ==========================================================================
@classmethod
def get_cp2k_input(cls, dft_params, cell_abc, walltime, wfn_file, atoms, pdos_lists=None):
def get_cp2k_input(cls, dft_params, cell_abc, walltime, wfn_file, added_mos, atoms, pdos_lists=None):

inp = {
'GLOBAL': {
Expand All @@ -286,7 +295,7 @@ def get_cp2k_input(cls, dft_params, cell_abc, walltime, wfn_file, atoms, pdos_li
'EXTENDED_FFT_LENGTHS': ''
},
'FORCE_EVAL': cls.get_force_eval_qs_dft(dft_params, cell_abc,
wfn_file, atoms, pdos_lists),
wfn_file, added_mos, atoms, pdos_lists),
}

if dft_params['elpa_switch']:
Expand All @@ -298,7 +307,7 @@ def get_cp2k_input(cls, dft_params, cell_abc, walltime, wfn_file, atoms, pdos_li

# ==========================================================================
@classmethod
def get_force_eval_qs_dft(cls, dft_params, cell_abc, wfn_file, atoms, pdos_lists=None):
def get_force_eval_qs_dft(cls, dft_params, cell_abc, wfn_file, added_mos, atoms, pdos_lists=None):
force_eval = {
'METHOD': 'Quickstep',
'DFT': {
Expand All @@ -319,7 +328,7 @@ def get_force_eval_qs_dft(cls, dft_params, cell_abc, wfn_file, atoms, pdos_lists
'MAX_SCF': '1000',
'SCF_GUESS': 'RESTART',
'EPS_SCF': '1.0E-7',
'ADDED_MOS': '800',
'ADDED_MOS': str(added_mos),
'CHOLESKY': 'INVERSE',
'DIAGONALIZATION': {
'_': '',
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title = Empa nanotech@surfaces Laboratory - Scanning Probe Microscopy

[metadata]
name = scanning_probe
version = 1.8.4
version = 1.8.5
author = nanotech@surfaces laboratory, Empa
description = App to run scanning probe microscopy simulations.
long_description = file: README.md
Expand Down
2 changes: 1 addition & 1 deletion stm/stm_workchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def build_cp2k_inputs(cls, structure, code, dft_params, wfn_file_path, emax):
if wfn_file_path != "":
wfn_file = os.path.basename(wfn_file_path)

added_mos = np.max([100, int(n_atoms*emax/6.0)])
added_mos = np.max([100, int(n_atoms*emax/5.0)])

inp = cls.get_cp2k_input(dft_params,
cell_abc,
Expand Down

0 comments on commit 2cb0f88

Please sign in to comment.