You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Implement the core domain models that will represent all molecular structures within the new system. These data structures, residing in the crates/scream-core/src/core/models/ module, must be designed with Rust's principles of safety, ownership, and data-oriented design in mind. They will be intentionally "pure" and decoupled from I/O formats and force field specifics, serving as the universal language for all other components of the library. This implementation will replace the large, monolithic SCREAM_ATOM class and related structures from the legacy codebase with a clean, modular, and type-safe hierarchy. The successful completion of this task will provide the essential building blocks upon which the I/O, force field, and energy calculation modules will be built.
Tasks:
Finalize models Module Structure:
Confirm the file structure within crates/scream-core/src/core/models/ (atom.rs, residue.rs, chain.rs, topology.rs, system.rs).
Set up the mod.rs file to correctly declare and organize the sub-modules.
Implement Atom and Element Structures (atom.rs):
Define a type-safe Element enum with a from_str constructor for parsing.
Implement the core Atom struct containing index, serial, name, coords (using nalgebra::Point3<f64>), and element.
Write unit tests to verify Atom creation and basic property access.
Implement Residue Structure (residue.rs):
Implement the Residue struct to hold ResidueId, name, and a Vec<usize> of atom_indices.
Implement a HashMap<String, usize> for fast, by-name lookup of atom indices within the residue.
Write unit tests for Residue creation and atom lookup functionality.
Implement Chain Structure (chain.rs):
Implement the Chain struct to hold a char ID and an ordered Vec<Residue>.
Implement a HashMap<ResidueId, usize> for fast lookup of residues within the chain.
Write unit tests for Chain creation and residue access.
Implement Topology Data Structures (topology.rs):
Define the BondOrder enum (Single, Double, etc.).
Implement the Bond struct using global usize atom indices and a BondOrder.
Description:
Implement the core domain models that will represent all molecular structures within the new system. These data structures, residing in the
crates/scream-core/src/core/models/module, must be designed with Rust's principles of safety, ownership, and data-oriented design in mind. They will be intentionally "pure" and decoupled from I/O formats and force field specifics, serving as the universal language for all other components of the library. This implementation will replace the large, monolithicSCREAM_ATOMclass and related structures from the legacy codebase with a clean, modular, and type-safe hierarchy. The successful completion of this task will provide the essential building blocks upon which the I/O, force field, and energy calculation modules will be built.Tasks:
Finalize
modelsModule Structure:crates/scream-core/src/core/models/(atom.rs,residue.rs,chain.rs,topology.rs,system.rs).mod.rsfile to correctly declare and organize the sub-modules.Implement
AtomandElementStructures (atom.rs):Elementenum with afrom_strconstructor for parsing.Atomstruct containingindex,serial,name,coords(usingnalgebra::Point3<f64>), andelement.Atomcreation and basic property access.Implement
ResidueStructure (residue.rs):Residuestruct to holdResidueId,name, and aVec<usize>ofatom_indices.HashMap<String, usize>for fast, by-name lookup of atom indices within the residue.Residuecreation and atom lookup functionality.Implement
ChainStructure (chain.rs):Chainstruct to hold acharID and an orderedVec<Residue>.HashMap<ResidueId, usize>for fast lookup of residues within the chain.Chaincreation and residue access.Implement
TopologyData Structures (topology.rs):BondOrderenum (Single,Double, etc.).Bondstruct using globalusizeatom indices and aBondOrder.Bondcreation.Implement
MolecularSystemTop-Level Container (system.rs):MolecularSystemstruct as the primary owner of a flatVec<Atom>, aVec<Chain>, and aVec<Bond>.MolecularSystemBuilderto facilitate safe and consistent construction of the system from its components.MolecularSystem.