pub struct PolymerChain {
pub smiles: String,
pub repeat_count: usize,
pub mn: f64,
pub composition: Vec<MonomerUnit>,
pub architecture: Architecture,
}Expand description
A single, fully resolved polymer chain instance.
A PolymerChain is the output of a builder: it holds the concrete SMILES
string for the generated chain together with metadata computed at build time.
Fields§
§smiles: StringSMILES string representing this specific chain.
repeat_count: usizeNumber of repeat units incorporated into the chain.
mn: f64Number-average molecular weight in g/mol.
composition: Vec<MonomerUnit>Monomer composition: each unit type with its molar fraction.
Homopolymers have a single element with fraction 1.0. Empty when composition was not tracked by the builder.
architecture: ArchitecturePolymer architecture (linear by default).
Implementations§
Source§impl PolymerChain
impl PolymerChain
Sourcepub fn new(smiles: String, repeat_count: usize, mn: f64) -> Self
pub fn new(smiles: String, repeat_count: usize, mn: f64) -> Self
Creates a new PolymerChain with the given SMILES, repeat count, and Mn.
composition defaults to empty and architecture to Linear.
Use the builder methods Self::with_composition and
Self::with_architecture to populate these fields.
Sourcepub fn with_composition(self, composition: Vec<MonomerUnit>) -> Self
pub fn with_composition(self, composition: Vec<MonomerUnit>) -> Self
Attaches monomer composition metadata to this chain.
Sourcepub fn with_architecture(self, architecture: Architecture) -> Self
pub fn with_architecture(self, architecture: Architecture) -> Self
Attaches architecture metadata to this chain.
Trait Implementations§
Source§impl Clone for PolymerChain
impl Clone for PolymerChain
Source§fn clone(&self) -> PolymerChain
fn clone(&self) -> PolymerChain
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more