Technical Documentation
ATOM DIRECTORY: The atom() Method

The atom() method is used to add a new Atom to a Group node. This method cannot be applied to an Atom node.

Method Name
Applicable
Argument Keywords
Return Value
atom
Group
"name", "existing", "renumber", "mass", "charge", "atomitype", "atomxtype", "mask"
The new Atom node
Keyword
Argument
Purpose
Preset Value
name
required
the name of this Atom
-
existing
optional
A value of 1 declares this atom to exist. A value of 0 declares this atom to be new.
0
renumber
optional
Specify a value of 0 to prevent atoms from being renumbered. Specify 1 to renumber.
1
mass
optional
atomic mass
-
charge
optional
atomic charge
-
atomitype
optional
inclusion atom type
-
atomxtype
optional
exclusion atom type
-
mask
optional
selection mask
-

The first argument, the name, must always be specified. No values are assigned to mass, charge and mask if no values are specified for these keywords. (But newly created atoms are given sensible default values for these properties.)

The newly created atom is assigned null atomitype and atomxtype values if no values are given for these parameters. Unless proper values are provided, the new atom will not participate in any force field term (except for Electrostatics). The values that you can assign are defined in the library of constants. This library is named when the top of the hierarchy is first created.

The Exclusion Atom Type (specified for the atomxtype keyword) is used to determine the force constants to be applied for force field terms that use an Exclusion list. In these terms, interactions are calculated for all pairs of atoms, except pairs that are specifically excluded in an Exclusion list. If an atom is assigned an Exclusion Atom Type that is a null string "", it is also excluded from all Exclusion list interactions.

The Inclusion Atom Type (specified for the atomxtype keyword) is used to determine the force constants to be applied for force terms that use an Inclusion list. For these terms, interactions are never implied, only those that explicitly appear in an Inclusion list are calculated. Constants for a given force field term is usually supplied for a limited number of combinations of Inclusion Atom Types. It is an error to create a force field term for a groups of atoms for which no constants exist. If the force constants library is complete, this would indicate that the attempted grouping does not make sense. If an atom is assigned a null string "" for the Inclusion Atom Type, the atom is automatically eliminated from in any Inclusion list interation.

It is an error to declare a value for the existing keyword that is in contradiction to the status of the atom. If an atom exists, any values specified for the last five arguments are used to modify the properties of the atom. There is a method to specifically modify the properties of an atom, see modify() below. The atom() method may be applied to a Group containing an existing atom to convert the atom name to the Atom object.

Usually, one would allow the renumbering to occur so that the atoms are always correctly indexed. There are times when the user may want to have greater control. For example, if you are adding many atoms and doing nothing else that require correctly numbered atoms, you can turn off atom renumbering as each atom is added. After the last atom has been added, you can then call the index() method to update the atom numbers.

In the following example, a single atom is attached to the top of a newly created hierarchy. The first argument, the name must always be specified so we did that without the keyword. Finally, since we do not save the return value of the method call, the returned object, the newly created Atom node, is printed:

>>> from Yup.Taro.AtomMap import *
>>> from Yup.Tools.misc import datasource
>>> Model = AtomMap( datasource( 'TestTube' ) )
>>>
>>> Model.atom( "first", mask = 1 )
+first 0:0 1:0 -1:-1 1

>>>
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