fn parse_constraint(
line: &str,
constraints: &mut Vec<Constraint>,
) -> Result<(), ParseError>Expand description
Parses a single constraint line from the *CONSTR section.
Supports the following constraint types:
r atom1 atom2 target_distance- Bond length constrainta atom1 atom2 atom3 target_angle- Bond angle constraint (degrees)d atom1 atom2 atom3 atom4 target_dihedral- Dihedral angle constraint (degrees)
§Arguments
line- The constraint line to parseconstraints- Mutable vector to add parsed constraints to
§Returns
Ok(()) if parsing succeeds, Err(ParseError) with detailed error information if parsing fails.
§Examples
// Bond constraint: keep atoms 1-2 at 1.5 Angstrom
r 1 2 1.5
// Angle constraint: keep angle 1-2-3 at 120 degrees
a 1 2 3 120.0
// Dihedral constraint: keep dihedral 1-2-3-4 at 180 degrees
d 1 2 3 4 180.0