NAMD
Public Member Functions | List of all members
GenericMol Class Reference

#include <GromacsTopFile.h>

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.

916  {
917  name = strdup(theName);
918 }

Member Function Documentation

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

Definition at line 895 of file GromacsTopFile.C.

References ResizeArray< T >::add().

895  {
896  angleList.add(new GenericAngle(atomi, atomj, atomk, type));
897 }
int add(const Elem &elem)
Definition: ResizeArray.h:97
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< T >::add().

909  {
910 
911  atomList.add(new GenericAtom(theType,theTypeNum,theResNum,theResType,
912  theAtomName,theCharge,theMass));
913 }
int add(const Elem &elem)
Definition: ResizeArray.h:97
void GenericMol::addBond ( int  atomi,
int  atomj,
int  type 
)

Definition at line 890 of file GromacsTopFile.C.

References ResizeArray< T >::add().

890  {
891  bondList.add(new GenericBond(atomi, atomj, type));
892 }
int add(const Elem &elem)
Definition: ResizeArray.h:97
void GenericMol::addDihedral ( int  atomi,
int  atomj,
int  atomk,
int  atoml,
int  type 
)

Definition at line 900 of file GromacsTopFile.C.

References ResizeArray< T >::add().

901  {
902  dihedralList.add(new GenericDihedral(atomi, atomj, atomk,
903  atoml, type));
904 }
int add(const Elem &elem)
Definition: ResizeArray.h:97
const GenericAngle * GenericMol::getAngle ( int  n) const

Definition at line 931 of file GromacsTopFile.C.

References ResizeArray< T >::size().

931  {
932  /* double-check */
933  if(n >= angleList.size() || n<0) {
934  fprintf(stderr,"Angle index %d out of bounds.\n",n);
935  exit(1);
936  }
937  return angleList[n];
938 }
int size(void) const
Definition: ResizeArray.h:127
const GenericAtom * GenericMol::getAtom ( int  n) const

Definition at line 951 of file GromacsTopFile.C.

References ResizeArray< T >::size().

951  {
952  /* double-check */
953  if(n >= atomList.size() || n<0) {
954  fprintf(stderr,"Atom index %d out of bounds for %s.\n",n,name);
955  exit(1);
956  }
957  return atomList[n];
958 }
int size(void) const
Definition: ResizeArray.h:127
const GenericBond * GenericMol::getBond ( int  n) const

Definition at line 921 of file GromacsTopFile.C.

References ResizeArray< T >::size().

921  {
922  /* double-check */
923  if(n >= bondList.size() || n<0) {
924  fprintf(stderr,"Bond index %d out of bounds.\n",n);
925  exit(1);
926  }
927  return bondList[n];
928 }
int size(void) const
Definition: ResizeArray.h:127
const GenericDihedral * GenericMol::getDihedral ( int  n) const

Definition at line 941 of file GromacsTopFile.C.

References ResizeArray< T >::size().

941  {
942  /* double-check */
943  if(n >= dihedralList.size() || n<0) {
944  fprintf(stderr,"Dihedral index %d out of bounds.\n",n);
945  exit(1);
946  }
947  return dihedralList[n];
948 }
int size(void) const
Definition: ResizeArray.h:127
const char* GenericMol::getName ( ) const
inline

Definition at line 156 of file GromacsTopFile.h.

156 { return name; }
int GenericMol::getNumAngles ( ) const
inline

Definition at line 140 of file GromacsTopFile.h.

References ResizeArray< T >::size().

Referenced by MolInst::getNumAngles().

140 { return angleList.size(); }
int size(void) const
Definition: ResizeArray.h:127
int GenericMol::getNumAtoms ( ) const
inline

Definition at line 138 of file GromacsTopFile.h.

References ResizeArray< T >::size().

Referenced by MolInst::getNumAtoms().

138 { return atomList.size(); }
int size(void) const
Definition: ResizeArray.h:127
int GenericMol::getNumBonds ( ) const
inline

Definition at line 139 of file GromacsTopFile.h.

References ResizeArray< T >::size().

Referenced by MolInst::getNumBonds().

139 { return bondList.size(); }
int size(void) const
Definition: ResizeArray.h:127
int GenericMol::getNumDihedrals ( ) const
inline

Definition at line 141 of file GromacsTopFile.h.

References ResizeArray< T >::size().

Referenced by MolInst::getNumDihedrals().

141 { return dihedralList.size(); }
int size(void) const
Definition: ResizeArray.h:127
int GenericMol::getNumRes ( ) const
inline

Definition at line 142 of file GromacsTopFile.h.

References ResizeArray< T >::size().

Referenced by MolInst::getNumRes().

142 { return atomList[atomList.size()-1]->getResNum(); }
int size(void) const
Definition: ResizeArray.h:127

The documentation for this class was generated from the following files: