예제 #1
0
    def run_wannier90(self):
        try:
            remote_folder = self.ctx.calc_pw2wannier90.outputs.remote_folder
        except AttributeError:
            self.report(
                'the Pw2wannier90Calculation did not output a remote_folder node'
            )
            return self.exit_codes.ERROR_SUB_PROCESS_FAILED_WANNIER90

        # we need metadata in exposed_inputs
        inputs = AttributeDict(
            self.exposed_inputs(Wannier90Calculation, namespace='wannier90'))
        pp_inputs = self.ctx.calc_wannier90_pp.inputs
        pp_keys = [
            'code', 'parameters', 'kpoint_path', 'structure', 'kpoints',
            'settings'
        ]
        for key in pp_keys:
            inputs[key] = pp_inputs[key]

        inputs['remote_input_folder'] = remote_folder

        settings = inputs.settings.get_dict()
        settings['postproc_setup'] = False
        inputs.settings = settings

        inputs = prepare_process_inputs(Wannier90Calculation, inputs)
        running = self.submit(Wannier90Calculation, **inputs)

        self.report(
            'wannier90 step - launching Wannier90Calculation<{}>'.format(
                running.pk))

        return ToContext(calc_wannier90=running)
예제 #2
0
    def get_inputs_scf(self):
        """
        Get the input for the scf workchain after the fixed density matrix calculations
        to relax the density matrix
        """
        input_scf = AttributeDict(self.exposed_inputs(FleurScfWorkChain, namespace='scf_with_ldau'))

        if 'fleur' not in input_scf:
            input_scf.fleur = self.inputs.fleur

        if 'options' not in input_scf:
            input_scf.options = self.inputs.options

        if 'settings' not in input_scf:
            settings = {}
        else:
            settings = input_scf.settings.get_dict()

        if 'remove_from_remotecopy_list' not in settings:
            settings['remove_from_remotecopy_list'] = []
        settings['remove_from_remotecopy_list'].append('mixing_history*')

        if 'wf_parameters' not in input_scf:
            scf_wf_dict = {}
        else:
            scf_wf_dict = input_scf.wf_parameters.get_dict()

        if 'inpxml_changes' not in scf_wf_dict:
            scf_wf_dict['inpxml_changes'] = []

        scf_wf_dict['inpxml_changes'].append(('set_inpchanges', {
            'change_dict': {
                'l_linMix': False,
            }
        }))

        input_scf.wf_parameters = Dict(dict=scf_wf_dict)
        input_scf.settings = Dict(dict=settings)

        return input_scf