OpenMD  2.5
Molecular Dynamics in the Open
OpenMD::PairList Class Reference

PairList class maintains a general purpose list of atom pairs using the global indices of the atoms. This structure is the general form for exclude lists as well as 1-4, 1-3, and 1-2 lists. More...

#include "brains/PairList.hpp"

Public Member Functions

 PairList ()
 
void addPair (int i, int j)
 
void addPairs (std::set< int > &set1, std::set< int > &set2)
 
template<typename IterType1 , typename IterType2 >
void addPairs (IterType1 iter1_first, IterType1 iter1_last, IterType2 iter2_first, IterType2 iter2_last)
 
void removePair (int i, int j)
 
void removePairs (std::set< int > &set1, std::set< int > &set2)
 
template<typename IterType1 , typename IterType2 >
void removePairs (IterType1 iter1_first, IterType1 iter1_last, IterType2 iter2_first, IterType2 iter2_last)
 
bool hasPair (int i, int j)
 
int getSize ()
 
int getSizeOfPairList ()
 
int * getPairList ()
 

Private Attributes

std::set< std::pair< int, int > > pairSet_
 
std::vector< int > pairList_
 
bool modified_
 

Friends

std::ostream & operator<< (std::ostream &o, PairList &e)
 

Detailed Description

PairList class maintains a general purpose list of atom pairs using the global indices of the atoms. This structure is the general form for exclude lists as well as 1-4, 1-3, and 1-2 lists.

Definition at line 61 of file PairList.hpp.

Constructor & Destructor Documentation

◆ PairList()

OpenMD::PairList::PairList ( )
inline

Member Function Documentation

◆ addPair()

void OpenMD::PairList::addPair ( int  i,
int  j 
)

Adds a pair into this PairList class

Definition at line 67 of file PairList.cpp.

References modified_, and pairSet_.

Referenced by OpenMD::SimInfo::addInteractionPairs(), addPairs(), and PairList().

◆ addPairs() [1/2]

void OpenMD::PairList::addPairs ( std::set< int > &  set1,
std::set< int > &  set2 
)

Definition at line 83 of file PairList.cpp.

References addPair().

Referenced by PairList().

◆ addPairs() [2/2]

template<typename IterType1 , typename IterType2 >
void OpenMD::PairList::addPairs ( IterType1  iter1_first,
IterType1  iter1_last,
IterType2  iter2_first,
IterType2  iter2_last 
)

Definition at line 94 of file PairList.cpp.

References addPair().

◆ getPairList()

int * OpenMD::PairList::getPairList ( )

Returns the pairs in a plain array

Definition at line 51 of file PairList.cpp.

References modified_, pairList_, and pairSet_.

Referenced by PairList().

◆ getSize()

int OpenMD::PairList::getSize ( )

Returns the number of pairs in the list

Definition at line 149 of file PairList.cpp.

References pairSet_.

Referenced by PairList().

◆ getSizeOfPairList()

int OpenMD::PairList::getSizeOfPairList ( )

Returns the size of PairList

Referenced by PairList().

◆ hasPair()

bool OpenMD::PairList::hasPair ( int  i,
int  j 
)

Checks whether pair (i, j) is in this PairList class

Definition at line 137 of file PairList.cpp.

References pairSet_.

Referenced by OpenMD::ForceMatrixDecomposition::distributeInitialData(), OpenMD::NitrileFrequencyMap::NitrileFrequencyMap(), and PairList().

◆ removePair()

void OpenMD::PairList::removePair ( int  i,
int  j 
)

Remove a pair from PairList class

Definition at line 102 of file PairList.cpp.

References modified_, and pairSet_.

Referenced by PairList(), OpenMD::SimInfo::removeInteractionPairs(), and removePairs().

◆ removePairs() [1/2]

void OpenMD::PairList::removePairs ( std::set< int > &  set1,
std::set< int > &  set2 
)

Definition at line 118 of file PairList.cpp.

References removePair().

Referenced by PairList().

◆ removePairs() [2/2]

template<typename IterType1 , typename IterType2 >
void OpenMD::PairList::removePairs ( IterType1  iter1_first,
IterType1  iter1_last,
IterType2  iter2_first,
IterType2  iter2_last 
)

Definition at line 129 of file PairList.cpp.

References removePair().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  o,
PairList e 
)
friend

write out the exclusion list to an ostream

Definition at line 153 of file PairList.cpp.

Referenced by PairList().

Member Data Documentation

◆ modified_

bool OpenMD::PairList::modified_
private

Definition at line 100 of file PairList.hpp.

Referenced by addPair(), getPairList(), and removePair().

◆ pairList_

std::vector<int> OpenMD::PairList::pairList_
private

Definition at line 99 of file PairList.hpp.

Referenced by getPairList().

◆ pairSet_

std::set< std::pair<int, int> > OpenMD::PairList::pairSet_
private

Definition at line 98 of file PairList.hpp.

Referenced by addPair(), getPairList(), getSize(), hasPair(), OpenMD::operator<<(), and removePair().


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