Sourcefiles/helperfunctions.cpp
/**
 * @fn void depositRescaledHeat(double heat, Atoms &atoms)
 * @brief adds heat to the atom System. Deposits exactly the heat that it says
 * @param heat
 * @param atoms
 */
@fn void depositRescaledHeat(double heat, Atoms &atoms)
@brief adds heat to the atom System. Deposits exactly the heat that it says
@param heat
@param atoms
@fn void depositRescaledHeat ( double heat Atoms &atoms ) @brief adds heat to the atom System . Deposits exactly the heat that it says @param heat @param atoms
void depositRescaledHeat(double heat, Atoms &atoms) {
    double kineticEnergy = calculateKineticEnergy(atoms);
    if( kineticEnergy == 0) {
        depositHeat(heat,atoms);
    }
    else {
        double factor = 1 + (heat/kineticEnergy);
        atoms.velocities *= sqrt(factor);
    }
}
void depositRescaledHeat ( double heat , Atoms & atoms ) { double kineticEnergy = calculateKineticEnergy ( atoms ) ; if ( kineticEnergy == 0 ) { depositHeat ( heat , atoms ) ; } else { double factor = 1 + ( heat / kineticEnergy ) ; atoms . velocities *= sqrt ( factor ) ; } }
@fn void depositRescaledHeat(double heat, Atoms &atoms)
 @brief adds heat to the atom System.
@fn void depositRescaledHeat ( double heat Atoms &atoms ) @brief adds heat to the atom System .
//the original function is perfect for this case