vaspparser.dft.volumetric.VolumetricData#

class vaspparser.dft.volumetric.VolumetricData[source]#

Bases: object

A new class to handle 3-dimensional volumetric data elegantly (charge densities, electrostatic potentials etc) based on the numpy.ndarray instance. This module is adapted from the pymatgen vasp VolumtricData class

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

total_data#

A 3D array containing the data

Type:

numpy.ndarray

__init__() None[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

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

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

total_data

The Nx x Ny x Nz sized array for the total data

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[source]#

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

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[source]#

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[source]#

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

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

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[source]#

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[source]#

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[source]#

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

property total_data: ndarray | None#

The Nx x Ny x Nz sized array for the total data

Type:

numpy.ndarray

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

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[source]#

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