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

Import Example:

from aiida_fleur.workflows.relax import FleurRelaxWorkChain


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

name type description required
fleur Code Fleur code yes
inpgen Code Inpgen code no
wf_parameters Dict Settings of the workchain no
structure StructureData Structure data node no
calc_parameters Dict inpgen parameters no
fleurinp FleurinpData FLEUR input no
remote_data RemoteData Remote folder of another calculation no
options Dict AiiDA options (computational resources) no
settings Dict Special settings for Fleur calculation no

Only fleur input is required. However, it does not mean that it is enough to specify fleur only. One must keep one of the supported input configurations described in the Supported input configurations section.

Workchain parameters and its defaults

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

    'fleur_runmax': 4,                   # needed for SCF
    'alpha_mix': 0.015,                  # Sets alpha mixing parameter
    'relax_iter': 5,                     # Maximum number of optimization iterations
    'force_criterion': 0.001,            # Sets the threshold of the largest force
    'force_converged' : 0.002,           # needed for SCF
    'serial' : False,                    # needed for SCF
    'force_dict': {'qfix': 2,            # needed for SCF
                   'forcealpha': 0.5,
                   'forcemix': 'BFGS'},
    'film_distance_relaxation' : False,  # Sets relaxXYZ="FFT" for all atoms
    'itmax_per_run' : 30,                # needed for SCF
    'inpxml_changes' : [],               # needed for SCF

    ‘force_dict’ contains parameters that will be inserted into the inp.xml in case of force convergence mode. Usually this sub-dictionary does not affect the convergence, it affects only the generation of relax.xml file. Read more in FLEUR relaxation documentation.


    Only one of density_converged, energy_converged or force_converged is used by the workchain that corresponds to the ‘mode’. The other two are ignored.

  • options: Dict - AiiDA options (computational resources). Example:

    'resources': {"num_machines": 1, "num_mpiprocs_per_machine": 1},
    'max_wallclock_seconds': 6*60*60,
    'queue_name': '',
    'custom_scheduler_commands': '',
    'import_sys_environment': False,
    'environment_variables': {}

Output nodes

  • out: Dict - Information of workflow results
  • optimized_structure: StructureData - Optimized structure

Supported input configurations

Geometry optimization workchain has several input combinations that implicitly define the input processing. Depending on the setup of the inputs, one of four supported scenarios will happen:

  1. fleurinp:

    Files, belonging to the fleurinp, will be used as input for the first FLEUR calculation.

  2. fleurinp + parent_folder (FLEUR):

    Files, belonging to the fleurinp, will be used as input for the first FLEUR calculation. Moreover, initial charge density will be copied from the folder of the parent calculation.

  3. parent_folder (FLEUR):

    inp.xml file and initial charge density will be copied from the folder of the parent FLEUR calculation.

  4. structure:

    inpgen code will be used to generate a new fleurinp using a given structure.


One must keep one of the supported input configurations. In other case the workchain will stop throwing non-zero exit status or more dangerously, will make unexpected actions.

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": [
    "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
230 Input nodes do not correspond to any valid input configuration.
231 Input codes do not correspond to fleur or inpgen codes respectively.
350 The workchain execution did not lead to relaxation criterion. Thrown in the vary end of the workchain.
351 A relaxation iteration (a SCF workchain) failed.
352 No parsed relax.xml output of SCF workchain found.
354 Found no fleurinpData in the last SCF workchain

If your workchain crashes and stops in Excepted state, please open a new issue on the Github page and describe the details of the failure.

Example usage

Has to be documented.