fn real_space_atomic_virial(&self, configuration: &Configuration) -> Matrix3 {
        let natoms = configuration.size();
        let charges = configuration.particles().charge;

        let virial = (0..natoms).into_par_iter().map(|i| {
            let qi = charges[i];
            if qi == 0.0 {
                return Matrix3::zero();
            }
            let mut local_virial = Matrix3::zero();

            for j in i + 1..natoms {
                let qj = charges[j];
                if qj == 0.0 {
                    continue;
                }

                let path = configuration.bond_path(i, j);
                let info = self.restriction.information(path);

                let rij = configuration.nearest_image(i, j);
                let force = self.real_space_force_pair(info, qi * qj, rij.norm()) * rij;
                local_virial += force.tensorial(&rij);
            }
            local_virial
        });
        return virial.sum();
    }
/// Real space contribution to the atomic virial
Real space contribution to the atomic virial
Real space contribution to the atomic virial
fn real_space_atomic_virial(&self, configuration: &Configuration) -> Matrix3 {
        let natoms = configuration.size();
        let charges = configuration.particles().charge;
        let virial = (0..natoms).into_par_iter().map(|i| {
            let qi = charges[i];
            if qi == 0.0 {
                return Matrix3::zero();
            }
            let mut local_virial = Matrix3::zero();
            for j in i + 1..natoms {
                let qj = charges[j];
                if qj == 0.0 {
                    continue;
                }
                let path = configuration.bond_path(i, j);
                let info = self.restriction.information(path);
                let rij = configuration.nearest_image(i, j);
                let force = self.real_space_force_pair(info, qi * qj, rij.norm()) * rij;
                local_virial += force.tensorial(&rij);
            }
            local_virial
        });
        return virial.sum();
    }
fn real_space_atomic_virial ( & self , configuration : & Configuration ) -> Matrix3 { let natoms = configuration . size ( ) ; let charges = configuration . particles ( ) . charge ; let virial = ( 0 .. natoms ) . into_par_iter ( ) . map ( | i | { let qi = charges [ i ] ; if qi == 0.0 { return Matrix3 :: zero ( ) ; } let mut local_virial = Matrix3 :: zero ( ) ; for j in i + 1 .. natoms { let qj = charges [ j ] ; if qj == 0.0 { continue ; } let path = configuration . bond_path ( i , j ) ; let info = self . restriction . information ( path ) ; let rij = configuration . nearest_image ( i , j ) ; let force = self . real_space_force_pair ( info , qi * qj , rij . norm ( ) ) * rij ; local_virial += force . tensorial ( & rij ) ; } local_virial } ) ; return virial . sum ( ) ; }
Real space contribution to the atomic virial
Real space contribution to the atomic virial
&self
configuration
&Configuration