This module defines field objects that are useful in the analysis and visualization of collective motions in molecular systems. Atomic quantities characterizing collective motions vary slowly in space, and can be considered functions of position instead of values per atom. Functions of position are called fields, and mathematical techniques for the analysis of fields have proven useful in many branches of physics. Fields can be described numerically by values on a regular grid. In addition to permitting the application of vector analysis methods to atomic quantities, the introduction of fields is a valuable visualization aid, because information defined on a coarse regular grid can be added to a picture of a molecular system without overloading it. See also the example Miscellaneous/vector_field.py.
This is an Glossary:abstract-base-class. To create field objects, use one of its subclasses.
Methods:Returns the values of the field at the positions of the atoms in an appropriate subclass of MMTK.ParticleProperties.ParticleProperty.
Writes a graphical representation of the field to the VRML file named by filename, multiplying all values by scale. color permits the choice of a color for the graphics objects.
Shows a graphical representation of the field using a VRML viewer. All values are multiplied by scale. color permits the choice of a color for the graphics objects.
A subclass of MMTK.Field.AtomicField and MMTK.Visualization.Viewable.
Constructor: AtomicScalarField(system, grid_size, values)
any subset of a molecular system
the spacing of a cubic grid on which the field values are stored
an object of class MMTK.ParticleScalar containing the atomic values that define the field
The field values are obtained by averaging the atomic quantities over all atoms in a cube of edge length grid_size surrounding each grid point.
The method graphicsObjects, defined in class MMTK.Visualization.Viewable, returns a small cube for each grid point, whose color indicates the field's value on a symmetric red-to-green color scale defined by the range of the field values. Additional keyword options are:
-- scale=factor, to multiply all field values by a factor
-- range=(min, max), to eliminate graphics objects for values that are smaller than min or larger than max
Methods:Returns an MMTK.Field.AtomicVectorField object representing the gradient of the field.
Returns an MMTK.Field.AtomicScalarField object representing the laplacian of the field.
A subclass of MMTK.Field.AtomicField and MMTK.Visualization.Viewable.
Constructor: AtomicVectorField(system, grid_size, values)
any subset of a molecular system
the spacing of a cubic grid on which the field values are stored
an object of class MMTK.ParticleVector containing the atomic values that define the field
The field values are obtained by averaging the atomic quantities over all atoms in a cube of edge length grid_size surrounding each grid point.
The method graphicsObjects, defined in class MMTK.Visualization.Viewable, returns a small arrow for each grid point. The arrow starts at the grid point and represents the vector value at that point. Additional keyword options are:
-- scale=factor, to multiply all field values by a factor
-- diameter=number, to define the diameter of the arrow objects (default: 1.)
-- range=(min, max), to eliminate graphics objects for values whose lengths are smaller than min or larger than max
-- color=string, to define the color of the arrows
Methods:Returns an MMTK.Field.AtomicScalarField object representing the length of the field vectors.
Returns an MMTK.Field.AtomicScalarField object representing the divergence of the field.
Returns an MMTK.Field.AtomicVectorField object representing the curl of the field.
Returns an MMTK.Field.AtomicVectorField object representing the laplacian of the field.