aiida_vasp.calcs.immigrant#

Immigrant calculation.

Enables the immigration of externally run VASP calculations into AiiDA.

Module Contents#

Classes#

VaspImmigrant

Parse VASP output objects stored in a specified directory.

Functions#

get_incar_input

Create a node that contains the INCAR content.

get_poscar_input

Create a node that contains the POSCAR content.

get_potcar_input

Read potentials from POTCAR or set it up from a structure.

get_kpoints_input

Create a node that contains the KPOINTS content.

get_chgcar_input

get_wavecar_input

API#

class aiida_vasp.calcs.immigrant.VaspImmigrant(*args, **kwargs)#

Bases: aiida_vasp.calcs.vasp.VaspCalculation

Parse VASP output objects stored in a specified directory.

Simulate running the VaspCalculation up to the point where it can be retrieved and parsed, then hand over control to the runner for the rest.

Immigrant calculation can be perfomed as follows.

code = Code.get_from_string('vasp@local')
folder = '/home/username/vasp-calc-dir'
settings = {'parser_settings': {'add_energies': True,
                                'add_forces': True,
                                'electronic_step_energies': True}}
VaspImmigrant = CalculationFactory('vasp.immigrant')
builder = VaspImmigrant.get_builder_from_folder(code,
                                                folder,
                                                settings=settings)
submit(builder)

Instead of builder, inputs dict is obtained similarly as

code = Code.get_from_string('vasp@local')
folder = '/home/username/vasp-calc-dir'
settings = {'parser_settings': {'add_energies': True,
                                'add_forces': True,
                                'electronic_step_energies': True}}
VaspImmigrant = CalculationFactory('vasp.immigrant')
inputs = VaspImmigrant.get_inputs_from_folder(code,
                                              folder,
                                              settings=settings)
submit(VaspImmigrant, **inputs)

The defaul metadata is set automatically as follows:

{'options': {'max_wallclock_seconds': 1,
 'resources': {'num_machines': 1, 'num_mpiprocs_per_machine': 1}}}

Specific scheduler may require setting resources differently (e.g., sge 'parallel_env').

get_inputs_from_folder and get_builder_from_folder accept several kwargs, see the docstring of get_inputs_from_folder.

Initialization

Construct a CalcJob instance.

Construct the instance only if it is a sub class of CalcJob, otherwise raise InvalidOperation.

See documentation of aiida.engine.Process.

classmethod define(spec)#
run()#
classmethod get_inputs_from_folder(code, remote_workdir: str, **kwargs)#

Create inputs to launch immigrant from a code and a remote path on the associated computer.

If POTCAR does not exist, the provided potential_family and potential_mapping are used to link potential to inputs. In this case, at least potential_family has to be provided. Unless potential_mapping, this mapping is generated from structure, i.e.,

potential_mapping = {element: element for element in structure.get_kind_names()}
Parameters:
  • code – a Code instance for the code originally used.

  • remote_workdir – Directory or folder name where VASP inputs and outputs are stored.

  • settings – dict. This is used as the input port of VaspCalculation.

  • potential_family – str. This will be obsolete at v3.0.

  • potential_mapping – dict. This will be obsolete at v3.0.

  • use_wavecar – bool. Try to read WAVECAR.

:param use_chgcar bool. Try to read CHGCAR.

classmethod get_builder_from_folder(code, remote_workdir: str, **kwargs)#

Create an immigrant builder from a code and a remote path on the associated computer. See more details in the docstring of get_inputs_from_folder.

classmethod _add_inputs(transport, remote_path, sandbox_path, inputs, **kwargs)#

Add some more inputs

aiida_vasp.calcs.immigrant.get_incar_input(dir_path)#

Create a node that contains the INCAR content.

aiida_vasp.calcs.immigrant.get_poscar_input(dir_path)#

Create a node that contains the POSCAR content.

aiida_vasp.calcs.immigrant.get_potcar_input(dir_path, structure=None, potential_family=None, potential_mapping=None)#

Read potentials from POTCAR or set it up from a structure.

aiida_vasp.calcs.immigrant.get_kpoints_input(dir_path, structure=None)#

Create a node that contains the KPOINTS content.

aiida_vasp.calcs.immigrant.get_chgcar_input(dir_path)#
aiida_vasp.calcs.immigrant.get_wavecar_input(dir_path)#