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

#include <GromacsTopFile.h>

Public Member Functions

void addType (const char *typea, const char *typeb, Real c6, Real c12)
 
void add14Type (const char *typea, const char *typeb, Real c6pair, Real c12pair)
 
int getParams (const char *typea, const char *typeb, Real *c6, Real *c12, Real *c6pair, Real *c12pair) const
 

Detailed Description

Definition at line 386 of file GromacsTopFile.h.

Member Function Documentation

void VDWTable::add14Type ( const char *  typea,
const char *  typeb,
Real  c6pair,
Real  c12pair 
)

Definition at line 1377 of file GromacsTopFile.C.

References ResizeArray< T >::add().

1378  {
1379  int i;
1380 
1381  /* check to see if the pair is already in the table */
1382  i = getIndex(typea,typeb);
1383  if(i != -1) { /* it was in the table */
1384  c6PairArray[i] = c6pair;
1385  c12PairArray[i] = c12pair;
1386  }
1387  else { /* it wasn't in the table - add it! */
1388  typeAArray.add(strdup(typea));
1389  typeBArray.add(strdup(typeb));
1390  c6PairArray.add(c6pair);
1391  c12PairArray.add(c12pair);
1392  c6Array.add(0);
1393  c12Array.add(0);
1394  }
1395 }
int add(const Elem &elem)
Definition: ResizeArray.h:97
void VDWTable::addType ( const char *  typea,
const char *  typeb,
Real  c6,
Real  c12 
)

Definition at line 1357 of file GromacsTopFile.C.

References ResizeArray< T >::add().

Referenced by GromacsTopFile::GromacsTopFile().

1358  {
1359  int i;
1360 
1361  /* check to see if the pair is already in the table */
1362  i = getIndex(typea,typeb);
1363  if(i != -1) { /* it was in the table */
1364  c6Array[i] = c6;
1365  c12Array[i] = c12;
1366  }
1367  else { /* it wasn't in the table - add it! */
1368  typeAArray.add(strdup(typea));
1369  typeBArray.add(strdup(typeb));
1370  c6Array.add(c6);
1371  c12Array.add(c12);
1372  c6PairArray.add(0);
1373  c12PairArray.add(0);
1374  }
1375 }
int add(const Elem &elem)
Definition: ResizeArray.h:97
int VDWTable::getParams ( const char *  typea,
const char *  typeb,
Real c6,
Real c12,
Real c6pair,
Real c12pair 
) const

Definition at line 1400 of file GromacsTopFile.C.

Referenced by GromacsTopFile::getVDWParams().

1401  {
1402  int i;
1403  /* check to see if the pair is already in the table */
1404  i = getIndex(typea,typeb);
1405  if(i != -1) { /* it was in the table - return the parameters */
1406  *c6 = c6Array[i];
1407  *c12 = c12Array[i];
1408  *c6pair = c6PairArray[i];
1409  *c12pair = c12PairArray[i];
1410  }
1411  return i;
1412 }

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