fn k_space_molecular_virial(&mut self, configuration: &Configuration) -> Matrix3 {
        let atomic = self.k_space_atomic_virial(configuration);

        let mut forces = vec![Vector3D::zero(); configuration.size()];
        self.k_space_forces(configuration, &mut forces);

        let positions = configuration.particles().position;
        let mut correction = Matrix3::zero();
        for molecule in configuration.molecules() {
            let com = molecule.center_of_mass();
            for i in molecule.indexes() {
                let di = positions[i] - com;
                correction += forces[i].tensorial(&di);
            }
        }

        return atomic - correction;
    }
/// k-space contribution to the molecular virial
k-space contribution to the molecular virial
k - space contribution to the molecular virial
fn k_space_molecular_virial(&mut self, configuration: &Configuration) -> Matrix3 {
        let atomic = self.k_space_atomic_virial(configuration);
        let mut forces = vec![Vector3D::zero(); configuration.size()];
        self.k_space_forces(configuration, &mut forces);
        let positions = configuration.particles().position;
        let mut correction = Matrix3::zero();
        for molecule in configuration.molecules() {
            let com = molecule.center_of_mass();
            for i in molecule.indexes() {
                let di = positions[i] - com;
                correction += forces[i].tensorial(&di);
            }
        }
        return atomic - correction;
    }
fn k_space_molecular_virial ( & mut self , configuration : & Configuration ) -> Matrix3 { let atomic = self . k_space_atomic_virial ( configuration ) ; let mut forces = vec ! [ Vector3D zero ( ) configuration size ( ) ] ; self . k_space_forces ( configuration , & mut forces ) ; let positions = configuration . particles ( ) . position ; let mut correction = Matrix3 :: zero ( ) ; for molecule in configuration . molecules ( ) { let com = molecule . center_of_mass ( ) ; for i in molecule . indexes ( ) { let di = positions [ i ] - com ; correction += forces [ i ] . tensorial ( & di ) ; } } return atomic - correction ; }
k-space contribution to the molecular virial
k - space contribution to the molecular virial
&mut self
configuration
&Configuration