forcefield
Class Bonds

java.lang.Object
  extended byforcefield.Bonds

public class Bonds
extends java.lang.Object

The Bonds class contains all the Bond information from the sytem.

Since:
0.1
Version:
0.2, August 2005
Author:
Mika Kastenholz, Vincent Kraeutler

Field Summary
 double[] b0
          Ideal bond length of bond[num].
 java.lang.String[] bt
          String of the BondType.
 int[] I
          Atom i of bond[num].
 int[] J
          Atom j of bond[num].
 double[] Kb
          Force constant of bond[num].
 int number
          Number of Bonds in the object.
 
Constructor Summary
Bonds(int num)
          The Bonds class contructor.
 
Method Summary
 void atomsboundto(int atom, java.util.ArrayList boundto, java.util.ArrayList bl)
          Determine the other atoms which are bound to a specified atom
 Bonds copies(int numCopies, int numAtoms)
           
 Bonds join(Bonds bonds, int numAtoms)
          Join this set of bonds with a set of bonds of another molecule.
 Bonds subset(int[] atomNumbers, int numAtoms)
          generate a new set of those bonds which only connect the atoms we're interested in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

number

public int number
Number of Bonds in the object.


I

public int[] I
Atom i of bond[num].


J

public int[] J
Atom j of bond[num].


Kb

public double[] Kb
Force constant of bond[num].


b0

public double[] b0
Ideal bond length of bond[num].


bt

public java.lang.String[] bt
String of the BondType.

Constructor Detail

Bonds

public Bonds(int num)
The Bonds class contructor.

Parameters:
num - number of Bonds to be added
See Also:
Bonds, BondType
Method Detail

copies

public Bonds copies(int numCopies,
                    int numAtoms)
Parameters:
numCopies -
numAtoms - the number of atoms in this molecule
Returns:
a new set of Bonds
See Also:
Particles.copy(int)

subset

public Bonds subset(int[] atomNumbers,
                    int numAtoms)
generate a new set of those bonds which only connect the atoms we're interested in. the new bonds have atom numbers reflecting the supplied atom numbers, i.e. if I[bb] == atomNumbers[ii], is the first matching bond, then subset(..).I[0] == ii. clear? hmm. let me put it differently. if you have a list of atoms atomNumbers, and you do particles.subset(atomNumbers), giving you a new set of particles, then bonds.subset(atomNumbers, particles.number) will give you the new set of bonds involving just atomNumbers with the correct numbering with respect to the new set of particles.

Parameters:
atomNumbers - the sorted list of atom numbers
numAtoms - the original number of atoms
Returns:
a new set of Bonds
See Also:
Particles.subset(int[])

join

public Bonds join(Bonds bonds,
                  int numAtoms)
Join this set of bonds with a set of bonds of another molecule.

Parameters:
bonds - the bonds in the other molecule
numAtoms - the atom number offset (i.e. zero for identical molecules, otherwise the number of atoms in this molecule)
Returns:
a new set of Bonds
See Also:
Particles.join(Particles)

atomsboundto

public void atomsboundto(int atom,
                         java.util.ArrayList boundto,
                         java.util.ArrayList bl)
Determine the other atoms which are bound to a specified atom

Parameters:
atom - (atom to determine bonded atoms with)
boundto - (ArrayList with bonded atoms)
bl - (bond length of bonded atoms)