1use glam::DVec3;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
6pub struct UffAtomType(pub String);
7
8impl UffAtomType {
9 pub fn as_str(&self) -> &str {
10 &self.0
11 }
12 pub fn unknown() -> Self {
13 Self("Unknown".to_string())
14 }
15}
16
17#[derive(Debug, Clone, Serialize, Deserialize)]
19pub struct Atom {
20 pub element: usize,
22 pub position: DVec3,
24 pub force: DVec3,
26 pub uff_type: UffAtomType,
28}
29
30impl Atom {
31 pub fn new(element: usize, position: DVec3) -> Self {
33 Self {
34 element,
35 position,
36 force: DVec3::ZERO,
37 uff_type: UffAtomType::unknown(),
38 }
39 }
40}
41
42#[derive(Debug, Clone, Serialize, Deserialize)]
44pub struct Bond {
45 pub atom_indices: (usize, usize),
47 pub order: f32,
49}