etomica.action
Class BoxInflate

java.lang.Object
  extended by etomica.action.BoxActionAdapter
      extended by etomica.action.BoxInflate
All Implemented Interfaces:
BoxAction, IAction, Undoable, Serializable
Direct Known Subclasses:
BoxInflateDeformable

public class BoxInflate
extends BoxActionAdapter
implements Undoable

Performs actions that cause volume of system to expand or contract, with molecule positions scaled to keep them in the same relative positions. Inflation can be isotropically or anisotropically.

See Also:
Serialized Form

Field Summary
protected  IVectorMutable dimVector
           
protected  MoleculeChildAtomAction groupScaler
           
protected  AtomPositionGeometricCenter moleculeCenter
           
protected  IVectorMutable scaleVector
           
protected  AtomActionTranslateBy translator
           
 
Fields inherited from class etomica.action.BoxActionAdapter
box
 
Constructor Summary
BoxInflate(IBox box, ISpace space)
          Constructs action ready to be performed on the given box.
BoxInflate(ISpace space)
          Constructs action with a default scale of 1.0.
 
Method Summary
 void actionPerformed()
          Performs boundary dimension change
 double getScale()
           
 double getTargetDensity()
          Returns the target density of the action.
 IVector getVectorScale()
          Returns the current value of the inflation scale in each dimension.
 void setScale(double scale)
          Sets the scale defining the amount of inflation.
 void setTargetDensity(double newTargetDensity)
          Sets the action to change the box dimensions isotropically to achieve the given density.
 void setVectorScale(IVector scale)
          Sets the scale defining the amount of inflation for each dimension.
 void undo()
          Reverses the action of the inflation by performing the action with a scale given the by the reciprocal of the current scale.
 
Methods inherited from class etomica.action.BoxActionAdapter
getBox, setBox
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

translator

protected final AtomActionTranslateBy translator

groupScaler

protected final MoleculeChildAtomAction groupScaler

scaleVector

protected final IVectorMutable scaleVector

dimVector

protected final IVectorMutable dimVector

moleculeCenter

protected final AtomPositionGeometricCenter moleculeCenter
Constructor Detail

BoxInflate

public BoxInflate(ISpace space)
Constructs action with a default scale of 1.0. Requires call to setBox before action can have any effect.


BoxInflate

public BoxInflate(IBox box,
                  ISpace space)
Constructs action ready to be performed on the given box.

Method Detail

setScale

public void setScale(double scale)
Sets the scale defining the amount of inflation. A value of 1.0 causes no change, while a value greater than 1.0 expands the box, and a value less than 1.0 contracts the box. Coordinates and boundary dimensions are all multiplied by the scale when action is performed. A zero or negative scale throws an IllegalArgumentException.


getScale

public double getScale()
Returns:
Current value of the inflation scale. Assumes isotropic scaling had been set eariler.

setVectorScale

public void setVectorScale(IVector scale)
Sets the scale defining the amount of inflation for each dimension. A value of 1.0 causes no change, while a value greater than 1.0 expands the box, and a value less than 1.0 contracts the box. Coordinates and boundary dimensions are all multiplied by the scale when action is performed. A zero or negative scale throws an IllegalArgumentException.


getVectorScale

public IVector getVectorScale()
Returns the current value of the inflation scale in each dimension.


setTargetDensity

public void setTargetDensity(double newTargetDensity)
Sets the action to change the box dimensions isotropically to achieve the given density.


getTargetDensity

public double getTargetDensity()
Returns the target density of the action.


actionPerformed

public void actionPerformed()
Performs boundary dimension change

Specified by:
actionPerformed in interface IAction

undo

public void undo()
Reverses the action of the inflation by performing the action with a scale given the by the reciprocal of the current scale. Value of scale is not changed as a result.

Specified by:
undo in interface Undoable