Module MMTK.Field

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.


Class AtomicField: A field whose values are determined by atomic quantities

This is an Glossary:abstract-base-class. To create field objects, use one of its subclasses.

Methods:

Class AtomicScalarField: Scalar field defined by atomic quantities

A subclass of MMTK.Field.AtomicField and MMTK.Visualization.Viewable.

Constructor: AtomicScalarField(system, grid_size, values)

system

any subset of a molecular system

grid_size

the spacing of a cubic grid on which the field values are stored

values

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:

Class AtomicVectorField: Vector field defined by atomic quantities

A subclass of MMTK.Field.AtomicField and MMTK.Visualization.Viewable.

Constructor: AtomicVectorField(system, grid_size, values)

system

any subset of a molecular system

grid_size

the spacing of a cubic grid on which the field values are stored

values

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: