pub struct PoscarStructure {
pub comment: String,
pub scale: f64,
pub lattice: [[f64; 3]; 3],
pub species: Vec<String>,
pub counts: Vec<usize>,
pub selective_dynamics: bool,
pub is_direct: bool,
pub positions: Vec<[f64; 3]>,
pub sd_flags: Option<Vec<[bool; 3]>>,
pub magmom: Option<Vec<f64>>,
pub forces: Option<Vec<[f64; 3]>>,
}Expand description
A richer POSCAR structure that captures VASP-specific extensions.
Unlike CrystalStructure (which maps to CIF), this struct preserves
VASP-specific fields: selective dynamics flags, per-atom magnetic moments,
and ionic forces parsed from a companion OUTCAR file.
Fields§
§comment: StringComment line (first line of the POSCAR file).
scale: f64Universal scale factor (already applied to lattice).
lattice: [[f64; 3]; 3]Lattice vectors as row matrix (in Å after scale).
species: Vec<String>Element symbols for each species (VASP5+ format; empty for VASP4).
counts: Vec<usize>Number of atoms per species.
selective_dynamics: boolWhether selective dynamics mode is active.
is_direct: boolCoordinate mode: true = Direct (fractional), false = Cartesian.
positions: Vec<[f64; 3]>Atom fractional (or Cartesian) positions, in species order.
sd_flags: Option<Vec<[bool; 3]>>Per-atom selective-dynamics flags [x_free, y_free, z_free].
None if selective dynamics were not specified.
magmom: Option<Vec<f64>>Per-atom magnetic moments parsed from # MAGMOM = ... annotation.
None if not present.
forces: Option<Vec<[f64; 3]>>Ionic forces in eV/Å parsed from a companion OUTCAR file.
None if not available.
Implementations§
Source§impl PoscarStructure
impl PoscarStructure
Sourcepub fn to_crystal_structure(&self) -> CrystalStructure
pub fn to_crystal_structure(&self) -> CrystalStructure
Convert to a CrystalStructure (drops VASP-specific fields).
Sourcepub fn to_poscar_string(&self) -> String
pub fn to_poscar_string(&self) -> String
Write this structure to a POSCAR-formatted string.
Trait Implementations§
Source§impl Clone for PoscarStructure
impl Clone for PoscarStructure
Source§fn clone(&self) -> PoscarStructure
fn clone(&self) -> PoscarStructure
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PoscarStructure
impl RefUnwindSafe for PoscarStructure
impl Send for PoscarStructure
impl Sync for PoscarStructure
impl Unpin for PoscarStructure
impl UnsafeUnpin for PoscarStructure
impl UnwindSafe for PoscarStructure
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.