use glam::DVec3;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct UffAtomType(pub String);
impl UffAtomType {
pub fn as_str(&self) -> &str {
&self.0
}
pub fn unknown() -> Self {
Self("Unknown".to_string())
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Atom {
pub element: usize,
pub position: DVec3,
pub force: DVec3,
pub charge: f64,
pub uff_type: UffAtomType,
}
impl Atom {
pub fn new(element: usize, position: DVec3) -> Self {
Self {
element,
position,
force: DVec3::ZERO,
charge: 0.0,
uff_type: UffAtomType::unknown(),
}
}
pub fn with_charge(mut self, charge: f64) -> Self {
self.charge = charge;
self
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bond {
pub atom_indices: (usize, usize),
pub order: f32,
}