ExpHP / vasp-poscar

rust crate for reading/writing POSCAR files
Apache License 2.0
4 stars 0 forks source link

convenience functions for data access #6

Open ExpHP opened 6 years ago

ExpHP commented 6 years ago

from the crypts of impl Poscar { ... }

// pub fn comment(&self) -> &str { &self.comment }

// /// Get the three lattice vectors, taking into account the scale line.
// pub fn lattice_vectors(&self) -> [[f64; 3]; 3] { TODO }

// /// Determinant of the lattice matrix.
// pub fn determinant(&self) -> f64 { TODO }

// /// Unit cell volume. This quantity is always positive.
// pub fn volume(&self) -> f64 { self.determinant().abs() }

// fn effective_scale_factor(&self) -> f64 {
//     match self.scale {
//         ScaleLine::Factor(f) => f,
//         ScaleLine::Volume(v) => (v / self.volume()).powf(1f64/3f64),
//     }
// }

// // NOTE: These are dangerous because Carts does not incorporate the scale factor
// // pub fn coords(&self) -> Coords<&[[f64; 3]]> { TODO }
// // pub fn coords_mut(&self) -> Coords<&mut [[f64; 3]]> { TODO }

// /// The true cartesian positions, after taking the global scale into account.
// pub fn cart_positions(&self) -> Vec<[f64; 3]> { TODO }
// pub fn frac_positions(&self) -> Vec<[f64; 3]> { TODO }

// pub fn velocities(&self) -> Option<Coords<&[[f64; 3]]>> { TODO }
// pub fn symbols(&self) -> Option<Symbols> { TODO }
// pub fn symbol_groups(&self) -> Option<SymbolGroups> { TODO }
ExpHP commented 6 years ago

For future reference, these are the missing use cases I needed when using the crate in rsp2:

It also would have benefitted from being able to set symbols from a per-site list