Fleur structure optimization workchain — AiiDA-FLEUR 1.1.0 documentation

# Fleur structure optimization workchain

- Current version: 0.1.2

- Class: `FleurRelaxWorkChain`

- String to pass to the `WorkflowFactory()`: `fleur.relax`

- Workflow type: Technical

- Aim: Structure optimization of a given structure

- Computational demand: Several `FleurScfWorkChain`

- Database footprint: Output node with information, full provenance, `~ 10+10*FLEUR Jobs` nodes

Contents

- Fleur structure optimization workchain

  - Description/Purpose

  - Input nodes

    - Workchain parameters and its defaults

  - Output nodes

  - Layout

  - Output nodes

  - Error handling

  - Example usage

Import Example:

    from aiida_fleur.workflows.relax import FleurRelaxWorkChain
    #or
    WorkflowFactory('fleur.relax')

## Description/Purpose

Optimizes the structure in a way the largest force is lower than a given threshold.

Uses `FleurScfWorkChain` to converge forces first, checks if the largest force is smaller than the threshold. If the largest force is bigger, submits a new `FleurScfWorkChain` for next step structure proposed by FLEUR.

All structure optimization routines implemented in the FLEUR code, the workchain only wraps it.

## Input nodes

The FleurSSDispWorkChain employs exposed feature of the AiiDA, thus inputs for the nested SCF workchain should be passed in the namespace `scf`.

name | type | description | required
--- | --- | --- | ---
scf | namespace | inputs for nested SCF WorkChain | yes
wf_parameters | `Dict` | Settings of the workchain | no

### Workchain parameters and its defaults

> - `wf_parameters`: `Dict` - Settings of the workflow behavior. All possible keys and their defaults are listed below:

>       # -*- coding: utf-8 -*-
>       'film_distance_relaxation': False,   # if True, sets relaxXYZ="FFT" for all atoms
>       'force_criterion': 0.049,            # Sets the threshold of the largest force
>       'relax_iter': 5                      # Maximum number of optimization iterations

## Output nodes

> - `out`: `Dict` - Information of workflow results

> - `optimized_structure`: `StructureData` - Optimized structure

## Layout

Geometry optimization workchain always submits SCF WC using inputs given in the `scf` namespace. Thus one can start with a structure, FleurinpData or converged/not-fully-converged charge density.

## Output nodes

name | type | comment
--- | --- | ---
out | `Dict` | results of the workchain
optimized_structure | `FleurinpData` | FleurinpData that was used (after all modifications)

For now output node contains the minimal amount of information. The content can be easily extended on demand, please contact to developers for request.

    # this is a content of out output node
    {
        "errors": [],
        "force": [
            0.03636428
        ],
        "force_iter_done": 1,
        "info": [],
        "initial_structure": "181c1e8d-3c56-4009-b0bb-e8b76cb417e2",
        "warnings": [],
        "workflow_name": "FleurRelaxWorkChain",
        "workflow_version": "0.1.0"
    }

## Error handling

A list of implemented exit codes:

+———–+———————————————————- | Code | Meaning | +———–+———————————————————- | 350 | The workchain execution did not lead to | | | relaxation criterion. Thrown in the very | | | end of the workchain. | +———–+———————————————————+ | 351 | SCF Workchains failed for some reason. | +———–+———————————————————+ | 352 | Found no relaxed structure info in the output of SCF | +———–+———————————————————+ | 353 | Found no SCF output | +———–+———————————————————+ | 354 | Force is small, switch to BFGS | +———–+———————————————————+

Exit codes duplicating FleurCalculation exit codes:

Exit code | Reason
--- | ---
311 | FLEUR calculation failed because atoms spilled to the vacuum
313 | Overlapping MT-spheres during relaxation

## Example usage

    # -*- coding: utf-8 -*-
    from aiida.orm import load_node, Dict
    from aiida.engine import submit

    from aiida_fleur.workflows.relax import FleurRelaxWorkChain

    fleur_code = load_node(FLEUR_PK)
    inpgen_code = load_node(INPGEN_PK)

    wf_relax = {'film_distance_relaxation': False,
                'force_criterion': 0.049,
                'relax_iter': 5
                }

    wf_relax_scf = {'fleur_runmax': 5,
                    'serial': False,
                    'itmax_per_run': 50,
                    'alpha_mix': 0.015,
                    'relax_iter': 25,
                    'force_converged': 0.001,
                    'force_dict': {'qfix': 2,
                                   'forcealpha': 0.75,
                                   'forcemix': 'straight'},
                    'inpxml_changes': []
                    }

    wf_relax = Dict(dict=wf_relax)
    wf_relax_scf = Dict(dict=wf_relax_scf)

    calc_relax = {'comp': {'kmax': 4.0,
                           },
                  'kpt': {'div1': 24,
                          'div2': 20,
                          'div3': 1
                          },
                  'atom': {'element': 'Pt',
                           'rmt': 2.2,
                           'lmax': 10,
                           'lnonsph': 6,
                           'econfig': '[Kr] 5s2 4d10 4f14 5p6| 5d9 6s1',
                           },
                  'atom2': {'element': 'Fe',
                            'rmt': 2.1,
                            'lmax': 10,
                            'lnonsph': 6,
                            'econfig': '[Ne] 3s2 3p6| 3d6 4s2',
                            },
                  }

    calc_relax = Dict(dict=calc_relax)

    options_relax = {'resources': {'num_machines': 1, 'num_mpiprocs_per_machine': 4, 'num_cores_per_mpiproc': 6},
                     'queue_name': 'devel',
                     'custom_scheduler_commands': '',
                     'max_wallclock_seconds':  1*60*60}

    inputs = {
        'scf': {
            'wf_parameters': wf_relax_scf,
            'calc_parameters': calc_relax,
            'options': options_relax,
            'inpgen': inpgen_code,
            'fleur': fleur_code
        },
        'wf_parameters': wf_relax
    }

    res = submit(FleurRelaxWorkChain, **inputs)