Simpatico
v1.10
|
A group of covalently interacting atoms.
A group of atoms that interact via a permanent (covalent) N Atom potential. Specializations of Group with N=2, 3, 4 are used to represent groups that interact via covalent bond, angle and torsion interaction potentials, respectively.
A Group<N> contains both: (1) an array of integer ids for atoms in the group, and (2) an array of pointers to these atoms. Each Group<N> also has an integer type id and a unique global id for the group.
Definition at line 22 of file ddMd/chemistry/Group.h.
#include <Group.h>
Public Member Functions | |
Group () | |
Constructor. More... | |
void | clear () |
Set group to empty initial state. More... | |
void | setId (int id) |
Set the global id for this group. More... | |
void | setTypeId (int typeId) |
Set the group type id for this group. More... | |
void | setAtomId (int i, int atomId) |
Set the id for a specific atom. More... | |
void | setAtomPtr (int i, Atom *atomPtr) |
Set the pointer to a specific atom. More... | |
void | clearAtomPtr (int i) |
Clear the pointer to a specific atom. More... | |
Plan & | plan () |
Get communication plan by reference. More... | |
int | id () const |
Get the global id for this group. More... | |
int | typeId () const |
Get the typeId for this group. More... | |
int | atomId (int i) const |
Get the id for a specific atom in the Group. More... | |
Atom * | atomPtr (int i) const |
Get a pointer to a specific Atom. More... | |
int | nPtr () const |
Return the number of non-null atom pointers in this group. More... | |
const Plan & | plan () const |
Get communication plan (const reference). More... | |
void | pack (Buffer &buffer) |
Pack a Group into a send buffer. More... | |
void | unpack (Buffer &buffer) |
Unpack a Group from the recv buffer. More... | |
Static Public Member Functions | |
static int | packedSize () |
Return packed size of a Group<N> object in a send buffer, in bytes. More... | |
Friends | |
std::istream & | operator>> (std::istream &in, Group< N > &group) |
istream extractor (>>) for a Group. More... | |
std::ostream & | operator<< (std::ostream &out, const Group< N > &group) |
ostream inserter (<<) for a Group. More... | |
template<class Archive > | |
void | serialize (Archive &ar, Group< N > &group, const unsigned int version) |
Serialize one Group<N>. More... | |
DdMd::Group< N >::Group | ( | ) |
Constructor.
Definition at line 245 of file ddMd/chemistry/Group.h.
References DdMd::Plan::clearFlags().
|
static |
Return packed size of a Group<N> object in a send buffer, in bytes.
Definition at line 441 of file ddMd/chemistry/Group.h.
void DdMd::Group< N >::clear | ( | ) |
Set group to empty initial state.
Definition at line 261 of file ddMd/chemistry/Group.h.
References DdMd::Plan::clearFlags().
|
inline |
Set the global id for this group.
id | value of global id (tag) for this group. |
Definition at line 277 of file ddMd/chemistry/Group.h.
References DdMd::Group< N >::id().
Referenced by DdMd::GroupStorage< N >::add(), DdMd::GroupStorage< N >::clearGroups(), DdMd::LammpsConfigIo::LammpsConfigIo(), DdMd::GroupStorage< N >::remove(), and DdMd::Group< N >::unpack().
|
inline |
Set the group type id for this group.
typeId | value of covalent group typeId |
Definition at line 284 of file ddMd/chemistry/Group.h.
References DdMd::Group< N >::typeId().
Referenced by DdMd::LammpsConfigIo::LammpsConfigIo(), and DdMd::Group< N >::unpack().
|
inline |
Set the id for a specific atom.
i | index within group (0,..., N-1) |
atomId | global atom identifier (atom tag) |
Definition at line 291 of file ddMd/chemistry/Group.h.
References DdMd::Group< N >::atomId().
Referenced by DdMd::LammpsConfigIo::LammpsConfigIo(), and DdMd::Group< N >::unpack().
void DdMd::Group< N >::setAtomPtr | ( | int | i, |
Atom * | atomPtr | ||
) |
Set the pointer to a specific atom.
i | index of atom within group |
atomPtr | pointer to Atom to be added |
Definition at line 298 of file ddMd/chemistry/Group.h.
References DdMd::Group< N >::atomPtr(), and UTIL_THROW.
Referenced by DdMd::AtomMap::findGroupGhostAtoms(), and DdMd::AtomMap::findGroupLocalAtoms().
|
inline |
Clear the pointer to a specific atom.
i | index of atom within group. |
Definition at line 313 of file ddMd/chemistry/Group.h.
Referenced by DdMd::AtomMap::findGroupGhostAtoms(), DdMd::AtomMap::findGroupLocalAtoms(), and DdMd::Group< N >::unpack().
|
inline |
Get communication plan by reference.
Definition at line 325 of file ddMd/chemistry/Group.h.
Referenced by DdMd::Group< N >::pack(), and DdMd::Group< N >::unpack().
|
inline |
Get the global id for this group.
Definition at line 334 of file ddMd/chemistry/Group.h.
Referenced by DdMd::GroupStorage< N >::clearGroups(), DdMd::GroupStorage< N >::isValid(), DdMd::Group< N >::pack(), DdMd::LammpsConfigIo::readConfig(), DdMd::DdMdOrderedConfigIo::readConfig(), DdMd::GroupStorage< N >::remove(), DdMd::Group< N >::setId(), and DdMd::GroupStorage< N >::unpack().
|
inline |
Get the typeId for this group.
Definition at line 341 of file ddMd/chemistry/Group.h.
Referenced by DdMd::Group< N >::pack(), and DdMd::Group< N >::setTypeId().
|
inline |
Get the id for a specific atom in the Group.
i | index of atom within group (0,..., N-1) |
Definition at line 348 of file ddMd/chemistry/Group.h.
Referenced by DdMd::ConfigIo::associate(), DdMd::AtomMap::findGroupGhostAtoms(), DdMd::AtomMap::findGroupLocalAtoms(), DdMd::Group< N >::pack(), and DdMd::Group< N >::setAtomId().
|
inline |
Get a pointer to a specific Atom.
i | index of atom within group (0,...,N-1) |
Definition at line 355 of file ddMd/chemistry/Group.h.
Referenced by DdMd::AtomMap::findGroupGhostAtoms(), DdMd::GroupCollector< N >::nextPtr(), and DdMd::Group< N >::setAtomPtr().
|
inline |
Return the number of non-null atom pointers in this group.
Definition at line 362 of file ddMd/chemistry/Group.h.
|
inline |
Get communication plan (const reference).
Definition at line 369 of file ddMd/chemistry/Group.h.
void DdMd::Group< N >::pack | ( | Buffer & | buffer | ) |
Pack a Group into a send buffer.
buffer | Buffer object into which data should be packed. |
Definition at line 448 of file ddMd/chemistry/Group.h.
References DdMd::Group< N >::atomId(), DdMd::Plan::flags(), DdMd::Group< N >::id(), DdMd::Buffer::incrementSendSize(), DdMd::Buffer::pack(), DdMd::Group< N >::plan(), and DdMd::Group< N >::typeId().
void DdMd::Group< N >::unpack | ( | Buffer & | buffer | ) |
Unpack a Group from the recv buffer.
Upon return:
buffer | Buffer object from which data should be unpacked. |
Definition at line 463 of file ddMd/chemistry/Group.h.
References DdMd::Group< N >::clearAtomPtr(), DdMd::Buffer::decrementRecvSize(), DdMd::Group< N >::plan(), DdMd::Group< N >::setAtomId(), DdMd::Plan::setFlags(), DdMd::Group< N >::setId(), DdMd::Group< N >::setTypeId(), and DdMd::Buffer::unpack().
Referenced by DdMd::GroupDistributor< N >::receive(), and DdMd::GroupStorage< N >::unpack().
|
friend |
istream extractor (>>) for a Group.
in | input stream |
group | Group to be read from stream |
Definition at line 378 of file ddMd/chemistry/Group.h.
|
friend |
ostream inserter (<<) for a Group.
Format on one line with no line break:
out | output stream |
group | Group to be written to stream |
Definition at line 392 of file ddMd/chemistry/Group.h.
|
friend |
Serialize one Group<N>.
Default implementation calls serialize method of data object. Can be overridden by any explicit specialization.
ar | archive object |
group | object to be serialized |
version | archive version id |
Referenced by DdMd::operator<<().