Simpatico
v1.10
|
Selection rule for pairs of Atoms.
A PairSelector object defines a selection rule for pairs of atoms in other analyzers that calculate, e.g., RDFs or nonbonded pair energies. The rule can require that the pair be intramolecular, intermolecular, or either, and can require that the typeId for each atom either match a particular value, or that it be left unconstrained.
A PairSelector has a pair type and two atom type indices.
The pair type is a PairType enum, which can be INTRA, INTER, or ALL.
The atom types ids are integers. A non-negative integer indicates an atom type id. A negative integer indicates that all types are accepted.
The bool match() method returns true if a pair satisfies the rule, or false otherwise.
Definition at line 32 of file PairSelector.h.
#include <PairSelector.h>
Public Types |
Public Member Functions | |
PairSelector () | |
Constructor. More... | |
void | setAvoidDoubleCounting (bool avoidDoubleCounting) |
Set policy to avoid double counting (true) or to not avoid (false). More... | |
bool | match (const Atom &atom1, const Atom &atom2) const |
Return true if pair of atoms matches the selector policy. More... | |
PairType | pairType () const |
Return value of pair type. More... | |
int | atom1TypeId () const |
Return value of type Id for atom 1 (-1 means accept all types). More... | |
int | atom2TypeId () const |
Return value of type Id for atom 2 (-1 means accept all types). More... | |
Static Public Member Functions | |
static void | commitMpiType () |
Commit associated MPI DataType. More... | |
Friends | |
std::istream & | operator>> (std::istream &in, PairSelector &selector) |
istream extractor (>>) for a PairSelector object. More... | |
std::ostream & | operator<< (std::ostream &out, const PairSelector &selector) |
ostream inserter (<<) for a PairSelector object. More... | |
template<class Archive > | |
void | serialize (Archive &ar, PairSelector &selector, const unsigned int version) |
Serialize a PairSelector. More... | |
Type of atom pair, based on identity of parent molecules.
Values:
Definition at line 45 of file PairSelector.h.
McMd::PairSelector::PairSelector | ( | ) |
Constructor.
Definition at line 20 of file PairSelector.cpp.
void McMd::PairSelector::setAvoidDoubleCounting | ( | bool | avoidDoubleCounting | ) |
Set policy to avoid double counting (true) or to not avoid (false).
avoidDoubleCounting | Policy: true to avoid, false otherwise. |
Definition at line 30 of file PairSelector.cpp.
Referenced by McMd::McPairEnergyAverage::McPairEnergyAverage().
Return true if pair of atoms matches the selector policy.
Return true to accept this atom pair, false to reject.
atom1 | first atom in pair. |
atom2 | second atom in pair. |
Definition at line 36 of file PairSelector.cpp.
References McMd::Atom::id(), McMd::Atom::molecule(), and McMd::Atom::typeId().
Referenced by McMd::McPairEnergyAverage::sample(), McMd::MdPairEnergyCoefficients::sample(), and McMd::RDF::sample().
|
inline |
Return value of pair type.
Definition at line 117 of file PairSelector.h.
Referenced by McMd::RDF::output().
|
inline |
Return value of type Id for atom 1 (-1 means accept all types).
Definition at line 123 of file PairSelector.h.
|
inline |
Return value of type Id for atom 2 (-1 means accept all types).
Definition at line 129 of file PairSelector.h.
References operator<<, and operator>>.
|
static |
Commit associated MPI DataType.
Definition at line 168 of file PairSelector.cpp.
References Util::MpiStructBuilder::addMember(), Util::MpiStructBuilder::commit(), and Util::MpiStructBuilder::setBase().
|
friend |
istream extractor (>>) for a PairSelector object.
Format: pairType atom1TypeId atom2TypeId
in | input stream |
selector | PairSelector to be read from stream |
Definition at line 82 of file PairSelector.cpp.
Referenced by atom2TypeId(), and McMd::serialize().
|
friend |
ostream inserter (<<) for a PairSelector object.
Format: pairType atom1TypeId atom2TypeId
out | output stream |
selector | PairSelector to be written to stream |
Definition at line 93 of file PairSelector.cpp.
Referenced by atom2TypeId(), and McMd::serialize().
|
friend |
Serialize a PairSelector.
Default implementation calls serialize method of data object. Can be overridden by any explicit specialization.
ar | archive object |
selector | object to be serialized |
version | archive version id |
Definition at line 167 of file PairSelector.h.