AtomTable Class Reference

#include <GromacsTopFile.h>

List of all members.

Public Member Functions

void addType (const char *type, Real m, Real q, Real c6, Real c12)
int getParams (const char *type, Real *m, Real *q, Real *c6, Real *c12) const
void getType (int num, char *type) const
int size () const


Detailed Description

Definition at line 201 of file GromacsTopFile.h.


Member Function Documentation

void AtomTable::addType ( const char *  type,
Real  m,
Real  q,
Real  c6,
Real  c12 
)

Definition at line 1301 of file GromacsTopFile.C.

References ResizeArray< Elem >::add().

Referenced by GromacsTopFile::GromacsTopFile().

01302                                                  {
01303   typeArray.add(strdup(type));
01304   mArray.add(m);
01305   qArray.add(q);
01306   c6Array.add(c6);
01307   c12Array.add(c12);
01308 }

int AtomTable::getParams ( const char *  type,
Real m,
Real q,
Real c6,
Real c12 
) const

Definition at line 1323 of file GromacsTopFile.C.

Referenced by GromacsTopFile::getVDWParams(), and GromacsTopFile::GromacsTopFile().

01324                                                {
01325   int i;
01326   for(i=0;i<mArray.size();i++) {
01327     if(typeArray[i]==NULL) {
01328       fprintf(stderr,"Found NULL atom type in list.\n");
01329       exit(1);
01330     }
01331     if(0==strcmp(typeArray[i],type)) {
01332       *m = mArray[i];
01333       *q = qArray[i];
01334       *c6 = c6Array[i];
01335       *c12 = c12Array[i];
01336       return i;
01337     }
01338   }
01339   return -1;
01340 }

void AtomTable::getType ( int  num,
char *  type 
) const

Definition at line 1312 of file GromacsTopFile.C.

References NAMESIZE.

Referenced by GromacsTopFile::getAtomParams().

01312                                                  {
01313   if(num>=mArray.size() || num<0) {
01314     fprintf(stderr,"atomParam index %d out of bounds!\n",num);
01315     exit(1);
01316   }
01317   strncpy(type,typeArray[num],NAMESIZE+1);
01318 }

int AtomTable::size (  )  const [inline]

Definition at line 225 of file GromacsTopFile.h.

Referenced by GromacsTopFile::getNumAtomParams().

00225 { return mArray.size(); }


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