Data output

Common functions for Data output

setPrecision(int npre)

Set the number of places after decimal point.

setHead(int nhead)

Set the number of places before decimal point.

Collective information

class DumpInfo(all_info, comp_info, filename)

Constructor of an information dump object for a group of particles.

Parameters:
  • all_info (AllInfo) – System information.

  • comp_info (ComputeInfo) – Object for calculating collective information.

  • filename (str) – Output file name.

dumpAnisotropy()

Outputs information related to anisotropic particles.

dumpVirial(Force object)

Outputs virials of the Force object.

dumpPotential(Force object)

Outputs potentials of the Force object.

dumpVirialMatrix(Force object)

Outputs virial matrixes including ‘virial_xx’, ‘virial_xy’, ‘virial_xz’, ‘virial_yy’, ‘virial_yz’, and ‘virial_zz’ of the Force object.

dumpPressTensor()

Outputs press tensors including ‘press_xx’, ‘press_xy’, ‘press_xz’, ‘press_yy’, ‘press_yz’, and ‘press_zz’ of the system.

dumpTypeTemp(string type)

Outputs temperatures of a type of particles.

dumpParticleForce(int tag_i)

Outputs the forces of a particle indicated by tag_i in order to trace it’s force condition.

dumpParticlePosition(int tag_i)

Outputs the positions of a particle indicated by tag_i in order to trace it’s position.

dumpBoxSize()

Outputs box sizes including the box lengths in ‘X’, ‘Y’, and ‘Z’ directions and volume.

setPeriod(int period)

Period to output data.

Example:

dinfo = gala.DumpInfo(all_info, comp_info, 'data.log')
dinfo.setPeriod(200)
app.add(dinfo)

MOL2 dump

class MOL2Dump(all_info, filename)

Constructor of an object to dump mol2 files.

Parameters:
  • all_info (AllInfo) – System information.

  • filename (str) – Output file base name.

setChangeFreeType(string type)

specifies the type of free particles which will be changed to be ‘F’ in output file.

deleteBoundaryBond(bool switch)

switches on the function of screening the bonds across the box with ‘True’.

Example:

mol2 = gala.MOL2Dump(all_info, 'particles')
mol2.setPeriod(100000)
mol2.deleteBoundaryBond(True)
app.add(mol2)

XML dump

class XMLDump(all_info, filename)

Constructor of an object to dump XML files.

Parameters:
  • all_info (AllInfo) – System information.

  • filename (str) – Output file base name.

class XMLDump(all_info, group, filename)

Constructor of an object to dump XML files for a group of particles.

Parameters:
  • all_info (AllInfo) – System information.

  • group (ParticleSet) – A group of particles.

  • filename (str) – Output file base name.

setOutput(PyObject* out_put_list)

indicates the output data type with the candidates:

        ['position', 'type', 'velocity', 'mass', 'image', 'force',
        'potential', 'virial', 'virial_matrix', 'charge', 'diameter',
        'body', 'orientation', 'quaternion', 'rotation', 'rotangle',
        'torque', 'inert', 'init', 'cris', 'molecule', 'bond', 'angle',
        'dihedral', 'constraint', 'vsite']

Each data type also could be outputed by a single function as following.
setOutputPosition(bool switch)

Outputs particle position (default value is true).

setOutputType(bool switch)

Outputs particle type (default value is true).

setOutputImage(bool switch)

Outputs particle image.

setOutputVelocity(bool switch)

Outputs particle velocity.

setOutputMass(bool switch)

Outputs particle mass.

setOutputCharge(bool switch)

Outputs particle charge.

setOutputDiameter(bool switch)

Outputs particle diameter.

setOutputBody(bool switch)

Outputs particle body.

setOutputVirial(bool switch)

Outputs particle virial.

setOutputForce(bool switch)

Outputs particle force (x, y, z).

setOutputPotential(bool switch)

Outputs particle potential.

setOutputOrientation(bool switch)

Outputs particle orientation.

setOutputQuaternion(bool switch)

Outputs particle quaternion.

setOutputRotation(bool switch)

Outputs particle rotation velocity.

setOutputRotangle(bool switch)

Outputs particle accumulated rotated angle at the direction of (0, 0, 1) in 3D or (0, 1, 0) in 2D.

setOutputTorque(bool switch)

Outputs particle torque.

setOutputInert(bool switch)

Outputs particle inert tensor.

setOutputInit(bool switch)

Outputs particle initiator indicator.

setOutputCris(bool switch)

Outputs particle cross-linking indicator.

setOutputBond(bool switch)

Outputs bonds.

setOutputAngle(bool switch)

Outputs angles.

setOutputDihedral(bool switch)

Outputs dihedrals.

setOutputConstraint(bool switch)

Outputs bond constraints.

setOutputVsite(bool switch)

Outputs virual sites.

setOutputLocalForce(Force object)

Outputs particle force(x, y, z and w where w is potential) of a Force object.

setOutputLocalVirial(Force object)

Outputs particle virial of a Force object.

setOutputLocalVirialMatrix(Force object)

Outputs particle virial matrix of a Force object.

setOutputPatch(AniForce object)

outputs patch information for display in OVITO.

setOutputEllipsoid(BondForceHarmonicEllipsoid object)

outputs ellipsoid bond information for display in OVITO.

setOutputEllipsoid(PBGBForce object)

outputs ellipsoid information for display in OVITO.

setOutputEllipsoid(GBForce object)

outputs ellipsoid information for display in OVITO.

Example:

xml = gala.XMLDump(all_info, 'particles')
xml.setOutput(['image', 'bond'])
xml.setPeriod(100000)
app.add(xml)

DCD trajectory dump

class DCDDump(all_info, filename, overwrite)

The constructor of a dump object of DCD file.

Parameters:
  • all_info (AllInfo) – The system information.

  • filename (str) – The output file name.

  • overwrite (bool) – If overwrite the existed DCD file.

class DCDDump(all_info, group, filename, overwrite)

The constructor of a dump object of DCD file for a group of particles.

Parameters:
  • all_info (AllInfo) – The system information.

  • group (ParticleSet) – The group of particles.

  • filename (str) – The output file name.

  • overwrite (bool) – If overwrite the existed DCD file.

unpbc(bool switch)

Outputs particle positions without the application of periodic boundary condition (PBC). Default value is False, i.e. with PBC condition.

unwrap(bool switch)

Unwraps the molecules across box boundary due to PBC condition. Default value is False, i.e. wrapping molecules.

Example:

dcd = gala.DCDDump(all_info, 'particles', True)
dcd.unwrap(True)
dcd.setPeriod(100000)
app.add(dcd)

Binary dump

class BinaryDump(all_info, filename)

Constructor of an object to dump binary files.

Parameters:
  • all_info (AllInfo) – System information.

  • filename (str) – Output file base name.

setOutput(PyObject* out_put_list)

indicates the output data type with the candidates:

['position', 'type', 'velocity', 'mass', 'image', 'force',
'potential', 'virial', 'virial_matrix', 'charge', 'diameter',
'body', 'orientation', 'quaternion', 'rotation', 'rotangle',
'torque', 'inert', 'init', 'cris', 'molecule', 'bond', 'angle',
'dihedral', 'constraint', 'vsite']
setOutputAll()

Outputs all data.

setOutputForRestart()

Outputs data needed for restarting.

enableCompression(bool switch)

Compresses output file.

Example:

binary = gala.BinaryDump(all_info, 'particle')
binary.setOutput(['image', 'bond'])
binary.setPeriod(10000)
app.add(binary)