.. _VASPPoscarFormat:

vasp/poscar format
==================

Aliases
-------

``contcar``, ``poscar``, ``vasp/contcar``, ``vasp/poscar``

Implementation: :class:`VASPPoscarFormat <dpdata.plugins.vasp.VASPPoscarFormat>`

Overview
--------


VASP POSCAR or CONTCAR structure file.

`VASP <https://www.vasp.at/>`_ (Vienna Ab initio Simulation Package) is
a computer program for atomic scale materials modelling.

POSCAR/CONTCAR stores one periodic configuration and optional selective
dynamics flags. It does not contain energies or forces, so it maps to
:class:`dpdata.System` rather than :class:`dpdata.LabeledSystem`.
















Quick examples
--------------

The examples use the preferred alias ``vasp/poscar``; any alias listed above is equivalent.

.. code-block:: python

   import dpdata
   
   # Geometry-only data
   system = dpdata.System("input_file", fmt="vasp/poscar")
   
   # Write geometry-only data
   system.to("vasp/poscar", "output_path")

Conversions
-----------

.. _VASPPoscarFormat_from_system:

Convert from this format to System
``````````````````````````````````

.. py:function:: dpdata.System(file_name: 'FileType', fmt: Literal['contcar'] = None, **kwargs) -> dpdata.system.System
   :noindex:
.. py:function:: dpdata.System(file_name: 'FileType', fmt: Literal['poscar'] = None, **kwargs) -> dpdata.system.System
   :noindex:
.. py:function:: dpdata.System(file_name: 'FileType', fmt: Literal['vasp/contcar'] = None, **kwargs) -> dpdata.system.System
   :noindex:
.. py:function:: dpdata.System(file_name: 'FileType', fmt: Literal['vasp/poscar'] = None, **kwargs) -> dpdata.system.System
   :noindex:
.. py:function:: dpdata.System.from_contcar(file_name: 'FileType', **kwargs) -> dpdata.system.System
   :noindex:
.. py:function:: dpdata.System.from_poscar(file_name: 'FileType', **kwargs) -> dpdata.system.System
   :noindex:
.. py:function:: dpdata.System.from_vasp_contcar(file_name: 'FileType', **kwargs) -> dpdata.system.System
   :noindex:
.. py:function:: dpdata.System.from_vasp_poscar(file_name: 'FileType', **kwargs) -> dpdata.system.System
   :noindex:

   
Load a VASP POSCAR or CONTCAR file.


:Parameters:

    **file_name** : str or os.PathLike or file-like object
        POSCAR/CONTCAR input.

    **\*\*kwargs** : dict
        Additional format arguments accepted for API compatibility.



:Returns:

    System
        converted system















.. _VASPPoscarFormat_to_system:

Convert from System to this format
``````````````````````````````````

.. py:function:: dpdata.System.to(fmt: Literal['contcar'], file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.System.to(fmt: Literal['poscar'], file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.System.to(fmt: Literal['vasp/contcar'], file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.System.to(fmt: Literal['vasp/poscar'], file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.System.to_contcar(file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.System.to_poscar(file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.System.to_vasp_contcar(file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.System.to_vasp_poscar(file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:

   
Dump the system in vasp POSCAR format.


:Parameters:

    **file_name** : str
        The output file name

    **frame_idx** : int
        The index of the frame to dump

    **\*\*kwargs** : dict
        other parameters


















.. _VASPPoscarFormat_to_labeled_system:

Convert from LabeledSystem to this format
`````````````````````````````````````````

.. py:function:: dpdata.LabeledSystem.to(fmt: Literal['contcar'], file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.LabeledSystem.to(fmt: Literal['poscar'], file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.LabeledSystem.to(fmt: Literal['vasp/contcar'], file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.LabeledSystem.to(fmt: Literal['vasp/poscar'], file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.LabeledSystem.to_contcar(file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.LabeledSystem.to_poscar(file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.LabeledSystem.to_vasp_contcar(file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:
.. py:function:: dpdata.LabeledSystem.to_vasp_poscar(file_name: 'FileType', frame_idx=0, **kwargs)
   :noindex:

   
Dump the system in vasp POSCAR format.


:Parameters:

    **file_name** : str
        The output file name

    **frame_idx** : int
        The index of the frame to dump

    **\*\*kwargs** : dict
        other parameters
















