GenericMol Class Reference

#include <GromacsTopFile.h>

List of all members.

Public Member Functions

 GenericMol (const char *theName)
int getNumAtoms () const
int getNumBonds () const
int getNumAngles () const
int getNumDihedrals () const
int getNumRes () const
void addAtom (const char *theType, int theTypeNum, int theResNum, const char *theResType, const char *theAtomName, Real theCharge, Real theMass)
void addBond (int atomi, int atomj, int type)
void addAngle (int atomi, int atomj, int atomk, int type)
void addDihedral (int atomi, int atomj, int atomk, int atoml, int type)
const char * getName () const
const GenericAtomgetAtom (int n) const
const GenericBondgetBond (int n) const
const GenericAnglegetAngle (int n) const
const GenericDihedralgetDihedral (int n) const


Detailed Description

Definition at line 113 of file GromacsTopFile.h.


Constructor & Destructor Documentation

GenericMol::GenericMol ( const char *  theName  ) 

Definition at line 916 of file GromacsTopFile.C.

00916                                           {
00917   name = strdup(theName);
00918 }


Member Function Documentation

void GenericMol::addAngle ( int  atomi,
int  atomj,
int  atomk,
int  type 
)

Definition at line 895 of file GromacsTopFile.C.

References ResizeArray< Elem >::add().

00895                                                                    {
00896   angleList.add(new GenericAngle(atomi, atomj, atomk, type));
00897 }

void GenericMol::addAtom ( const char *  theType,
int  theTypeNum,
int  theResNum,
const char *  theResType,
const char *  theAtomName,
Real  theCharge,
Real  theMass 
)

Definition at line 907 of file GromacsTopFile.C.

References ResizeArray< Elem >::add().

00909                                                        {
00910 
00911   atomList.add(new GenericAtom(theType,theTypeNum,theResNum,theResType,
00912                            theAtomName,theCharge,theMass));
00913 }

void GenericMol::addBond ( int  atomi,
int  atomj,
int  type 
)

Definition at line 890 of file GromacsTopFile.C.

References ResizeArray< Elem >::add().

00890                                                        {
00891   bondList.add(new GenericBond(atomi, atomj, type));
00892 }

void GenericMol::addDihedral ( int  atomi,
int  atomj,
int  atomk,
int  atoml,
int  type 
)

Definition at line 900 of file GromacsTopFile.C.

References ResizeArray< Elem >::add().

00901                                                   {
00902   dihedralList.add(new GenericDihedral(atomi, atomj, atomk,
00903                                              atoml, type));
00904 }

const GenericAngle * GenericMol::getAngle ( int  n  )  const

Definition at line 931 of file GromacsTopFile.C.

References ResizeArray< Elem >::size().

00931                                                     {
00932   /* double-check */
00933   if(n >= angleList.size() || n<0) {
00934     fprintf(stderr,"Angle index %d out of bounds.\n",n);
00935     exit(1);
00936   }
00937   return angleList[n];
00938 }

const GenericAtom * GenericMol::getAtom ( int  n  )  const

Definition at line 951 of file GromacsTopFile.C.

References ResizeArray< Elem >::size().

00951                                                   {
00952   /* double-check */
00953   if(n >= atomList.size() || n<0) {
00954     fprintf(stderr,"Atom index %d out of bounds for %s.\n",n,name);
00955     exit(1);
00956   }
00957   return atomList[n];
00958 }

const GenericBond * GenericMol::getBond ( int  n  )  const

Definition at line 921 of file GromacsTopFile.C.

References ResizeArray< Elem >::size().

00921                                                   {
00922   /* double-check */
00923   if(n >= bondList.size() || n<0) {
00924     fprintf(stderr,"Bond index %d out of bounds.\n",n);
00925     exit(1);
00926   }
00927   return bondList[n];
00928 }

const GenericDihedral * GenericMol::getDihedral ( int  n  )  const

Definition at line 941 of file GromacsTopFile.C.

References ResizeArray< Elem >::size().

00941                                                           {
00942   /* double-check */
00943   if(n >= dihedralList.size() || n<0) {
00944     fprintf(stderr,"Dihedral index %d out of bounds.\n",n);
00945     exit(1);
00946   }
00947   return dihedralList[n];
00948 }

const char* GenericMol::getName (  )  const [inline]

Definition at line 156 of file GromacsTopFile.h.

00156 { return name; }

int GenericMol::getNumAngles (  )  const [inline]

Definition at line 140 of file GromacsTopFile.h.

References ResizeArray< Elem >::size().

Referenced by MolInst::getNumAngles().

00140 { return angleList.size(); }

int GenericMol::getNumAtoms (  )  const [inline]

Definition at line 138 of file GromacsTopFile.h.

References ResizeArray< Elem >::size().

Referenced by MolInst::getNumAtoms().

00138 { return atomList.size(); }

int GenericMol::getNumBonds (  )  const [inline]

Definition at line 139 of file GromacsTopFile.h.

References ResizeArray< Elem >::size().

Referenced by MolInst::getNumBonds().

00139 { return bondList.size(); }

int GenericMol::getNumDihedrals (  )  const [inline]

Definition at line 141 of file GromacsTopFile.h.

References ResizeArray< Elem >::size().

Referenced by MolInst::getNumDihedrals().

00141 { return dihedralList.size(); }

int GenericMol::getNumRes (  )  const [inline]

Definition at line 142 of file GromacsTopFile.h.

References ResizeArray< Elem >::size().

Referenced by MolInst::getNumRes().

00142 { return atomList[atomList.size()-1]->getResNum(); }


The documentation for this class was generated from the following files:
Generated on Mon Sep 25 01:17:18 2017 for NAMD by  doxygen 1.4.7