Technical Documentation
ATOM DIRECTORY: Data Attributes

AtomGroup objects have several data attribute which you can view. These attributes cannot be modified by assignment.

These attributes are defined for all AtomGroup objects.

Attribute

Description

nodename

The name of this node. The top node has no name.

nodeorder

The sequence number (the order of insertion starting from 0) of this node in the parent node.

nodetype

Whether an "Atom" or a "Group" node.

pathname

The full pathname of this node starting from the top of the hierarchy.

CXType

The string "AtomMap"

version

The version string from the parameter library

rootmap

The root AtomMap

Python will identify the AtomMap module as a user defined C Type. If you wish to determine if a module is an AtomMap you can first use the built-in function hasattr to determine if the CXType attribute is defined and then test the value of the attribute against the string 'AtomMap'.

Example: assuming we have defined the hierarchy in the concrete example:

>>> print Ab4.nodename, "---", Ab4.nodetype, "---", Ab4.pathname
b4 --- Atom --- :b1:b2:a3:b4

The following attributes are defined only for Atom nodes:

Attribute

Description

atomindex

Atom Number or Atom Index starting from 0.

atomitype

Inclusion Atom Type. Blank if not specified, error string if incorrect specification.

atomxtype

Exclusion Atom Type. Blank if not specified, error string if incorrect specification.

charge

Atomic Charge. 0 if not specified.

mask

Value of the Selection Mask

mass

Atomic Mass. 1 if not specified.

reference

Reference number starting from 0. This is equal to atomindex if the atoms are inserted in strict depth-first order.

The following attributes are defined only for Group nodes:

Attribute

Description

capacity

Amount of space allocated in this Group to hold local Groups and Atoms.

firstatom

The atom number or index of the first atom in this Group (which may be in a descendent of this Group).

nextatom

One plus the atom number or index of the last atom in this Group (which may be in a descendent of this group). Or, the firstatom attribute for the next AtomGroup node.

numatoms

The total number of Atoms contained in this Group and in descendent Groups.

numgroups

This Group and the total number of Groups contained in this Group and in descendent Groups.

numlocal

The total number of Atoms and Groups contained locally in this Group. This must never exceed capacity.

numnames

This Group and the total number of Atoms and Groups contained in this Group and in descendent Groups.

Example:

>>> print Gb2.capacity, Gb2.numatoms, Gb2.numgroups, Gb2.numlocal, Gb2.numnames
4 8 4 4 12
Intro
Top
Group
Atom
Data
Print
String
Compare
Methods
Mapping
Example

Technical
Introduction
Directory
Vectors
Energy
Model
Assembly
Methods
FPF
FFF
AVF
TaroScript
YammpScript
Python
Utilities

Home
Information
News
User
Technical
Programmer
iYup
Download
Showcase
ETC