pyiron_atomistics.vasp.volumetric_data.VaspVolumetricData#

class pyiron_atomistics.vasp.volumetric_data.VaspVolumetricData[source]#

Bases: VaspVolumetricData

__init__()[source]#

Methods

__init__()

cylindrical_average_potential(structure, ...)

Calculates the cylindrical average about a given point in space

dist_between_two_grid_points(...)

Calculates the distance between a target grid point and another grid point

dist_between_two_grid_points_cyl(...)

Distance between a target grid point and the center of a cylinder

from_file(filename[, normalize])

Parsing the contents of from a file

from_hdf(hdf[, group_name])

Recreating the VolumetricData instance by reading data from the HDF5 files

gauss_f(d[, fwhm])

Generates a Gaussian distribution for a given distance and full width half maximum value

get_average_along_axis([ind])

Get the lateral average along a certain axis direction.

read_cube_file([filename])

Generate data from a CUBE file

spherical_average_potential(structure, ...)

Calculates the spherical average about a given point in space

to_dict()

to_hdf(hdf[, group_name])

Writes the data as a group to a HDF5 file

write_cube_file([filename, cell_scaling])

Write the volumetric data into the CUBE file format

write_vasp_volumetric([filename, normalize])

Writes volumetric data into a VASP CHGCAR format

Attributes

atoms

The structure related to the volumeric data

diff_data

Volumtric difference data (3D)

total_data

Total volumtric data (3D)

property atoms: Atoms | None#

The structure related to the volumeric data

Returns:

The structure associated with the data

Return type:

pyiron_atomistics.atomistics.structure.Atoms

cylindrical_average_potential(structure: Atoms, spherical_center: list | ndarray, axis_of_cyl: int, rad: float = 2, fwhm: float = 0.529177) float#

Calculates the cylindrical average about a given point in space

Parameters:
  • structure (pyiron_atomistics.atomistics.structure.Atoms) – Input structure

  • spherical_center (list/numpy.ndarray) – position of spherical_center in direct coordinate

  • rad (float) – radius of sphere to be considered in Angstrom (recommended value: 2)

  • fwhm (float) – Full width half maximum of gaussian function in Angstrom (recommended value: 0.529177)

  • axis_of_cyl (int) – Axis of cylinder (0 (x) or 1 (y) or 2 (z))

Returns:

Cylindrical average at the target center

Return type:

float

property diff_data#

Volumtric difference data (3D)

Type:

numpy.ndarray

static dist_between_two_grid_points(target_grid_point: ndarray | list, n_grid_at_center: ndarray | list, lattice: ndarray | list, grid_shape: tuple | list | ndarray) float#

Calculates the distance between a target grid point and another grid point

Parameters:
  • target_grid_point (numpy.ndarray/list) – Target grid point

  • n_grid_at_center (numpy.ndarray/list) – coordinate of center of sphere

  • lattice (numpy.ndarray/list) – lattice vector

  • grid_shape (tuple/list/numpy.ndarray) – size of grid

Returns:

Distance between target grid and center of sphere in angstrom

Return type:

float

static dist_between_two_grid_points_cyl(target_grid_point: ndarray | list, n_grid_at_center: ndarray | list, lattice: ndarray | list, grid_shape: tuple | list | ndarray, direction_of_cyl: int) float#

Distance between a target grid point and the center of a cylinder

Parameters:
  • target_grid_point (numpy.ndarray/list) – Target grid point

  • n_grid_at_center (numpy.ndarray/list) – coordinate of center of sphere

  • lattice (numpy.ndarray/list) – lattice vector

  • grid_shape (tuple/list/numpy.ndarray) – size of grid

  • direction_of_cyl (int) – Axis of cylinder (0 (x) or 1 (y) or 2 (z))

Returns:

Distance between target grid and in-plane center of cylinder

Return type:

float

from_file(filename: str, normalize: bool = True)[source]#

Parsing the contents of from a file

Parameters:
  • filename (str) – Path of file to parse

  • normalize (boolean) – Flag to normalize by the volume of the cell

from_hdf(hdf, group_name='volumetric_data')[source]#

Recreating the VolumetricData instance by reading data from the HDF5 files

Parameters:
  • hdf (pyiron_base.generic.hdfio.ProjectHDFio) – The HDF file/path to write the data to

  • group_name (str) – The name of the group under which the data must be stored as

Returns:

The VolumetricData instance

Return type:

pyiron.atomistics.volumetric.generic.VolumetricData

static gauss_f(d: float, fwhm: float = 0.529177) float#

Generates a Gaussian distribution for a given distance and full width half maximum value

Parameters:
  • d (float) – distance between target point and reference point

  • fwhm (float) – Full width half maximum in angstrom

Returns:

Gaussian reduction constant

Return type:

float

get_average_along_axis(ind: int = 2) ndarray#

Get the lateral average along a certain axis direction. This function is adapted from the pymatgen vasp VolumetricData class

http://pymatgen.org/_modules/pymatgen/io/vasp/outputs.html#VolumetricData.get_average_along_axis

Parameters:

ind (int) – Index of axis (0, 1 and 2 for the x, y, and z axis respectively)

Returns:

A 1D vector with the laterally averaged values of the volumetric data

Return type:

numpy.ndarray

read_cube_file(filename: str = 'cube_file.cube') None#

Generate data from a CUBE file

Parameters:

filename (str) – Filename to parse

spherical_average_potential(structure: Atoms, spherical_center: list | ndarray, rad: float = 2, fwhm: float = 0.529177) float#

Calculates the spherical average about a given point in space

Parameters:
  • structure (pyiron_atomistics.atomistics.structure.Atoms) – Input structure

  • spherical_center (list/numpy.ndarray) – position of spherical_center in direct coordinate

  • rad (float) – radius of sphere to be considered in Angstrom (recommended value: 2)

  • fwhm (float) – Full width half maximum of gaussian function in Angstrom (recommended value: 0.529177)

Returns:

Spherical average at the target center

Return type:

float

to_hdf(hdf, group_name='volumetric_data')[source]#

Writes the data as a group to a HDF5 file

Parameters:
  • hdf (pyiron_base.generic.hdfio.ProjectHDFio) – The HDF file/path to write the data to

  • group_name (str) – The name of the group under which the data must be stored as

property total_data#

Total volumtric data (3D)

Type:

numpy.ndarray

write_cube_file(filename: str = 'cube_file.cube', cell_scaling: float = 1.0) None#

Write the volumetric data into the CUBE file format

Parameters:
  • filename (str) – Filename

  • cell_scaling (float) – Scale the cell by this fraction

write_vasp_volumetric(filename: str = 'CHGCAR', normalize: bool = False) None#

Writes volumetric data into a VASP CHGCAR format

Parameters:
  • filename (str) – Filename of the new file

  • normalize (bool) – True if the data is to be normalized by the volume