Simpatico  v1.10
List of all members | Public Member Functions | Static Public Member Functions | Friends
DdMd::Group< N > Class Template Reference

Detailed Description

template<int N>
class DdMd::Group< N >

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...
 
Planplan ()
 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...
 
AtomatomPtr (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 Planplan () 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...
 

Constructor & Destructor Documentation

template<int N>
DdMd::Group< N >::Group ( )

Constructor.

Definition at line 245 of file ddMd/chemistry/Group.h.

References DdMd::Plan::clearFlags().

Member Function Documentation

template<int N>
int DdMd::Group< N >::packedSize ( )
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.

template<int N>
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().

template<int N>
void DdMd::Group< N >::setId ( int  id)
inline

Set the global id for this group.

Parameters
idvalue 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().

template<int N>
void DdMd::Group< N >::setTypeId ( int  typeId)
inline

Set the group type id for this group.

Parameters
typeIdvalue 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().

template<int N>
void DdMd::Group< N >::setAtomId ( int  i,
int  atomId 
)
inline

Set the id for a specific atom.

Parameters
iindex within group (0,..., N-1)
atomIdglobal 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().

template<int N>
void DdMd::Group< N >::setAtomPtr ( int  i,
Atom atomPtr 
)

Set the pointer to a specific atom.

Parameters
iindex of atom within group
atomPtrpointer 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().

template<int N>
void DdMd::Group< N >::clearAtomPtr ( int  i)
inline

Clear the pointer to a specific atom.

Parameters
iindex 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().

template<int N>
Plan & DdMd::Group< N >::plan ( )
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().

template<int N>
int DdMd::Group< N >::id ( ) const
inline
template<int N>
int DdMd::Group< N >::typeId ( ) const
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().

template<int N>
int DdMd::Group< N >::atomId ( int  i) const
inline

Get the id for a specific atom in the Group.

Parameters
iindex 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().

template<int N>
Atom * DdMd::Group< N >::atomPtr ( int  i) const
inline

Get a pointer to a specific Atom.

Parameters
iindex 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().

template<int N>
int DdMd::Group< N >::nPtr ( ) const
inline

Return the number of non-null atom pointers in this group.

Definition at line 362 of file ddMd/chemistry/Group.h.

template<int N>
const Plan & DdMd::Group< N >::plan ( ) const
inline

Get communication plan (const reference).

Definition at line 369 of file ddMd/chemistry/Group.h.

template<int N>
void DdMd::Group< N >::pack ( Buffer buffer)

Pack a Group into a send buffer.

Parameters
bufferBuffer 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().

template<int N>
void DdMd::Group< N >::unpack ( Buffer buffer)

Unpack a Group from the recv buffer.

Upon return:

  • all atom ids are set
  • group type id and global id are set
  • all atom pointers are null.
Parameters
bufferBuffer 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().

Friends And Related Function Documentation

template<int N>
std::istream& operator>> ( std::istream &  in,
Group< N > &  group 
)
friend

istream extractor (>>) for a Group.

Parameters
ininput stream
groupGroup to be read from stream
Returns
modified input stream

Definition at line 378 of file ddMd/chemistry/Group.h.

template<int N>
std::ostream& operator<< ( std::ostream &  out,
const Group< N > &  group 
)
friend

ostream inserter (<<) for a Group.

Format on one line with no line break:

Parameters
outoutput stream
groupGroup to be written to stream
Returns
modified output stream

Definition at line 392 of file ddMd/chemistry/Group.h.

template<int N>
template<class Archive >
void serialize ( Archive &  ar,
Group< N > &  group,
const unsigned int  version 
)
friend

Serialize one Group<N>.

Default implementation calls serialize method of data object. Can be overridden by any explicit specialization.

Parameters
ararchive object
groupobject to be serialized
versionarchive version id

Referenced by DdMd::operator<<().


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