Description:
This task implements the heart of the library: the forge module. This module orchestrates the transformation of a raw chemical or biological System into a fully parameterized ForgedSystem ready for molecular dynamics simulation. It acts as the central coordinator, integrating topology perception (via dreid-typer) and partial charge calculation (via cheq) with a custom parameterization engine that strictly applies the rules of the DREIDING force field. The design emphasizes modularity, configuration-driven behavior, and complete encapsulation of the underlying physics engines. The module will process the internal System representation, assign atom types, calculate charges, and then generate all bond, angle, torsion, and non-bonded potential terms required for the final output.
Tasks:
Description:
This task implements the heart of the library: the
forgemodule. This module orchestrates the transformation of a raw chemical or biologicalSysteminto a fully parameterizedForgedSystemready for molecular dynamics simulation. It acts as the central coordinator, integrating topology perception (viadreid-typer) and partial charge calculation (viacheq) with a custom parameterization engine that strictly applies the rules of the DREIDING force field. The design emphasizes modularity, configuration-driven behavior, and complete encapsulation of the underlying physics engines. The module will process the internalSystemrepresentation, assign atom types, calculate charges, and then generate all bond, angle, torsion, and non-bonded potential terms required for the final output.Tasks:
Phase 1: Module Structure and Configuration
src/forge/,src/forge/error.rs,src/forge/config.rs,src/forge/state.rs,src/forge/adapters.rs,src/forge/params.rs, andsrc/forge/engine.rs.src/forge/error.rs: Define a specializedErrorenum for the parameterization process, covering rule parsing errors, missing topology, and failures fromcheqordreid-typer.src/forge/config.rs:ForgeConfigas the main control struct.ChargeMethodenum (QEq vs. None) andQEqConfigstruct.Phase 2: Internal State and Adapters
src/forge/state.rs:ProcessingStatestruct. It should hold the originalSystemand parallel vectors for mutable properties:charges,atom_types(String), andhybridizations.cheq::AtomViewforProcessingStateto allow zero-copy charge calculation.src/forge/adapters.rs:perceive_topology: ConvertsSystemtodreid-typer::MolecularGraph, runs the typer (using custom rules if provided), and writes types/hybridization back toProcessingState.calculate_charges: Configures and runs thecheqsolver based onChargeMethod, updatingProcessingState.charges.Phase 3: Parameter Database
src/forge/params.rs:DreidingParams,AtomParamRaw) that mirror Tables I-VII from the DREIDING paper.serde.include_str!and provide aload_parametersfunction that merges defaults with user overrides.Phase 4: The Parameterization Engine
src/forge/engine.rs:parameterizefunction.atom_types.VdwPairPotentialentries for all type pairs.HBondPotentialentries (using the "Charge" convention parameters:ForgedSystem.Phase 5: Public API and Integration
src/forge/mod.rs:process(System, &ForgeConfig) -> Result<ForgedSystem>function that sequences the entire pipeline.ForgeConfig,ChargeMethod) to the library root.forgepipeline on a simple molecule (e.g., ethane) and asserts that correct types ("C_3") and bond parameters are assigned.