POSCAR (cusp.poscar)
Input data type for structure inputs passed to VASP calculations.
Contrary to a plain structure data type the VaspPoscarData class offers multiple additional attributes like constraints or atomic velocities
Initializing the class
In general the constructor of the VaspPoscarData class is of the following form:
VaspPoscarData(structure=None, constraints=None, velocities=None, temperature=None)
Arguments:
structure (
StructureData,StructureorPoscar) – The structure data used to generate the POSCAR data from.constraints (
list, optional) – Nx3 list (N the number of atoms) ofboolintroducing selective dynamics by adding constraints on the coordinates for every atom contained in the structure. (i.e. False: coordinate is not allowed to change, True coordinate is allowed to change)velocities (
list, optional) – Nx3 list (N the number of atoms) offloatsetting the velocities for every atom on the structuretemperature (
float, optional) – Instead of passing an explicit list of velocities initialize the atomic velocities from a Maxwell-Boltzmann distribution at the given temperature
Example plain structure:
>>> from aiida.plugins import DataFactory
>>> from pymatgen.core import Lattice, Structure
>>> lattice = Lattice.cubic(3.359)
>>> structure = Structure(lattice, ["Po"], [.0, .0, .0])
>>> VaspPoscarData = DataFactory('cusp.poscar')
>>> cusp_poscar = VaspPoscarData(structure=structure)
>>> print(cusp_poscar.get_poscar())
Po1
1.0
3.359000 0.000000 0.000000
0.000000 3.359000 0.000000
0.000000 0.000000 3.359000
Po
1
direct
0.000000 0.000000 0.000000 Po
Example with constraints:
>>> from aiida.plugins import DataFactory
>>> from pymatgen.core import Lattice, Structure
>>> lattice = Lattice.cubic(3.359)
>>> structure = Structure(lattice, ["Po"], [.0, .0, .0])
>>> VaspPoscarData = DataFactory('cusp.poscar')
>>> cusp_poscar = VaspPoscarData(structure=structure, constraints=[[True, False, True]])
>>> print(cusp_poscar.get_poscar())
Po1
1.0
3.359000 0.000000 0.000000
0.000000 3.359000 0.000000
0.000000 0.000000 3.359000
Po
1
Selective dynamics
direct
0.000000 0.000000 0.000000 T F T Po
Recovering the stored structure data
In order to further analyze or re-use structures the VaspPoscarData class offers several methods to retrieve the stored structure.
In particular, four different methods are available to recover the stored structure data in different formats:
- VaspPoscarData.get_poscar()
Create and return a
pymatgen.io.vasp.inputs.Poscarinstance initialized from the node’s stored structure data contents.- Returns:
a pymatgen Poscar instance
- Return type:
- VaspPoscarData.get_structure()
Create and return a
pymatgen.core.structure.Structureinstance from the node’s stored structure data contents.- Returns:
a pymatgen Structure instance
- Return type:
- VaspPoscarData.get_atoms()
Create and return a
ase.Atomsinstance from the node’s stored structure data contents- Returns:
an ASE-Atoms instance
- Return type:
- VaspPoscarData.get_aiida_structure()
Create and return a
aiida.orm.nodes.data.structure.StructureDatainstance from the node’s stored structure data contents- Returns:
an AiiDA
StructureDatainstance- Return type: