Sourcefiles/helperfunctions.cpp
/**
 * @fn void depositHeat(double heat, Atoms &atoms)
 * @brief deposits an amount of heat(energy) equally for each atom (the energy is only added exactly in case there is no kinetic energy, use depositRescaledHeat)
 * @param heat
 * @param atoms
 */
@fn void depositHeat(double heat, Atoms &atoms)
@brief deposits an amount of heat(energy) equally for each atom (the energy is only added exactly in case there is no kinetic energy, use depositRescaledHeat)
@param heat
@param atoms
@fn void depositHeat ( double heat Atoms &atoms ) @brief deposits an amount of heat ( energy ) equally for each atom ( the energy is only added exactly in case there is no kinetic energy use depositRescaledHeat ) @param heat @param atoms
void depositHeat(double heat, Atoms &atoms) {
    int nbAtoms = atoms.nb_atoms();
    double individualEnergy = heat/nbAtoms;
    for(int i = 0; i < nbAtoms; ++i) {
        double thisAtomsVelocity = sqrt((2*individualEnergy)/atoms.mass(i));
        Vector_t v;
        v.setRandom();
        v /= calculateDistanceBetweenVectors(v);
        v *= thisAtomsVelocity;
        atoms.velocities.col(i) += v;
    }
}
void depositHeat ( double heat , Atoms & atoms ) { int nbAtoms = atoms . nb_atoms ( ) ; double individualEnergy = heat / nbAtoms ; for ( int i = 0 ; i < nbAtoms ; ++ i ) { double thisAtomsVelocity = sqrt ( ( 2 * individualEnergy ) / atoms . mass ( i ) ) ; Vector_t v ; v . setRandom ( ) ; v /= calculateDistanceBetweenVectors ( v ) ; v *= thisAtomsVelocity ; atoms . velocities . col ( i ) += v ; } }
@fn void depositHeat(double heat, Atoms &atoms)
 @brief deposits an amount of heat(energy) equally for each atom (the energy is only added exactly in case there is no kinetic energy, use depositRescaledHeat)
 @param heat
 @param atoms
@fn void depositHeat ( double heat Atoms &atoms ) @brief deposits an amount of heat ( energy ) equally for each atom ( the energy is only added exactly in case there is no kinetic energy use depositRescaledHeat ) @param heat @param atoms
//get the number of Atoms //get the energy added to one atom //push throu //calculate the velocity // give it a random direction //add the velocity to the vector //add it to the velocities