[][src]Struct vaspchg_rs::ChgBase

pub struct ChgBase { /* fields omitted */ }

Main struct of volumetric data

CHGCAR

This file contains the lattice vectors, atomic coordinates, the total charge density multiplied by the volume rho(r) * V_cell on the fine FFT-grid (NG(X,Y,Z)F), and the PAW one-center occupancies. CHGCAR can be used to restart VASP from an existing charge density.

Structure of CHGCAR

Here is a 'pseudo' CHGCAR file content

unknown system                          \
1.00000000000000                        |
2.969072   -0.000523   -0.000907        |
-0.987305    2.800110    0.000907       |
-0.987305   -1.402326    2.423654       |-> positions of atom in POSCAR format
Li                                      |
1                                       |
Direct                                  |
0.000000  0.000000  0.000000            /

2    3    4                             |-> number of grids in x, y, z directions.
0.44 0.44 0.46 0.48 0.52   \
0.56 0.60 0.66 0.73 0.80   |
0.88 0.94 0.10 0.10 0.10   |-> Total charge density
0.10 0.10 0.10 0.10 0.10   |
0.10 0.10 0.10 0.10        /
augmentation occupancies 1 15  \
0.27 -0.33  0.00  0.00  0.00   |
0.10  0.00  0.00  0.00  0.39   |
0.58 -0.72 -0.36  0.10 -0.20   |-> PAW augmentation data
augmentation occupancies 2 15  |
0.27 -0.33  0.00  0.00  0.00   |
0.10  0.00  0.00  0.00  0.39   |
0.58 -0.72 -0.36  0.10 -0.20   /
2    3    4                             |-> number of grids in x, y, z directions.
0.44 0.44 0.46 0.48 0.52   \
0.56 0.60 0.66 0.73 0.80   |    rho(up) - rho(dn) in ISPIN=2 system
0.88 0.94 0.10 0.10 0.10   | -> rho_x in non collinear system
0.10 0.10 0.10 0.10 0.10   |    NO THIS PART IN ISPIN=1 SYSTEM
0.10 0.10 0.10 0.12        /
augmentation occupancies 1 15  \
0.27 -0.33  0.00  0.00  0.00   |
0.10  0.00  0.00  0.00  0.39   |
0.58 -0.72 -0.36  0.10 -0.20   |
augmentation occupancies 2 15  |-> PAW augmentation data
0.27 -0.33  0.00  0.00  0.00   |
0.10  0.00  0.00  0.00  0.39   |
0.58 -0.72 -0.36  0.10 -0.00   /
<-- If this is an SOC system, another TWO charge density difference parts should be in the following -->
<-- NGX NGY NGZ -->  rho_y
<-- GRID DATA -->
<-- NGX NGY NGZ -->  rho_z
<-- GRID DATA -->

Structure of PARCHG/CHG

Similar to the structure of CHGCAR, but without augmentation parts.

PARCHG is the partial charge density which only takes the charge density of energy/band/kpoint specified electron states.

Also, CHG stores the total charge density of all the electrons below fermi level in all kpoint, all bands.

Implementations

impl ChgBase[src]

pub fn from_builder(
    chg: Array3<f64>,
    chgdiff: Vec<Array3<f64>>,
    pos: Poscar
) -> Self
[src]

Construct a ChgBase with charge grids and poscar object.

pub fn from_file(path: &impl AsRef<Path> + ?Sized) -> Result<Self>[src]

Read volumetric data from existing file.

Usually you can use &str as path(, or &std::path::Path, which is my preference).

pub fn from_reader(file: &mut impl BufRead + Seek) -> Result<Self>[src]

Read volumetric data from reading buffer, and that buffer should implemented Seek trait.

See the unit tests in this source file for detailed usage.

pub fn write_writer(
    &self,
    file: &mut impl Write,
    chgtype: ChgType
) -> Result<()>
[src]

Write ChgBase object to a write-buffer.

Note: augmentation data is required if chgtype == ChgType::Chgcar

pub fn write_file(
    &self,
    path: &impl AsRef<Path> + ?Sized,
    chgtype: ChgType
) -> Result<()>
[src]

Write ChgBase object to a new file or overwrite the old file.

Note: augmentation data is required if chgtype == ChgType::Chgcar

pub fn get_poscar(&self) -> &Poscar[src]

pub fn get_mut_poscar(&mut self) -> &mut Poscar[src]

pub fn get_total_chg(&self) -> &Array3<f64>[src]

pub fn get_mut_total_chg(&mut self) -> &mut Array3<f64>[src]

pub fn get_diff_chg(&self) -> &Vec<Array3<f64>>[src]

pub fn get_mut_diff_chg(&mut self) -> &mut Vec<Array3<f64>>[src]

pub fn get_ngrid(&self) -> &[usize; 3][src]

Return the immutable reference of the shape of the grid.

pub fn get_mut_ngrid(&mut self) -> &mut [usize; 3][src]

Return the mutable reference of the shape of the grid.

Note: don't forget to update the shpae of if any reshape like operations are applied.

pub fn get_total_aug(&self) -> Option<&String>[src]

pub fn get_diff_aug(&self) -> &Vec<String>[src]

Auto Trait Implementations

impl RefUnwindSafe for ChgBase

impl Send for ChgBase

impl Sync for ChgBase

impl Unpin for ChgBase

impl UnwindSafe for ChgBase

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.