VelocityRescalingThermostat Class Reference

#include <VelocityRescalingThermostat.h>

Inheritance diagram for VelocityRescalingThermostat:

PeriodicEventHandler ScheduledEventHandler EventHandler

List of all members.


Detailed Description

This is an event handler that acts as a thermostat for controlling the temperature of a simulation.

It does this through velocity rescaling. At regular intervals, it calculates the total kinetic energy of the system, then rescales all the velocities so the kinetic energy will exactly equal kT/2 per degree of freedom. All values are assumed to be in MD units.

Public Member Functions

 VelocityRescalingThermostat (const MultibodySystem &system, Real temperature=293.15, Real rescalingInterval=1.0)
 Create a VelocityRescalingThermostat.
Real getTemperature ()
 Get the temperature this thermostat is set to maintain.
void setTemperature (Real temp)
 Set the temperature this thermostat is set to maintain.
void handleEvent (State &state, Real accuracy, const Vector &yWeights, const Vector &ooConstraintTols, Stage &lowestModified, bool &shouldTerminate) const
 This method is invoked to handle the event.
 ~VelocityRescalingThermostat ()


Constructor & Destructor Documentation

VelocityRescalingThermostat ( const MultibodySystem system,
Real  temperature = 293.15,
Real  rescalingInterval = 1.0 
)

Create a VelocityRescalingThermostat.

Parameters:
system the MultibodySystem to be simulated
temperature the temperature to maintain the system at. The default value is 293.15 Kelvin (20 C).
rescalingInterval the time interval at which to rescale velocities. The default value is 1.0.


Member Function Documentation

Real getTemperature (  ) 

Get the temperature this thermostat is set to maintain.

void setTemperature ( Real  temp  ) 

Set the temperature this thermostat is set to maintain.

void handleEvent ( State state,
Real  accuracy,
const Vector yWeights,
const Vector ooConstraintTols,
Stage lowestModified,
bool &  shouldTerminate 
) const [virtual]

This method is invoked to handle the event.

It is given a State which describes the system at the time when the event occurs, and it is permitted to modify any aspect of the state except the time. In doing so, it should respect the specified accuracy requirements for the continuous variables and constraints.

Parameters:
state the state of the system when the event occurred. This method should modify it to reflect the changes caused by the event.
accuracy the overall accuracy for the simulation. This acts as a multiplier for the weights and constraint tolerances.
yWeights a vector of weights for the continuous state variables. If this method modifies a variable, its new value should be accurate to within accuracy*yWeight.
ooConstraintTols a vector of constraint tolerances. If this method modifies the state, each constraint should be satisfied to within accuracy*ooConstraintTol.
lowestModified if this method modifies the state, it should set this to the lowest stage which it modified, so that the realization cache can be updated.
shouldTerminate if the event handler sets this to true, it will cause the simulation to terminate immediately.

Implements EventHandler.


The documentation for this class was generated from the following file:

Generated on Fri Sep 26 07:44:34 2008 for SimTKcore by  doxygen 1.5.6