etomica.action
Class WriteConfiguration

java.lang.Object
  extended by etomica.action.WriteConfiguration
All Implemented Interfaces:
IAction
Direct Known Subclasses:
WriteConfigurationOriented

public class WriteConfiguration
extends Object
implements IAction

Dumps a box's configuration to a file. The coordinates are written in a format that can be read in by ConfigurationFile. The output file has a "pos_new" extension, which should be renamed to "pos" for use with ConfigurationFile.


Field Summary
protected  IVectorMutable writePosition
           
 
Constructor Summary
WriteConfiguration(ISpace space)
           
 
Method Summary
 void actionPerformed()
          Writes the leaf Atom coordinates to the file confName.pos_new.
 IBox getBox()
          Returns the box whose atom coordinates get written to the file.
 String getConfName()
          Returns the configuration name.
 boolean getDoApplyPBC()
          Returns true if PBC are applied to coordinates written to the file.
 void setBox(IBox newBox)
          Sets the box whose atom coordinates get written to the file.
 void setConfName(String newConfName)
          Sets the configuration name.
 void setDoApplyPBC(boolean newDoApplyPBC)
          Directs the writer to apply periodic boundary conditions or not (true by default).
 void setFileName(String newFileName)
           
protected  void writeAtom(FileWriter fileWriter, IAtom a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writePosition

protected final IVectorMutable writePosition
Constructor Detail

WriteConfiguration

public WriteConfiguration(ISpace space)
Method Detail

setConfName

public void setConfName(String newConfName)
Sets the configuration name. The file written to is newConfName.pos_new


getConfName

public String getConfName()
Returns the configuration name. The file written to is confName.pos_new


setFileName

public void setFileName(String newFileName)

setBox

public void setBox(IBox newBox)
Sets the box whose atom coordinates get written to the file.


getBox

public IBox getBox()
Returns the box whose atom coordinates get written to the file.


setDoApplyPBC

public void setDoApplyPBC(boolean newDoApplyPBC)
Directs the writer to apply periodic boundary conditions or not (true by default).


getDoApplyPBC

public boolean getDoApplyPBC()
Returns true if PBC are applied to coordinates written to the file.


actionPerformed

public void actionPerformed()
Writes the leaf Atom coordinates to the file confName.pos_new. If the file exists, it is overwritten.

Specified by:
actionPerformed in interface IAction

writeAtom

protected void writeAtom(FileWriter fileWriter,
                         IAtom a)
                  throws IOException
Throws:
IOException