polymers/physics/single_chain/ufjc/log_squared/mod.rs
1#[cfg(feature = "python")]
2pub mod py;
3
4mod test;
5
6/// The log-squared link potential freely-jointed chain (log-squared-FJC) model thermodynamics.
7pub mod thermodynamics;
8
9/// The structure of the log-squared-FJC model.
10pub struct LOGSQUAREDFJC
11{
12    /// The mass of each hinge in the chain in units of kg/mol.
13    pub hinge_mass: f64,
14
15    /// The length of each link in the chain in units of nm.
16    pub link_length: f64,
17
18    /// The number of links in the chain.
19    pub number_of_links: u8,
20
21    /// The stiffness of each link in the chain in units of J/(molâ‹…nm^2).
22    pub link_stiffness: f64,
23
24    /// The thermodynamic functions of the model.
25    pub thermodynamics: self::thermodynamics::LOGSQUAREDFJC
26}
27
28/// The implemented functionality of the log-squared-FJC model.
29impl LOGSQUAREDFJC
30{
31    /// Initializes and returns an instance of the log-squared-FJC model.
32    pub fn init(number_of_links: u8, link_length: f64, hinge_mass: f64, link_stiffness: f64) -> Self
33    {
34        LOGSQUAREDFJC
35        {
36            hinge_mass,
37            link_length,
38            number_of_links,
39            link_stiffness,
40            thermodynamics: self::thermodynamics::LOGSQUAREDFJC::init(number_of_links, link_length, hinge_mass, link_stiffness),
41        }
42    }
43}