[][src]Trait bader::io::FileFormat

pub trait FileFormat {
    fn read(&self, filename: String) -> ReadFunction;
fn to_atoms(&self, atom_text: String) -> Atoms;
fn write(&self, atoms: &Atoms, data: Vec<Vec<f64>>);
fn coordinate_format(&self, coords: [f64; 3]) -> (String, String, String); fn init(
        &self,
        args: &Args
    ) -> (Vec<Vec<f64>>, Vec<f64>, Atoms, [usize; 3], [f64; 3]) { ... }
fn results(
        &self,
        voxel_map: VoxelMap,
        atoms: Atoms,
        density: &Density<'_>
    ) -> (String, String) { ... } }

FileFormat trait. Used for handling input from a file.

Required methods

fn read(&self, filename: String) -> ReadFunction

Reads the file into a ReadFunction containing the information needed from the file to build a Density.

  • filename: The name of the file to read.

fn to_atoms(&self, atom_text: String) -> Atoms

Reads the non-density section of the file into an Atoms object.

  • atom_text: The full string of non-density information from the density file.

fn write(&self, atoms: &Atoms, data: Vec<Vec<f64>>)

Writes a specific density, data, to tile in the correct format.

  • atoms: The associated &Atoms object for the density file.
  • data: The density to write to file.

fn coordinate_format(&self, coords: [f64; 3]) -> (String, String, String)

How the format the positions of maxima and atoms

  • coords: The 3d representation of the position.
Loading content...

Provided methods

fn init(
    &self,
    args: &Args
) -> (Vec<Vec<f64>>, Vec<f64>, Atoms, [usize; 3], [f64; 3])

Returns the parts required to build Density and Atoms structures.

  • args: Args parsed from the command line.

fn results(
    &self,
    voxel_map: VoxelMap,
    atoms: Atoms,
    density: &Density<'_>
) -> (String, String)

Returns the contents of the atoms charge file and bader charge file as Strings.

Loading content...

Implementors

impl FileFormat for Cube[src]

impl FileFormat for Vasp[src]

Loading content...