// Copyright (c) 2009-2016 The Regents of the University of Michigan
// This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.


// Maintainer: joaander

/*! \file TempRescaleUpdater.h
    \brief Declares an updater that rescales velocities to achieve a set temperature
*/

#ifdef NVCC
#error This header cannot be compiled by nvcc
#endif
#include "hoomd/Updater.h"
#include "hoomd/ComputeThermo.h"
#include "hoomd/Variant.h"

#include <boost/shared_ptr.hpp>

#include <vector>

#ifndef __TEMPRESCALEUPDATER_H__
#define __TEMPRESCALEUPDATER_H__

//! Updates particle velocities to set a temperature
/*! This updater computes the current temperature of the system and then scales the velocities in order to set the
    temperature.

    \ingroup updaters
*/
class TempRescaleUpdater : public Updater
    {
    public:
        //! Constructor
        TempRescaleUpdater(boost::shared_ptr<SystemDefinition> sysdef,
                           boost::shared_ptr<ComputeThermo> thermo,
                           boost::shared_ptr<Variant> tset);

        //! Destructor
        ~TempRescaleUpdater();

        //! Take one timestep forward
        virtual void update(unsigned int timestep);

        //! Change the temperature set point
        void setT(boost::shared_ptr<Variant> T);

    private:
        boost::shared_ptr<ComputeThermo> m_thermo;  //!< Computes the temperature
        boost::shared_ptr<Variant> m_tset;          //!< Temperature set point
    };

//! Export the TempRescaleUpdater to python
void export_TempRescaleUpdater();

#endif
