From 88e729c351fe6d56ab7fd37ebb748950a3b87dfb Mon Sep 17 00:00:00 2001 From: Kristjan Eimre Date: Sun, 24 Jul 2022 19:09:05 +0000 Subject: [PATCH 1/2] pdos adaptive ADDED_MOS --- pdos/pdos_workchain.py | 27 ++++++++++++++++++--------- stm/stm_workchain.py | 2 +- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/pdos/pdos_workchain.py b/pdos/pdos_workchain.py index 5a2e2b0..291d49c 100644 --- a/pdos/pdos_workchain.py +++ b/pdos/pdos_workchain.py @@ -89,7 +89,10 @@ 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( @@ -97,7 +100,8 @@ def run_scfs(self): 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) @@ -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) @@ -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'] = {} @@ -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) @@ -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'] = {} @@ -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) @@ -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': { @@ -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']: @@ -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': { @@ -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': { '_': '', diff --git a/stm/stm_workchain.py b/stm/stm_workchain.py index 6a8ef33..36f5cc6 100644 --- a/stm/stm_workchain.py +++ b/stm/stm_workchain.py @@ -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, From c01a3e19e7265c0cda7c629deb4b05fd7b73a430 Mon Sep 17 00:00:00 2001 From: Kristjan Eimre Date: Sun, 24 Jul 2022 19:10:16 +0000 Subject: [PATCH 2/2] prepare release 1.8.5 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 01d6121..3a92ef2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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