Simpatico  v1.10
List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends
Simp::SpeciesGroup< NAtom > Class Template Reference

Detailed Description

template<int NAtom>
class Simp::SpeciesGroup< NAtom >

A Group of covalently interacting atoms within any molecule of one Species.

Class SpeciesGroup is used in the implementation of class Species to define the covalent chemical structure for any molecule of a particular species. The chemical structure of a Species is defined by a set of SpeciesGroup<2> (bond), SpeciesGroup<3> (angle), and SpeciesGroup<4> (dihedral) objects. Each SpeciesGroup<NAtom> object contains an array of NAtom local integer atom indices, which identities a group of atoms that are involved in a an NAtom-body covalent interaction. Each local atom index i must lie in the range 0 <= i < nAtom. A local atom index identifies the position of of an Atom within a generic molecule of the associated species. Each SpeciesGroup also has an integer group type index to distinguish different types of bonds, angles, and dihedrals, with different potential parameters.

The difference between a SpeciesGroup and a Group is that a Group contains an array of pointers to specific Atom objects that all belong to a specific Molecule. Each SpeciesGroup is thus a prototype for constructing one Group for each Molecule within a Species.

A SpeciesGroup<N> object can be input or output to file using overloaded inserter (<<) and extractor (>>) operators, like a built in type. The text representation contains a sequence of atom ids followed by the group type id, as described in a separate file.

See also
text representation

Definition at line 20 of file SpeciesGroup.h.

#include <SpeciesGroup.h>

Public Member Functions

 SpeciesGroup ()
 Constructor. More...
 
void setAtomId (int i, int atomId)
 Set index for one atom in the group. More...
 
void setTypeId (int typeId)
 Set the group type id for this group. More...
 
int atomId (int i) const
 Get the local id for a specific Atom. More...
 
int typeId () const
 Get the type id for this covalent group. More...
 

Static Public Member Functions

static void commitMpiType ()
 Commit associated MPI DataType. More...
 

Static Public Attributes

static const int NullIndex = -1
 Null (unknown) value for non-negative atom and group type indices. More...
 

Friends

std::istream & operator>> (std::istream &in, SpeciesGroup< NAtom > &speciesGroup)
 istream extractor for a SpeciesGroup. More...
 
std::ostream & operator<< (std::ostream &out, const SpeciesGroup< NAtom > &speciesGroup)
 ostream inserter for a SpeciesGroup. More...
 
template<class Archive >
void serialize (Archive &ar, SpeciesGroup< NAtom > &speciesGroup, const unsigned int version)
 Serialize one SpeciesGroup<NAtom>. More...
 
template<class Archive >
void serialize (Archive &ar, SpeciesGroup< NAtom > &speciesGroup, const unsigned int version)
 Serialize one SpeciesGroup<NAtom>. More...
 

Constructor & Destructor Documentation

template<int NAtom>
Simp::SpeciesGroup< NAtom >::SpeciesGroup ( )
inline

Constructor.

Definition at line 156 of file SpeciesGroup.h.

References Simp::SpeciesGroup< NAtom >::NullIndex.

Member Function Documentation

template<int NAtom>
void Simp::SpeciesGroup< NAtom >::setAtomId ( int  i,
int  atomId 
)
inline

Set index for one atom in the group.

Parameters
iindex of atom within group (0, .., NAtom - 1)
atomIdindex of atom to be added.

Definition at line 168 of file SpeciesGroup.h.

References Simp::SpeciesGroup< NAtom >::atomId().

template<int NAtom>
void Simp::SpeciesGroup< NAtom >::setTypeId ( int  typeId)
inline

Set the group type id for this group.

Parameters
typeIdvalue of covalent group typeId

Definition at line 175 of file SpeciesGroup.h.

References Simp::SpeciesGroup< NAtom >::typeId().

template<int NAtom>
int Simp::SpeciesGroup< NAtom >::atomId ( int  i) const
inline

Get the local id for a specific Atom.

Parameters
iindex within group (0, ..., NAtom - 1)

Definition at line 182 of file SpeciesGroup.h.

Referenced by Simp::Species::initializeAtomGroupIdArrays(), Simp::Species::isValid(), McMd::Simulation::isValid(), McMd::Simulation::save(), and Simp::SpeciesGroup< NAtom >::setAtomId().

template<int NAtom>
int Simp::SpeciesGroup< NAtom >::typeId ( ) const
inline
template<int NAtom>
void Simp::SpeciesGroup< NAtom >::commitMpiType ( )
static

Commit associated MPI DataType.

Commit MPI Datatype.

Definition at line 57 of file SpeciesGroup.tpp.

References Util::MpiStructBuilder::addMember(), Util::MpiStructBuilder::commit(), and Util::MpiStructBuilder::setBase().

Referenced by Simp::commitMpiSpeciesGroupTypes().

Friends And Related Function Documentation

template<int NAtom>
std::istream& operator>> ( std::istream &  in,
SpeciesGroup< NAtom > &  speciesGroup 
)
friend

istream extractor for a SpeciesGroup.

The format is as follows:

 atomIds[0] atomIds[1] ...  atomId[NAtom-1]  typeId
Parameters
ininput stream
speciesGroupSpeciesGroup to be read from stream
Returns
modified input stream

Definition at line 27 of file SpeciesGroup.tpp.

Referenced by Simp::SpeciesGroup< NAtom >::typeId().

template<int NAtom>
std::ostream& operator<< ( std::ostream &  out,
const SpeciesGroup< NAtom > &  speciesGroup 
)
friend

ostream inserter for a SpeciesGroup.

The format is as follows, output one one line with no line break:

 atomIds[0] atomIds[1] ...  atomId[NAtom-1] typeId
Parameters
outoutput stream
speciesGroupSpeciesGroup to be written to stream
Returns
modified output stream

Definition at line 41 of file SpeciesGroup.tpp.

template<int NAtom>
template<class Archive >
void serialize ( Archive &  ar,
SpeciesGroup< NAtom > &  speciesGroup,
const unsigned int  version 
)
friend

Serialize one SpeciesGroup<NAtom>.

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

Parameters
ararchive object
speciesGroupobject to be serialized
versionarchive version id

Referenced by Simp::SpeciesGroup< NAtom >::typeId().

template<int NAtom>
template<class Archive >
void serialize ( Archive &  ar,
SpeciesGroup< NAtom > &  speciesGroup,
const unsigned int  version 
)
friend

Serialize one SpeciesGroup<NAtom>.

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

Parameters
ararchive object
speciesGroupobject to be serialized
versionarchive version id

Member Data Documentation

template<int NAtom>
const int Simp::SpeciesGroup< NAtom >::NullIndex = -1
static

Null (unknown) value for non-negative atom and group type indices.

Definition at line 83 of file SpeciesGroup.h.

Referenced by Simp::SpeciesGroup< NAtom >::SpeciesGroup().


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