pub struct LammpsDataSectionBuilder {
pub masses: Vec<(usize, f64)>,
pub pair_coeffs: Vec<(usize, usize, f64, f64)>,
pub bond_coeffs: Vec<(usize, f64, f64)>,
pub angle_coeffs: Vec<(usize, f64, f64)>,
}Expand description
Builder for the coefficient sections of a LAMMPS data file.
Generates the Masses, Pair Coeffs, and Bond Coeffs sections.
Fields§
§masses: Vec<(usize, f64)>(type_id, mass)
pair_coeffs: Vec<(usize, usize, f64, f64)>(type_i, type_j, epsilon, sigma)
bond_coeffs: Vec<(usize, f64, f64)>(bond_type, k, r0)
angle_coeffs: Vec<(usize, f64, f64)>(angle_type, k, theta0_deg)
Implementations§
Source§impl LammpsDataSectionBuilder
impl LammpsDataSectionBuilder
Sourcepub fn add_pair_coeff(
&mut self,
type_i: usize,
type_j: usize,
epsilon: f64,
sigma: f64,
)
pub fn add_pair_coeff( &mut self, type_i: usize, type_j: usize, epsilon: f64, sigma: f64, )
Add a Lennard-Jones pair coefficient.
Sourcepub fn add_bond_coeff(&mut self, bond_type: usize, k: f64, r0: f64)
pub fn add_bond_coeff(&mut self, bond_type: usize, k: f64, r0: f64)
Add a harmonic bond coefficient.
Sourcepub fn add_angle_coeff(&mut self, angle_type: usize, k: f64, theta0_deg: f64)
pub fn add_angle_coeff(&mut self, angle_type: usize, k: f64, theta0_deg: f64)
Add a harmonic angle coefficient.
Sourcepub fn masses_section(&self) -> String
pub fn masses_section(&self) -> String
Generate the Masses section text.
Sourcepub fn pair_coeffs_section(&self) -> String
pub fn pair_coeffs_section(&self) -> String
Generate the Pair Coeffs section text.
Sourcepub fn bond_coeffs_section(&self) -> String
pub fn bond_coeffs_section(&self) -> String
Generate the Bond Coeffs section text.
Sourcepub fn angle_coeffs_section(&self) -> String
pub fn angle_coeffs_section(&self) -> String
Generate the Angle Coeffs section text.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LammpsDataSectionBuilder
impl RefUnwindSafe for LammpsDataSectionBuilder
impl Send for LammpsDataSectionBuilder
impl Sync for LammpsDataSectionBuilder
impl Unpin for LammpsDataSectionBuilder
impl UnsafeUnpin for LammpsDataSectionBuilder
impl UnwindSafe for LammpsDataSectionBuilder
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
Mutably borrows from an owned value. Read more
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.