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

#include <GromacsTopFile.h>

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< T >::add().

Referenced by GromacsTopFile::GromacsTopFile().

1302  {
1303  typeArray.add(strdup(type));
1304  mArray.add(m);
1305  qArray.add(q);
1306  c6Array.add(c6);
1307  c12Array.add(c12);
1308 }
int add(const Elem &elem)
Definition: ResizeArray.h:97
int AtomTable::getParams ( const char *  type,
Real m,
Real q,
Real c6,
Real c12 
) const

Definition at line 1323 of file GromacsTopFile.C.

References ResizeArray< T >::size().

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

1324  {
1325  int i;
1326  for(i=0;i<mArray.size();i++) {
1327  if(typeArray[i]==NULL) {
1328  fprintf(stderr,"Found NULL atom type in list.\n");
1329  exit(1);
1330  }
1331  if(0==strcmp(typeArray[i],type)) {
1332  *m = mArray[i];
1333  *q = qArray[i];
1334  *c6 = c6Array[i];
1335  *c12 = c12Array[i];
1336  return i;
1337  }
1338  }
1339  return -1;
1340 }
int size(void) const
Definition: ResizeArray.h:127
void AtomTable::getType ( int  num,
char *  type 
) const

Definition at line 1312 of file GromacsTopFile.C.

References NAMESIZE, and ResizeArray< T >::size().

Referenced by GromacsTopFile::getAtomParams().

1312  {
1313  if(num>=mArray.size() || num<0) {
1314  fprintf(stderr,"atomParam index %d out of bounds!\n",num);
1315  exit(1);
1316  }
1317  strncpy(type,typeArray[num],NAMESIZE+1);
1318 }
#define NAMESIZE
Definition: GromacsTopFile.h:6
int size(void) const
Definition: ResizeArray.h:127
int AtomTable::size ( ) const
inline

Definition at line 225 of file GromacsTopFile.h.

References ResizeArray< T >::size().

Referenced by GromacsTopFile::getNumAtomParams().

225 { return mArray.size(); }
int size(void) const
Definition: ResizeArray.h:127

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