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
,Structure
orPoscar
) – The structure data used to generate the POSCAR data from. - constraints (
list
, optional) – Nx3 list (N the number of atoms) ofbool
introducing 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) offloat
setting the velocities for every atom on the structure - temperature (
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 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 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.Poscar
instance initialized from the node’s stored structure data contents.Returns: a pymatgen Poscar instance Return type: pymatgen.io.vasp.inputs.Poscar
-
VaspPoscarData.
get_structure
() Create and return a
pymatgen.core.structure.Structure
instance from the node’s stored structure data contents.Returns: a pymatgen Structure instance Return type: pymatgen.core.structure.Structure
-
VaspPoscarData.
get_atoms
() Create and return a
ase.Atoms
instance from the node’s stored structure data contentsReturns: an ASE-Atoms instance Return type: ase.Atoms
-
VaspPoscarData.
get_aiida_structure
() Create and return a
aiida.orm.StructureData
instance from the node’s stored structure data contentsReturns: an AiiDA StructureData
instanceReturn type: aiida.orm.StructureData