etomica.action
Class AtomActionRandomizeVelocity
java.lang.Object
etomica.action.AtomActionRandomizeVelocity
- All Implemented Interfaces:
- AtomAction, Serializable
public class AtomActionRandomizeVelocity
- extends Object
- implements AtomAction, Serializable
Action that sets the velocity vector of a given atom to a randomly
chosen value sampled from a Boltzmann distribution.
- See Also:
- Serialized Form
|
Method Summary |
void |
actionPerformed(IAtom a)
Assigns velocity to atom with components selected from a Maxwell-Boltzmann
distribution with temperature most recently set for the action. |
double |
getTemperature()
|
void |
setTemperature(double temperature)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
random
protected final IRandom random
AtomActionRandomizeVelocity
public AtomActionRandomizeVelocity(double temperature,
IRandom random)
- Constructs class to assign velocities according to the given temperature.
May be subsequently changed with setTemperature method.
actionPerformed
public void actionPerformed(IAtom a)
- Assigns velocity to atom with components selected from a Maxwell-Boltzmann
distribution with temperature most recently set for the action. If atom
mass is infinite, assigns a zero velocity.
- Specified by:
actionPerformed in interface AtomAction
getTemperature
public double getTemperature()
- Returns:
- Returns the Boltzmann-distribution temperature used to sample
the new velocity. Default value is that from Default class.
setTemperature
public void setTemperature(double temperature)
- Parameters:
temperature - The temperature to set.