lumol-org / lumol

Universal extensible molecular simulation engine
http://lumol.org/
BSD 3-Clause "New" or "Revised" License
184 stars 18 forks source link

Better molecules type #249

Closed Luthaf closed 5 years ago

Luthaf commented 5 years ago

This implement the end of #18, specifically the strategy in https://github.com/lumol-org/lumol/issues/18#issuecomment-268860305.

The idea is to have a real Molecule type, containing both bonding informations and particles. This means that functions needing particle information (center_of_mass, wrap, ...) can be implemented directly on the Molecule type.

Because the particles are stored in a SoA fashion inside the system, this also adds the MoleculeRef and MoleculeRefMut types, which are analogues to &Molecule and &mut Molecule, with data pointing inside a System.