dreid-forge 0.4.1

A pure Rust library and CLI that automates DREIDING force field parameterization by orchestrating structure repair, topology perception, and charge calculation for both biological and chemical systems.
Documentation
//! Potential energy function type configurations.
//!
//! This module defines the available (configurable) functional forms
//! of potential energy terms in the DREIDING force field.

/// Bond stretching potential function type.
///
/// Determines the functional form used for bond stretching terms
/// in the force field. Both options use the same equilibrium bond
/// length but differ in behavior far from equilibrium.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum BondPotentialType {
    /// Harmonic bond potential.
    #[default]
    Harmonic,

    /// Morse anharmonic potential.
    Morse,
}

/// Angle bending potential function type.
///
/// Determines the functional form used for angle bending terms.
/// The choice affects behavior especially for linear or near-linear
/// angles.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum AnglePotentialType {
    /// Cosine-harmonic or cosine-linear angle potential.
    #[default]
    Cosine,

    /// Theta-harmonic angle potential.
    Theta,
}

/// Van der Waals non-bonded potential function type.
///
/// Determines the functional form used for van der Waals (dispersion
/// and repulsion) interactions between non-bonded atom pairs.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum VdwPotentialType {
    /// Lennard-Jones 12-6 potential.
    #[default]
    LennardJones,

    /// Buckingham (Exponential-6) potential.
    Buckingham,
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn bond_potential_default() {
        assert_eq!(BondPotentialType::default(), BondPotentialType::Harmonic);
    }

    #[test]
    fn angle_potential_default() {
        assert_eq!(AnglePotentialType::default(), AnglePotentialType::Cosine);
    }

    #[test]
    fn vdw_potential_default() {
        assert_eq!(VdwPotentialType::default(), VdwPotentialType::LennardJones);
    }

    #[test]
    fn potential_types_are_copy() {
        let bond = BondPotentialType::Morse;
        let bond_copy = bond;
        assert_eq!(bond, bond_copy);

        let angle = AnglePotentialType::Cosine;
        let angle_copy = angle;
        assert_eq!(angle, angle_copy);

        let vdw = VdwPotentialType::Buckingham;
        let vdw_copy = vdw;
        assert_eq!(vdw, vdw_copy);
    }
}