Fleur input generator plug-in

Fleurinputgen Calculation

Fleurinputgen Parser

Fleur-code plugin

Fleur Calculation

Fleur Parser

Fleur input Data structure

Fleur input Data structure

In this module is the FleurinpData class, and methods for FLEUR input manipulation plus methods for extration of AiiDA data structures.

class aiida_fleur.data.fleurinp.FleurinpData(**kwargs)[source]

AiiDA data object representing everything a FLEUR calculation needs.

It is initialized with an absolute path to an inp.xml file or a FolderData node containing inp.xml. Other files can also be added that will be copied to the remote machine, where the calculation takes place.

It stores the files in the repository and stores the input parameters of the inp.xml file of FLEUR in the database as a python dictionary (as internal attributes). When an inp.xml (name important!) file is added to files, FleurinpData searches for a corresponding xml schema file in the PYTHONPATH environment variable. Therefore, it is recommend to have the plug-in source code directory in the python environment. If no corresponding schema file is found an error is raised.

FleurinpData also provides the user with methods to extract AiiDA StructureData and KpointsData nodes.

Remember that most attributes of AiiDA nodes can not be changed after they have been stored in the database! Therefore, you have to use the FleurinpModifier class and its methods if you want to change somthing in the inp.xml file. You will retrieve a new FleurinpData that way and start a new calculation from it.

__init__(**kwargs)[source]

Initialize a FleurinpData object set the files given

del_file(filename)[source]

Remove a file from FleurinpData instancefind

Parameters:filename – name of the file to be removed from FleurinpData instance
files

Returns the list of the names of the files stored

find_schema(inp_version_number)[source]

Method which searches for a schema files (.xsd) which correspond to the input xml file. (compares the version numbers)

Parameters:inp_version_number – a version of inp.xml file schema to be found
Returns:A two-element tuple:
  1. A list of paths where schema files are located
  2. A boolen which shows if the required version schema file was found
get_content(filename='inp.xml')[source]

Returns the content of the single file stored for this data node.

Returns:A string of the file content
get_fleur_modes()[source]

Analyses inp.xml file to set up a calculation mode. ‘Modes’ are paths a FLEUR calculation can take, resulting in different output files. This files can be automatically addded to the retrieve_list of the calculation.

Common modes are: scf, jspin2, dos, band, pot8, lda+U, eels, …

Returns:a dictionary containing all possible modes. A mode is activated assigning a non-empty string to the corresponding key.
static get_kpointsdata(fleurinp)[source]

This routine returns an AiiDA KpointsData type produced from the inp.xml file. This only works if the kpoints are listed in the in inpxml. This is a calcfunction and keeps the provenance!

Parameters:fleurinp – a FleurinpData instance to be parsed into a KpointsData node
Returns:KpointsData node
static get_kpointsdata_ncf(fleurinp)[source]

This routine returns an AiiDA KpointsData type produced from the inp.xml file. This only works if the kpoints are listed in the in inpxml. This is NOT a calcfunction and does not keep the provenance!

Parameters:fleurinp – a FleurinpData instance to be parsed into a KpointsData node
Returns:KpointsData node
static get_parameterdata(fleurinp)[source]

This routine returns an AiiDA Dict type produced from the inp.xml file. The returned node can be used for inpgen as calc_parameters. This is a calcfunction and keeps the provenance!

Returns:Dict node
get_parameterdata_ncf()[source]

This routine returns an AiiDA Dict type produced from the inp.xml file. This node can be used for inpgen as calc_parameters. This is NOT a calcfunction and does NOT keep the provenance!

Returns:Dict node
static get_structuredata(fleurinp)[source]

This routine return an AiiDA Structure Data type produced from the inp.xml file. If this was done before, it returns the existing structure data node. This is a calcfunction and therefore keeps the provenance.

Parameters:fleurinp – a FleurinpData instance to be parsed into a StructureData
Returns:StructureData node
get_structuredata_ncf()[source]

This routine returns an AiiDA Structure Data type produced from the inp.xml file. not a calcfunction

Parameters:fleurinp – a FleurinpData instance to be parsed into a StructureData
Returns:StructureData node, or None
get_tag(xpath)[source]

Tries to evalutate an xpath expression for inp.xml file. If it fails it logs it.

Parameters:xpath – an xpath expression
Returns:A node list retrived using fiven xpath
inp_dict

Returns the inp_dict (the representation of the inp.xml file) as it will or is stored in the database.

open(key='inp.xml', mode='r')[source]

Returns an open file handle to the content of this data node.

Parameters:
  • key – name of the file to be opened
  • mode – the mode with which to open the file handle
Returns:

A file handle in read mode

set_file(filename, dst_filename=None, node=None)[source]

Add a file to the FleurinpData instance.

Parameters:
  • filename – absolute path to the file or a filename of node is specified
  • node – a FolderData node containing the file
set_files(files, node=None)[source]

Add the list of files to the FleurinpData instance. Can by used as an alternative to the setter.

Parameters:
  • files – list of abolute filepaths or filenames of node is specified
  • node – a FolderData node containing files from the filelist
set_kpointsdata(KpointsDataNode)[source]

This calc function writes the all the kpoints from a KpointsData node in the inp.xml file as a kpointslist. It replaces kpoints written in the inp.xml file. The output FleurinpData is stored in the database.

Currently it is the users resposibility to provide a full KpointsData node with weights.

Parameters:KpointsDataNodeKpointsData node to be written into inp.xml
Returns:modified FleurinpData node

Fleurinp modifier

In this module is the FleurinpModifier class, which is used to manipulate FleurinpData objects in a way which keeps the provernance.

class aiida_fleur.data.fleurinpmodifier.FleurinpModifier(original)[source]

A class which represents changes to the FleurinpData object.

static apply_modifications(fleurinp_tree_copy, modification_tasks, schema_tree=None)[source]

Applies given modifications to the fleurinp lxml tree. It also checks if a new lxml tree is validated against schema. Does not rise an error if inp.xml is not validated, simple prints a message about it.

Parameters:
  • fleurinp_tree_copy – a fleurinp lxml tree to be modified
  • modification_tasks – a list of modification tuples
Returns:

a modified fleurinp lxml tree

changes()[source]

Prints out all changes given in a FleurinpModifier instance.

freeze()[source]

This method applies all the modifications to the input and returns a new stored fleurinpData object.

Returns:stored FleurinpData with applied changes
get_avail_actions()[source]

Returns the allowed functions from fleurinpmod

static modify_fleurinpdata(original, modifications)[source]

A CalcFunction that performs the modification of the given FleurinpData and stores the result in a database.

Parameters:
  • original – a FleurinpData to be modified
  • modifications – a python dictionary of modifications in the form of {‘task’: …}
Returns new_fleurinp:
 

a modified FleurinpData that is stored in a database

show(display=True, validate=False)[source]

Applies the modifications and displays/prints the resulting inp.xml file. Does not generate a new FleurinpData object.

Parameters:
  • display – a boolean that is True if resulting inp.xml has to be printed out
  • validate – a boolean that is True if changes have to be validated
Returns:

a lxml tree representing inp.xml with applied changes

undo(all=False)[source]

Cancels the last change or all of them

Parameters:all – set True if need to cancel all the changes, False if the last one.
validate()[source]

Extracts the schema-file. Makes a test if all the changes lead to an inp.xml file that is validated against the schema.

Returns:a lxml tree representing inp.xml with applied changes

Workflows/Workchains

Base: Fleur-Base WorkChain

SCF: Fleur-Scf WorkChain

Band: Bandstructure WorkChain

DOS: Density of states WorkChain

EOS: Calculate a lattice constant

Relax: Relaxation of a Cystalstructure WorkChain

initial_cls: Caluclation of inital corelevel shifts

corehole: Performance of coreholes calculations

delta: Calculates a Delta Factor

MAE: Force-theorem calculation of magnetic anisotropy energies

MAE Conv: Self-consistent calculation of magnetic anisotropy energies

SSDisp: Force-theorem calculation of spin spiral dispersion

SSDisp Conv: Self-consistent calculation of spin spiral dispersion

DMI: Force-theorem calculation of Dzjaloshinskii-Moriya interaction energy dispersion