pub fn add_molecule(&mut self, mut molecule: Molecule) {
        for particle in molecule.particles() {
            assert_ne!(*particle.kind, ParticleKind::invalid());
            if *particle.mass < 0.0 || f64::is_nan(*particle.mass) {
                warn_once!(
                    "Adding a particle ({}) with an invalid mass: {}",
                    particle.name, particle.mass
                );
            }
        }

        let mut bonding = molecule.bonding;
        bonding.translate_by(self.particles.len() as isize);

        self.molecule_ids.append(&mut vec![self.bondings.len(); bonding.size()]);
        self.bondings.push(bonding);
        self.particles.append(&mut molecule.particles);
    }
/// Add a molecule to the configuration, putting the new particles at the
/// end of the particles list
Add a molecule to the configuration, putting the new particles at the
end of the particles list
Add a molecule to the configuration putting the new particles at the end of the particles list
pub fn add_molecule(&mut self, mut molecule: Molecule) {
        for particle in molecule.particles() {
            assert_ne!(*particle.kind, ParticleKind::invalid());
            if *particle.mass < 0.0 || f64::is_nan(*particle.mass) {
                warn_once!(
                    "Adding a particle ({}) with an invalid mass: {}",
                    particle.name, particle.mass
                );
            }
        }
        let mut bonding = molecule.bonding;
        bonding.translate_by(self.particles.len() as isize);
        self.molecule_ids.append(&mut vec![self.bondings.len(); bonding.size()]);
        self.bondings.push(bonding);
        self.particles.append(&mut molecule.particles);
    }
pub fn add_molecule ( & mut self , mut molecule : Molecule ) { for particle in molecule . particles ( ) { assert_ne ! ( particle kind ParticleKind invalid ( ) ) ; if * particle . mass < 0.0 || f64 :: is_nan ( * particle . mass ) { warn_once ! ( " " particle name particle mass ) ; } } let mut bonding = molecule . bonding ; bonding . translate_by ( self . particles . len ( ) as isize ) ; self . molecule_ids . append ( & mut vec ! [ self bondings len ( ) bonding size ( ) ] ) ; self . bondings . push ( bonding ) ; self . particles . append ( & mut molecule . particles ) ; }
Add a molecule to the configuration, putting the new particles at the
end of the particles list
Add a molecule to the configuration putting the new particles at the end of the particles list
&mut self
molecule
Molecule