Skip to main content

LammpsDataWriter

Struct LammpsDataWriter 

Source
pub struct LammpsDataWriter;
Expand description

Writer for the LAMMPS data-file format (used with read_data).

Implementations§

Source§

impl LammpsDataWriter

Source

pub fn write_header( n_atoms: usize, n_bonds: usize, box_lo: [f64; 3], box_hi: [f64; 3], ) -> String

Generate the header section of a LAMMPS data file.

box_lo / box_hi are the lower/upper corners of the simulation box.

Source

pub fn write_atoms_atomic( positions: &[[f64; 3]], masses: &[f64], types: &[u32], ) -> String

Generate the Atoms section for atom_style atomic.

types is 1-indexed atom type per atom.

Source

pub fn write_atoms_charge( positions: &[[f64; 3]], masses: &[f64], charges: &[f64], types: &[u32], ) -> String

Generate the Atoms section for atom_style charge.

Source

pub fn write_bonds(bonds: &[(u32, u32, u32)]) -> String

Generate the Bonds section.

Each entry is (bond_type, atom_i, atom_j) with 1-indexed atoms.

Source

pub fn write_complete( positions: &[[f64; 3]], masses: &[f64], types: &[u32], box_lo: [f64; 3], box_hi: [f64; 3], ) -> String

Generate a complete LAMMPS data file string (atomic style, no bonds).

Source§

impl LammpsDataWriter

Source

pub fn write_atoms_full( positions: &[[f64; 3]], charges: &[f64], types: &[u32], mol_ids: &[u32], ) -> String

Generate the Atoms section for atom_style full.

Format: id mol-id type charge x y z

Source

pub fn write_atoms_molecular( positions: &[[f64; 3]], types: &[u32], mol_ids: &[u32], ) -> String

Generate the Atoms section for atom_style molecular.

Format: id mol-id type x y z

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.