PairTable Class Reference

#include <GromacsTopFile.h>

List of all members.

Public Member Functions

int addPairLJType2 (int typea, int typeb, Real c6, Real c12)
int addPairGaussType2 (int typea, int typeb, Real gA, Real gMu1, Real gSigma1)
int addPairGaussType2 (int typea, int typeb, Real gA, Real gMu1, Real gSigma1, Real gRepulsive)
int addPairGaussType2 (int typea, int typeb, Real gA, Real gMu1, Real gSigma1, Real gMu2, Real gSigma2, Real gRepulsive)
void getPairLJArrays2 (int *indexA, int *indexB, Real *pairC6, Real *pairC12)
void getPairGaussArrays2 (int *indexA, int *indexB, Real *gaussA, Real *gaussMu1, Real *gaussSigma1, Real *gaussMu2, Real *gaussSigma2, Real *gaussRepulsive)

Static Public Member Functions

static bool GroLJCompare (GroLJPair, GroLJPair)
static bool GroGaussCompare (GroGaussPair, GroGaussPair)


Detailed Description

Definition at line 436 of file GromacsTopFile.h.


Member Function Documentation

int PairTable::addPairGaussType2 ( int  typea,
int  typeb,
Real  gA,
Real  gMu1,
Real  gSigma1,
Real  gMu2,
Real  gSigma2,
Real  gRepulsive 
)

Definition at line 1500 of file GromacsTopFile.C.

References ResizeArray< Elem >::add(), GroGaussPair::gA, GroGaussPair::giSigma1, GroGaussPair::giSigma2, GroGaussPair::gMu1, GroGaussPair::gMu2, GroGaussPair::gRepulsive, GroGaussPair::indxGaussA, GroGaussPair::indxGaussB, and numGaussPair.

01502                                                   {
01503   GroGaussPair ggp;
01504   ggp.indxGaussA = indexA;
01505   ggp.indxGaussB = indexB;
01506   ggp.gA = gaussA;
01507   ggp.gMu1 = gaussMu1;
01508   ggp.giSigma1 = gaussSigma1;
01509   ggp.gMu2 = 0.0;
01510   ggp.giSigma2 = 0.0;
01511   ggp.gRepulsive = 0.0;
01512   pairlistGauss.add(ggp);
01513   numGaussPair++;
01514   GroGaussPair ggp2;
01515   ggp2.indxGaussA = indexB;
01516   ggp2.indxGaussB = indexA;
01517   ggp2.gA = gaussA;
01518   ggp2.gMu1 = gaussMu1;
01519   ggp2.giSigma1 = gaussSigma1;
01520   ggp2.gMu2 = 0.0;
01521   ggp2.giSigma2 = 0.0;
01522   ggp2.gRepulsive = 0.0;
01523   numGaussPair++;
01524   pairlistGauss.add(ggp2);
01525   return 0;
01526 }

int PairTable::addPairGaussType2 ( int  typea,
int  typeb,
Real  gA,
Real  gMu1,
Real  gSigma1,
Real  gRepulsive 
)

Definition at line 1495 of file GromacsTopFile.C.

References addPairGaussType2().

01496                                                                     {
01497   return addPairGaussType2(indexA, indexB, gaussA, gaussMu1, gaussSigma1, 0.0, 0.0, gaussRepulsive);
01498 }

int PairTable::addPairGaussType2 ( int  typea,
int  typeb,
Real  gA,
Real  gMu1,
Real  gSigma1 
)

Definition at line 1490 of file GromacsTopFile.C.

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

01491                                                   {
01492   return addPairGaussType2(indexA, indexB, gaussA, gaussMu1, gaussSigma1, 0.0, 0.0, 0.0);
01493 }

int PairTable::addPairLJType2 ( int  typea,
int  typeb,
Real  c6,
Real  c12 
)

Definition at line 1469 of file GromacsTopFile.C.

References ResizeArray< Elem >::add(), GroLJPair::c12pair, GroLJPair::c6pair, GroLJPair::indxLJA, GroLJPair::indxLJB, and numLJPair.

Referenced by GromacsTopFile::GromacsTopFile().

01469                                                                                {
01470   GroLJPair glp;
01471   glp.indxLJA = indexA;
01472   glp.indxLJB = indexB;
01473   glp.c6pair = pairC6;
01474   glp.c12pair = pairC12;
01475   pairlistLJ.add(glp);
01476   numLJPair++;
01477   return 0;
01478 
01479   // Insert the second copy
01480   GroLJPair glp2;
01481   glp2.indxLJA = indexB;
01482   glp2.indxLJB = indexA;
01483   glp2.c6pair = pairC6;
01484   glp2.c12pair = pairC12;
01485   pairlistLJ.add(glp2);
01486   numLJPair++;
01487   return 0;
01488 }

void PairTable::getPairGaussArrays2 ( int *  indexA,
int *  indexB,
Real gaussA,
Real gaussMu1,
Real gaussSigma1,
Real gaussMu2,
Real gaussSigma2,
Real gaussRepulsive 
)

Definition at line 1540 of file GromacsTopFile.C.

References ResizeArray< Elem >::begin(), ResizeArray< Elem >::end(), GroGaussCompare(), and numGaussPair.

Referenced by GromacsTopFile::getPairGaussArrays2().

01542                                                          {
01543   std::sort(pairlistGauss.begin(),pairlistGauss.end(),GroGaussCompare);
01544   for(int i = 0; i < numGaussPair; i++) {
01545     indexA[i] = pairlistGauss[i].indxGaussA;
01546     indexB[i] = pairlistGauss[i].indxGaussB;
01547     gaussA[i] = pairlistGauss[i].gA;
01548     gaussMu1[i] = pairlistGauss[i].gMu1;
01549     gaussSigma1[i] = pairlistGauss[i].giSigma1;
01550     gaussMu2[i] = pairlistGauss[i].gMu2;
01551     gaussSigma2[i] = pairlistGauss[i].giSigma2;
01552     gaussRepulsive[i] = pairlistGauss[i].gRepulsive;
01553   }
01554 }

void PairTable::getPairLJArrays2 ( int *  indexA,
int *  indexB,
Real pairC6,
Real pairC12 
)

Definition at line 1528 of file GromacsTopFile.C.

References ResizeArray< Elem >::begin(), ResizeArray< Elem >::end(), GroLJCompare(), and numLJPair.

Referenced by GromacsTopFile::getPairLJArrays2().

01528                                                                                       {
01529 
01530   std::sort(pairlistLJ.begin(),pairlistLJ.end(),GroLJCompare);
01531   ResizeArray<GroLJPair>::iterator it;
01532   for(int i = 0; i < numLJPair; i++) {  
01533     indexA[i] = pairlistLJ[i].indxLJA;
01534     indexB[i] = pairlistLJ[i].indxLJB;
01535     pairC6[i] = pairlistLJ[i].c6pair;
01536     pairC12[i] = pairlistLJ[i].c12pair;
01537     }
01538 }

bool PairTable::GroGaussCompare ( GroGaussPair  ,
GroGaussPair   
) [static]

Definition at line 1565 of file GromacsTopFile.C.

References A, and B.

Referenced by getPairGaussArrays2().

01565                                                                {
01566   if(A.indxGaussA < B.indxGaussA) {
01567     return true;
01568   } else if(A.indxGaussA == B.indxGaussA) {
01569     return (A.indxGaussB < B.indxGaussB);
01570   } 
01571   return false;
01572 }

bool PairTable::GroLJCompare ( GroLJPair  ,
GroLJPair   
) [static]

Definition at line 1556 of file GromacsTopFile.C.

References A, and B.

Referenced by getPairLJArrays2().

01556                                                       {
01557   if(A.indxLJA < B.indxLJA) {
01558     return true;
01559   } else if(A.indxLJA == B.indxLJA) {
01560     return (A.indxLJB < B.indxLJB);
01561   } 
01562   return false;
01563 }


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