Technical Documentation
ATOM DIRECTORY: Top of the Hierarchy

 

To create an atomic hierarchy, first create the top of the hierarchy by calling AtomMap() from the AtomMap module. Then attach other AtomGroup objects by using two AtomGroup methods atom() and group().

Function Name
Argument Keywords
Return Value
AtomMap
"libdir", "initial", "capacity", "increment"
The AtomGroup object representing the top of a new hierarchy
Keyword
Purpose
Preset Value
libdir
Directory containing the library of constants files.
There is no preset value. This argument must always be specified.
initial
Preallocate space to hold this many local Groups and Atoms in this node.
1
capacity
Preallocate space for this number of Atoms in the entire hierarchy.
100
increment
Expand space for this many more Atoms as needed.
10

The first argument must always be supplied. Other arguments are optional.

The "libdir" keyword is used to specify a directory containing a library of constants files. These files are produced by the fpf program. The value specified with the "initial" keyword is used to allocate space to hold this many Atom and Group directly in the top node. (The future Groups under the top node may hold other Groups and Atoms but no space is needed in the top node for their contents.) Space in the top node is expanded one at a time when needed. The properties of all the Atoms in the entire hierarchy are held in a separate table. The value specified for the "capacity" keyword is used to size this table. When the table is full, it is expanded by the amount specified with the "increment" keyword.

If you know the eventual population of Atoms and Groups that are held directly in the top node, specify the value for "initial". If you know the total number of atoms, including deleted atoms, specify the value for "capacity". This will avoid memory reallocation and the risk of memory "holes". Otherwise, it is best to accept the preset values.

Example:

>>> from Yup.Taro.AtomMap import *
>>> from Yup.Tools.misc import datasource
>>> Model = AtomMap( datasource( 'TestTube' ), capacity = 4500 )

Create the top of the hierarchy for an eventual population of about 4500 atoms and store the return value in the variable Model. The return value contains the reference to the newly created top node. You need to save this value so that you can continue to build the atom hierarchy. This model is bound to the constants library 'TestTube'. This is one of the standard libraries so its location can be specified simply by giving the name of the library, with the help of the datasource() function imported from the Tools.misc module in the Yup package.

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